1MAILTOOL(1)                                                        MAILTOOL(1)
2
3
4

NAME

6       mailtool - Process mailboxes
7

SYNOPSIS

9       mailtool [ options ... ]
10
11

USAGE

13       mailtool  is  a  diagnostic  utility for handling various operations on
14       mailboxes.  mailtool's main uses include: display the list  of  folders
15       in  a  mailbox;  displaying  list of messages in a mailbox; and copying
16       mailboxes.
17
18       The following mailboxes can be accessed by mailtool:
19
20       imap://userid@server[/options]
21              An IMAP account.  mailtool will prompt for the login password.
22
23       imaps://userid@server[/options]
24              An IMAP account accessed via an encrypted SSL connection.
25
26       pop3://userid@server[/options]
27              A POP3 account.  mailtool will prompt for the login password.
28
29       pop3s://userid@server[/options]
30              A POP3 account accessed via an encrypted SSL connection.
31
32       maildir:path
33              A local maildir mailbox.  path specifies the maildir's  location
34              relative to the home directory (NOT the current directory).
35
36       mbox:path
37              Local  mbox  mail  folders.   path specifies the path to an mbox
38              folder file, or a directory containing mbox folders, relative to
39              the home directory (NOT the current directory).
40
41       inbox:path
42              Local  mbox  mail folders, like ``mbox:path''; additionally, the
43              system spool mailbox is  automatically  copied  to  $HOME/Inbox,
44              which is accessible as folder INBOX.
45
46       The name of a remote IMAP or POP3 server may be followed by one or more
47       options that control various settings of the IMAP or POP3 connection:
48
49       /cram  Do not open the account unless the server supports secure  pass‐
50              word  authentication.   Secure  password authentication verifies
51              the account's password using a challenge/response authentication
52              mechanism (where the label "cram" comes from).  The actual pass‐
53              word is never actually transmitted to the server, and  therefore
54              cannot  be  intercepted  while in transit over an untrusted net‐
55              work.
56
57              Secure password authentication is not supported by all  servers.
58              This  option  may  not work with some servers.  This option does
59              not enable secure password authentication, it only mandates  its
60              use.   If the server supports secure password authentication, it
61              will  be  used  even  without  the  /cram  option.   Traditional
62              userid/password  authentication  will be used only if the server
63              does not implement secure password  authentication.   The  /cram
64              option makes secure password authentication mandatory.
65
66              The /cram option is marginally useful even with encrypted server
67              connections.  The secure password authentication never sends the
68              explicit  password to the server.  Encryption makes it theoreti‐
69              cally impossible to recover the password from an encrypted  data
70              connection; but with secure authentication the password is never
71              sent over the connection in  the  first  place  (the  password's
72              validity  is certified by exchanging certain mathematical calcu‐
73              lations between the server and the client).  If  the  server  is
74              compromised, the compromised server will not receive the account
75              password (unless the password is recovered from  the  server  in
76              other ways).
77
78       /imap  Do  not  use  the  SMAP if the server claims the availability of
79              this experimental mail access protocol, and fall  back  to  IMAP
80              compatibility   mode   (this  option  is  meaningful  only  with
81              ``imap://'' and ``imaps://'' URLs).
82
83       /nossl Do not upgrade a plain connection to  an  encrypted  one.   This
84              option  is  primarily  used  for testing and debugging purposes.
85              Sometimes this option might be useful with servers that claim to
86              offer encryption, but are unable to do so when taken up on their
87              offer.
88
89       /novalidate-cert
90              Do not validate the  server's  SSL  certificate  when  using  an
91              encrypted  connection.   Normally the mail server's SSL certifi‐
92              cate must be validate when using an encrypted  connection.   The
93              certificate's  name  must  match the server's name, and the cer‐
94              tificate must be signed by a trusted certificate authority.
95
96              The encrypted connection normally fails if the certificate  can‐
97              not  be  validate.   Validation  requires that a list of trusted
98              certificate authorities must be known and configured.  It's sim‐
99              ply  impossible  to know which certificate authorities are valid
100              without an explicit list of valid, known,  trusted,  certificate
101              authorities.   If a trusted authority list is not configured, no
102              certificate can be validated.  If the server's certificate is  a
103              self-signed  certificate  (this  is  often used for testing pur‐
104              poses), or  if  it's  not  signed  by  a  known  authority,  the
105              encrypted connection fails.
106
107              This  /novalidate-cert  option  disables certificate validation.
108              The  encrypted  connection  will  be  established  even  if  the
109              server's certificate would otherwise be rejected.
110
111              Note:  This  option is applicable even when an encrypted IMAP or
112              POP3 connection is not explicitly requested.  Many mail  servers
113              are  capable  of automatically upgrading unencrypted connections
114              to a fully-encrypted connection.  If a mail server claims to  be
115              able  to  use  encryption, then there's no reason not to use it.
116              The result is that  all  encryption  certification  requirements
117              still apply even when encryption is not explicitly requested.
118
119   DISPLAYING MAILBOX CONTENTS
120       mailtool { -tree | -list } account
121
122
123       -tree  shows  a hierarchical representation of mail folders in account.
124       -list generates a simple folder listing,  one  folder  name  per  line.
125       -tree shows folder names, while -list shows the actual mail folder path
126       in account.
127
128       mailtool -tree imap://jsmith@mail.example.com/novalidate-cert/cram
129
130   CREATING FOLDERS
131       mailtool { -create | -createdir } folder name account
132
133
134       -create creates a new subfolder of folder in  account.   The  new  sub‐
135       folder's  name  is  name.  -createdir creates a new folder directory (a
136       folder that contains other folders).
137
138       mailtool -create INBOX.lists announcements maildir:Maildir
139
140       This command creates a new folder ``announcements'' as a subfolders  of
141       ``INBOX.lists'' in the local maildir.
142
143   DELETING FOLDERS
144       mailtool { -delete | -deletedir } folder account
145
146
147       -delete deletes an existing folder in account.
148
149       -deletedir deletes a folder directory.
150
151       mailtool -delete INBOX.lists.announcements maildir:Maildir
152
153   RENAMING FOLDERS
154       mailtool -rename oldfolder folder name account
155
156
157       -renames renames an existing oldfolder.  The folder is renamed as name,
158       as a subfolder of folder.  folder may be an empty string if the  folder
159       should be moved to the top level of account's folder hierarchy.
160
161       mailtool -rename INBOX.lists.announcements INBOX.lists Announcements maildir:Maildir
162
163       The     folder     ``INBOX.lists.announcements''    is    renamed    to
164       ``INBOX.lists.Announcements''.  This slightly  unusual  way  to  rename
165       folder  allows  folders  to  be  relocated in the mail account's folder
166       hierarchy.
167
168   READING FOLDER'S INDEX
169       mailtool -index folder account
170
171
172       -index downloads and prints a summary of all  messages  in  folder,  in
173       account.   The  summary shows the sender's and recipients' address, the
174       message's subject, and size.
175
176       mailtool -index INBOX imap://john@mail.example.com/novalidate-cert
177
178   REMOVING A MESSAGE FROM A FOLDER
179       mailtool -remove folder n account
180
181
182       -remove removes message #n (ranging from 1 to the number of messages in
183       the folder) in folder, in account.  The message numbers may be obtained
184       by using -index.
185
186       n may be a comma-separated list of message numbers, in strictly numeri‐
187       cally increasing order. -remove confirms the list of messages to remove
188       and issues a ``Ready:'' prompt.  Press ENTER to remove the messages.
189
190       mailtool -remove INBOX 28,31 imap://john@mail.example.com/novalidate-cert
191
192   FILTERING MESSAGES
193       mailtool -filter folder account
194
195
196       -filter is a combination of -index  and  -remove.   folder's  index  is
197       downloaded,  and the summary of each message is shown, one message at a
198       time.  Each message's summary is followed by a prompt: ``Delete,  Skip,
199       or  Exit''.   Pressing  D  removes  the  message,  S leaves the message
200       unchanged, and E leaves the remaining messages unchanged.
201
202       mailtool -filter INBOX pop3://john@mail.example.com/novalidate-cert
203
204              Note: -filter is not  meant  to  be  used  with  large  folders.
205              Unless  messages  are  removed  quickly,  the  connection to the
206              server may be disconnected for inactivity.
207
208   COPYING FOLDERS
209       mailtool [ -recurse ] -tofolder tofolder -copyto toaccount  -fromfolder
210       fromfolder fromaccount
211
212
213       This  command  copies  an entire folder, fromfolder in fromaccount to a
214       new folder, tofolder (which will be created,  if  necessary)  in  toac‐
215       count.   Optionally,  -recurse  specifies  that all subfolders of from‐
216       folder should also be copied.
217
218       mailtool -tofolder INBOX -copyto maildir:Maildir \
219           -fromfolder "INBOX" imap://mbox100@mail.example.com/novalidate-cert
220
221       mailtool -recurse -tofolder INBOX.converted_mail \
222           -copyto maildir:Maildir -fromfolder "mail" \
223               imap://mbox100@mail.example.com/novalidate-cert
224
225       This  example  first  copies  the  INBOX  on   the   IMAP   server   to
226       $HOME/Maildir, then copies subfolders of ``mail'' on the IMAP server to
227       the ``converted_mail'' subfolder in the maildir.
228
229       mailtool -tofolder INBOX -copyto maildir:Maildir \
230          -fromfolder "INBOX" inbox:mail
231
232       mailtool -recurse -tofolder INBOX.converted_mail \
233           -copyto maildir:Maildir -fromfolder "" mbox:mail
234
235       This example first copies $HOME/Inbox (accessed as the INBOX folder  in
236       inbox:mail)  to $HOME/Maildir, then copies mbox folders from $HOME/mail
237       to the ``converted_mail'' subfolder in the maildir.
238
239              Note: Mail accounts that contain hybrid  folders  (folders  that
240              contain  both  messages  and  subfolders)  can only be copied to
241              account types that also support  hybrid  folders:  either  local
242              maildirs, or to remote servers that support hybrid folders.
243

SEE ALSO

245       cone(1).
246
247
248
249                                 10 April 2006                     MAILTOOL(1)
Impressum