about summary refs log tree commit diff stats
path: root/tools/mutt.html
blob: 4cb5599221a07c0871b16b91d1a55730f8bb4dd9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color:
<!DOCTYPE html>
<html dir="ltr" lang="en">
    <head>
        <meta charset='utf-8'>
        <title>Mutt</title>
    </head>
    <body>
        <a href="index.html">Tools Index</a>

        <h1 id="mutt">Mutt</h1>

        <p>Mutt is a powerfull mail reader,
        <a href="http://www.mutt.org/doc/devel/manual.html">Mutt Manual</a>,
        is the best place to find information.
        I recomend <a href="http://realprogrammers.com/jump_start/mutt/">Jump Start: Mutt</a>,
        name says it all.</p>

        <h2 id="install">1. Install</h2>

        <p>Sysdoc <a href="../ports/mutt">mutt port</a> is a copy
        of opt mutt port with built in SMTP and SASL. Alternative
        is to use external programs like msmtp.</p>

        <pre>
        $ prt-get depinst mutt cyrus-sasl
        </pre>

        <p>Verify if mutt have SMTP support;</p>

        <pre>
        $ mutt -v | grep USE_SMTP
        +USE_POP  +USE_IMAP  +USE_SMTP
        </pre>

        <p>Verify if mutt have SASL support;</p>

        <pre>
        $ mutt -v | grep USE_SASL
        +USE_SSL_OPENSSL  -USE_SSL_GNUTLS  +USE_SASL  -USE_GSS  +HAVE_GETADDRINFO
        </pre>


        <p>Mutt will recognize follow locations for configurations
        files;</p>

        <dl>
            <dt>/usr/etc/Muttrc</dt>
            <dd>System configuration file for mutt.</dd>
            <dt>~/.muttrc</dt>
            <dd>User configuration file on home root.</dd>
            <dt>~/.mutt/muttrc</dt>
            <dd>User configuration inside home mutt folder.</dd>
        </dl>

        <p>Skeleton configuration will use the second user configuration
        (inside home mutt folder);</p>

        <pre>
        $ sudo mkdir /etc/skel/.mutt
        $ sudo touch /etc/skel/.mutt/mail_alias
        </pre>

        <p>Get gpg.rc example from distribution file;</p>

        <pre>
        $ tar xf /srv/ports/distfiles/mutt-1.6.1.tar.gz mutt-1.6.1/contrib/gpg.rc
        $ sudo mv mutt-1.6.1/contrib/gpg.rc /etc/skel/.mutt/
        </pre>

        <p>If you like to use sample.muttrc distributed with
        source code;</p>

        <pre>
        $ tar -xf /srv/ports/distfiles/mutt-1.6.1.tar.gz mutt-1.6.1/contrib/sample.muttrc
        $ sudo mv mutt-1.6.1/contrib/sample.muttrc /etc/skel/.mutt/muttrc
        </pre>

        <pre>
        $ rm -fr mutt-1.6.1/
        </pre>

        <h2 id="conf">2. Configure</h2>

        <p>Justin R. Miller <a href="http://codesorcery.net/old/mutt/mutt-gnupg-howto">Mutt Gnupg Howto</a>
        "Everything You Need To Know To Start Using GnuPG with Mutt"
        is a great reference. Multiple email accounts are gracefully
        handle by folder hooks, this hooks are defined in muttrc.
        When we change folder the hook is called, setting up the email
        account sepecific settings.<p>

        <p>Lets start configuring the two accounts, one for host system
        email and another for external email account. Change pgp_sign_as        according to your specific sub key for signing. Change
        <a href="conf/etc/skel/.mutt/muttrc">muttrc</a> with your
        preferences;</p>

        <pre>
        $ vim ~/.mutt/muttrc
        </pre>

        <pre>
        set config_charset="utf-8"
        # set locale="de_CH"
        set charset="utf-8"
        set send_charset="utf-8"
        set editor="vim"
        set visual=vim
        set auto_tag
        set sort=threads

        set sort_browser=reverse-date
        set sort_aux=reverse-last-date-received
        set duplicate_threads=yes

        set crypt_use_gpgme=yes

        ## automatically sign all outgoing messages
        set crypt_autosign=yes

        ## automatically encrypt outgoing messages
        set crypt_autoencrypt=yes

        ## automatically verify the sign of a message when opened
        set crypt_verify_sig=yes

        set pgp_sign_as=0x8BF422F79FC7C975BDF07828E88440BC35095A74
        #set pgp_sign_as=0x8BF422F7
        set pgp_timeout=1800
        set pgp_autosign=yes
        #set pgp_replyencrypt=yes

        source ~/.mutt/gpg.rc

        source "~/.mutt/mail_alias"
        set alias_file=~/.mutt/mail_alias

        # Header
        set header_cache =~/.mutt/cache/headers
        set message_cachedir =~/.mutt/cache/bodies
        set certificate_file =~/.mutt/certificates

        set timeout=10    # mutt 'presses' (like) a key for you 
                          #(while you're idle) each x sec to trigger 
                          #the thing below
        set mail_check=5  # mutt checks for new mails on every keystroke
                          # but not more often then once in 5 seconds
        set beep_new      # beep on new messages in the mailboxes

        ## Local system account
        folder-hook '.mail' 'source ~/.mutt/system'

        ## Remote account
        folder-hook '.mailext' 'source ~/.mutt/external'

        ## Default account
        source ~/.mutt/system

        ## Shortcuts
        macro index,pager &lt;f3&gt; '&lt;sync-mailbox&gt;&lt;enter-command&gt;source ~/.mutt/external&lt;enter&gt;&lt;change-folder&gt;!&lt;enter&gt;'

        macro index,pager &lt;f2&gt; '&lt;sync-mailbox&gt;&lt;enter-command&gt;source ~/.mutt/system&lt;enter&gt;&lt;change-folder&gt;!&lt;enter&gt;'
        </pre>

        <h3 id="system">2.1. System Email</h3>

        <p>Check and point enviroment mail variable to new local maildir;</p>

        <pre>
        $ echo "MAIL=$HOME/.mail/" >> ~/.bashrc
        $ source ~/.bashrc
        $ env | grep MAIL
        </pre>

        <p>Content of <a href="conf/etc/skel/.mutt/system">.mutt/system</a>;<p>

        <pre>
        color status green default

        set folder="~/.mail"
        set mbox_type=Maildir
        set spoolfile=/var/spool/mail/machine-admin
        set keep_flagged=yes

        set mbox="~/.mail"           # ~/.mailext/read_inbox
        set postponed="+.Drafts"
        set record="+.Sent"

        set use_from=yes

        set sendmail=/usr/sbin/exim
        set ssl_starttls=no
        set ssl_force_tls=no

        unset pop_user
        unset pop_pass
        unset pop_delete
        unset pop_host
        unset smtp_url

        set realname='machine-admin'
        set from=machine-admin@localhost
        </pre>

        <p>Create folder;</p>

        <pre>
        $ mkdir -p ~/.mail/{cur,new,tmp}
        </pre>

        <h3 id="external">2.2. External Email</h3>

        <p>Edit <a href="conf/etc/skel/.mutt/external">.mutt/external</a>;</p>

        <pre>
        color status blue default

        unset sendmail

        set folder="~/.mailext"
        set mbox_type=Maildir
        set spoolfile="~/.mailext"
        set keep_flagged=yes            # esc-f to mark messages in spool, and

        set mbox="~/.mailext"
        set postponed="+.Drafts"
        set record="+.Sent"

        set use_from=yes
        set ssl_starttls=yes
        set ssl_force_tls = yes

        set realname='User Name'
        set from=mail@external.org

        set pop_user="mail@external.org"
        set pop_pass="password"
        set pop_delete=yes
        set pop_host="pops://$pop_user:$pop_pass@pop.external.org:995"

        set smtp_url="smtps://$pop_user:$pop_pass@smtp.external.org/"
        </pre>

        <p>Create folder;</p>

        <pre>
        $ mkdir -p ~/.mailext/{cur,new,tmp}
        </pre>

        <h2 id="usemutt">3. Using Mutt</h2>

        <p>When listing messages the status flag mean;</p>

        <dl>
            <dt>s</dt>
            <dd>if the message is signed and not yet verified</dd>
            <dt>S</dt>
            <dd>if the message is signed and the signature is successfully verified</dd>
            <dt>P</dt>
            <dd>if the message is PGP encrypted</dd>
        </dl>

        <pre>
        $ mutt
        /home/c1admin/.mail does not exist. Create it? ([yes]/no): yes
        </pre>

        <p>If you get the following error;</p>

        <pre>
        /var/spool/mail/c1admin: No such file or directory (errno = 2)
        </pre>

        <p>Press q or x and lets send email to c1admin, this way we test
        if alias is working and exim create mail dir for us;</p>

        <pre>
        $ mutt -s "test" c1admin@c13 &lt; /dev/null
        </pre>

        <p>If you need to manually create a folder;</p>

        <h3 id="tagmail">3.1. Tag Email</h3>

        <p>Just press shift-T and then read

        <a href="http://www.mutt.org/doc/manual/manual-4.html#patterns">Patterns</a>
        . After matching desired messages press ; then the order, for example, d will
        mark all taged for deletion.<p>


        <h3 id="alias">3.2. Address alias</h3>

        <p><a href="http://dev.mutt.org/trac/wiki/MuttGuide/Aliases">Alias</a>
        makes easy to manage email addresses. Add this to your muttrc;</p>

        <pre>
        source "~/.mutt/mail_alias"
        set alias_file=~/.mutt/mail_alias
        </pre>

        <p>While on index or page press "a" to add address to alias file.</p>

        <h3 id="gpgkeys">3.3. GPG Keys</h3>

        <p>Import a public key from email;</p>

        <pre>
        ^K
        </pre>

        <p>^K is CTRL+K</p>

        <a href="index.html">Tools Index</a>
        <p>
        This is part of the LeetIO System Documentation.
        Copyright (C) 2021
        LeetIO Team.
        See the file <a href="../fdl-1.3-standalone.html">Gnu Free Documentation License</a>
        for copying conditions.</p>
    </body>
</html>
class="ni">&nbsp;the&nbsp;boundaries?<br> item&nbsp;can&nbsp;be&nbsp;an&nbsp;iterable&nbsp;like&nbsp;[y,&nbsp;x]&nbsp;or&nbsp;an&nbsp;object&nbsp;with&nbsp;x&nbsp;and&nbsp;y&nbsp;methods.</tt></dd></dl> <dl><dt><a name="Pager-__nonzero__"><strong>__nonzero__</strong></a>(self)</dt><dd><tt>Always&nbsp;True</tt></dd></dl> <dl><dt><a name="Pager-__str__"><strong>__str__</strong></a>(self)</dt></dl> <dl><dt><a name="Pager-contains_point"><strong>contains_point</strong></a>(self, y, x)</dt><dd><tt>Test&nbsp;whether&nbsp;the&nbsp;point&nbsp;(with&nbsp;absolute&nbsp;coordinates)&nbsp;lies<br> within&nbsp;the&nbsp;boundaries&nbsp;of&nbsp;this&nbsp;object.</tt></dd></dl> <dl><dt><a name="Pager-destroy"><strong>destroy</strong></a>(self)</dt><dd><tt>Called&nbsp;when&nbsp;the&nbsp;object&nbsp;is&nbsp;destroyed.<br> Override&nbsp;this!</tt></dd></dl> <dl><dt><a name="Pager-finalize"><strong>finalize</strong></a>(self)</dt><dd><tt>Called&nbsp;after&nbsp;every&nbsp;displayable&nbsp;is&nbsp;done&nbsp;drawing.<br> Override&nbsp;this!</tt></dd></dl> <dl><dt><a name="Pager-poke"><strong>poke</strong></a>(self)</dt><dd><tt>Called&nbsp;before&nbsp;drawing,&nbsp;even&nbsp;if&nbsp;invisible</tt></dd></dl> <dl><dt><a name="Pager-resize"><strong>resize</strong></a>(self, y, x, hei<font color="#909090">=None</font>, wid<font color="#909090">=None</font>)</dt><dd><tt>Resize&nbsp;the&nbsp;widget</tt></dd></dl> <hr> Data and other attributes inherited from <a href="ranger.shared.html#EnvironmentAware">ranger.shared.EnvironmentAware</a>:<br> <dl><dt><strong>env</strong> = None</dl> <hr> Data and other attributes inherited from <a href="ranger.shared.html#FileManagerAware">ranger.shared.FileManagerAware</a>:<br> <dl><dt><strong>fm</strong> = None</dl> <hr> Data descriptors inherited from <a href="ranger.shared.html#Awareness">ranger.shared.Awareness</a>:<br> <dl><dt><strong>__dict__</strong></dt> <dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd> </dl> <dl><dt><strong>__weakref__</strong></dt> <dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd> </dl> <hr> Methods inherited from <a href="ranger.gui.curses_shortcuts.html#CursesShortcuts">ranger.gui.curses_shortcuts.CursesShortcuts</a>:<br> <dl><dt><a name="Pager-addnstr"><strong>addnstr</strong></a>(self, *args)</dt></dl> <dl><dt><a name="Pager-addstr"><strong>addstr</strong></a>(self, *args)</dt></dl> <dl><dt><a name="Pager-color"><strong>color</strong></a>(self, keylist<font color="#909090">=None</font>, *keys)</dt><dd><tt>Change&nbsp;the&nbsp;colors&nbsp;from&nbsp;now&nbsp;on.</tt></dd></dl> <dl><dt><a name="Pager-color_at"><strong>color_at</strong></a>(self, y, x, wid, keylist<font color="#909090">=None</font>, *keys)</dt><dd><tt>Change&nbsp;the&nbsp;colors&nbsp;at&nbsp;the&nbsp;specified&nbsp;position</tt></dd></dl> <dl><dt><a name="Pager-color_reset"><strong>color_reset</strong></a>(self)</dt><dd><tt>Change&nbsp;the&nbsp;colors&nbsp;to&nbsp;the&nbsp;default&nbsp;colors</tt></dd></dl> <hr> Data and other attributes inherited from <a href="ranger.shared.settings.html#SettingsAware">ranger.shared.settings.SettingsAware</a>:<br> <dl><dt><strong>settings</strong> = &lt;ranger.ext.openstruct.OpenStruct object at 0x7f20a718ad90&gt;</dl> </td></tr></table></td></tr></table> </body></html>