<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"/> <title>mailtool</title> <link rel="stylesheet" href="manpage.css" type="text/css"/> <link rel="start" href="index.html" title="Cone: COnsole Newsreader And Emailer"/> <link rel="up" href="cone00index.html" title="Cone mail client"/> <link rel="prev" href="leaf.html" title="leaf"/> <link rel="next" href="libmail.html" title="LibMAIL reference"/> <link xmlns="" rel="icon" href="icon.gif" type="image/gif"/> <meta xmlns="" name="MSSmartTagsPreventParsing" content="TRUE"/> <!-- Copyright 2002 - 2007 Double Precision, Inc. See COPYING for distribution information. --> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center" rowspan="1">mailtool</th> </tr> <tr> <td width="20%" align="left" rowspan="1" colspan="1"> <a accesskey="p" href="leaf.html" shape="rect">Prev</a> </td> <th width="60%" align="center" rowspan="1" colspan="1"> <span class="application">Cone</span> mail client</th> <td width="20%" align="right" rowspan="1" colspan="1">  <a accesskey="n" href="libmail.html" shape="rect">Next</a></td> </tr> </table> <hr/> </div> <div class="refentry" lang="en" xml:lang="en"> <a id="mailtool" shape="rect" name="mailtool"> </a> <div class="titlepage"/> <div class="refnamediv"> <h2>Name</h2> <p>mailtool — Process mailboxes</p> </div> <div class="refsynopsisdiv"> <h2>Synopsis</h2> <div class="cmdsynopsis"> <p><code class="command">mailtool</code> [options...]</p> </div> </div> <div class="refsect1" lang="en" xml:lang="en"> <a id="id535212" shape="rect" name="id535212"> </a> <h2>USAGE</h2> <p><span class="command"><strong>mailtool</strong></span> is a diagnostic utility for handling various operations on mailboxes. <span class="command"><strong>mailtool</strong></span>'s main uses include: display the list of folders in a mailbox; displaying list of messages in a mailbox; and copying mailboxes.</p> <p>The following mailboxes can be accessed by <span class="command"><strong>mailtool</strong></span>:</p> <div class="variablelist"> <dl> <dt><span class="term">imap://<em class="replaceable"><code>userid</code></em>@<em class="replaceable"><code>server</code></em>[/options]</span></dt> <dd> <p>An IMAP account. <span class="command"><strong>mailtool</strong></span> will prompt for the login password.</p> </dd> <dt><span class="term">imaps://<em class="replaceable"><code>userid</code></em>@<em class="replaceable"><code>server</code></em>[/options]</span></dt> <dd> <p>An IMAP account accessed via an encrypted SSL connection.</p> </dd> <dt><span class="term">pop3://<em class="replaceable"><code>userid</code></em>@<em class="replaceable"><code>server</code></em>[/options]</span></dt> <dd> <p>A POP3 account. <span class="command"><strong>mailtool</strong></span> will prompt for the login password.</p> </dd> <dt><span class="term">pop3s://<em class="replaceable"><code>userid</code></em>@<em class="replaceable"><code>server</code></em>[/options]</span></dt> <dd> <p>A POP3 account accessed via an encrypted SSL connection.</p> </dd> <dt><span class="term">maildir:<em class="replaceable"><code>path</code></em></span></dt> <dd> <p>A local maildir mailbox. <code class="filename">path</code> specifies the maildir's location relative to the home directory (NOT the current directory).</p> </dd> <dt><span class="term">mbox:<em class="replaceable"><code>path</code></em></span></dt> <dd> <p>Local mbox mail folders. <code class="filename">path</code> specifies the path to an mbox folder file, or a directory containing mbox folders, relative to the home directory (NOT the current directory).</p> </dd> <dt><span class="term">inbox:<em class="replaceable"><code>path</code></em></span></dt> <dd> <p>Local mbox mail folders, like “<span class="quote">mbox:<em class="replaceable"><code>path</code></em></span>”; additionally, the system spool mailbox is automatically copied to <code class="filename">$HOME/Inbox</code>, which is accessible as folder <code class="literal">INBOX</code>.</p> </dd> </dl> </div> <p>The name of a remote IMAP or POP3 server may be followed by one or more options that control various settings of the IMAP or POP3 connection:</p> <div class="variablelist"> <dl> <dt><span class="term"><code class="literal">/cram</code></span></dt> <dd> <p>Do not open the account unless the server supports secure password authentication. Secure password authentication verifies the account's password using a challenge/response authentication mechanism (where the label "<code class="literal">cram</code>" comes from). The actual password is never actually transmitted to the server, and therefore cannot be intercepted while in transit over an untrusted network.</p> <p>Secure password authentication is not supported by all servers. This option may not work with some servers. This option does not enable secure password authentication, it only mandates its use. If the server supports secure password authentication, it will be used even without the <code class="literal">/cram</code> option. Traditional userid/password authentication will be used only if the server does not implement secure password authentication. The <code class="literal">/cram</code> option makes secure password authentication mandatory.</p> <p>The <code class="literal">/cram</code> option is marginally useful even with encrypted server connections. The secure password authentication never sends the explicit password to the server. Encryption makes it theoretically impossible to recover the password from an encrypted data connection; but with secure authentication the password is never sent over the connection in the first place (the password's validity is certified by exchanging certain mathematical calculations between the server and the client). If the server is compromised, the compromised server will not receive the account password (unless the password is recovered from the server in other ways).</p> </dd> <dt><span class="term"><code class="literal">/imap</code></span></dt> <dd> <p>Do not use the <a class="link" href="smap1.html" title="Appendix A. Simple Mail Access Protocol, Version 1" shape="rect">SMAP</a> if the server claims the availability of this experimental mail access protocol, and fall back to IMAP compatibility mode (this option is meaningful only with “<span class="quote"><code class="literal">imap://</code></span>” and “<span class="quote"><code class="literal">imaps://</code></span>” URLs).</p> </dd> <dt><span class="term"><code class="literal">/notls</code></span></dt> <dd> <p>Do not upgrade a plain connection to an encrypted one. This option is primarily used for testing and debugging purposes. Sometimes this option might be useful with servers that claim to offer encryption, but are unable to do so when taken up on their offer.</p> </dd> <dt><span class="term"><code class="literal">/novalidate-cert</code></span></dt> <dd> <p>Do not validate the server's SSL certificate when using an encrypted connection. Normally the mail server's SSL certificate must be validate when using an encrypted connection. The certificate's name must match the server's name, and the certificate must be signed by a trusted certificate authority.</p> <p>The encrypted connection normally fails if the certificate cannot be validate. Validation requires that a list of trusted certificate authorities must be known and configured. It's simply impossible to know which certificate authorities are valid without an explicit list of valid, known, trusted, certificate authorities. If a trusted authority list is not configured, no certificate can be validated. If the server's certificate is a self-signed certificate (this is often used for testing purposes), or if it's not signed by a known authority, the encrypted connection fails.</p> <p>This <code class="literal">/novalidate-cert</code> option disables certificate validation. The encrypted connection will be established even if the server's certificate would otherwise be rejected.</p> <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> <h3 class="title">Note</h3> <p>This option is applicable even when an encrypted IMAP or POP3 connection is not explicitly requested. Many mail servers are capable of automatically upgrading unencrypted connections to a fully-encrypted connection. If a mail server claims to be able to use encryption, then there's no reason not to use it. The result is that all encryption certification requirements still apply even when encryption is not explicitly requested.</p> </div> </dd> </dl> </div> <div class="refsect2" lang="en" xml:lang="en"> <a id="id536087" shape="rect" name="id536087"> </a> <h3>Displaying mailbox contents</h3> <div class="cmdsynopsis"> <p><code class="command">mailtool</code> -tree | -list <em class="replaceable"><code>account</code></em></p> </div> <p><code class="literal">-tree</code> shows a hierarchical representation of mail folders in <em class="replaceable"><code>account</code></em>. <code class="literal">-list</code> generates a simple folder listing, one folder name per line. <code class="literal">-tree</code> shows folder names, while <code class="literal">-list</code> shows the actual mail folder path in <em class="replaceable"><code>account</code></em>.</p> <div class="informalexample"> <pre class="programlisting" xml:space="preserve"> mailtool -tree imap://jsmith@mail.example.com/novalidate-cert/cram </pre> </div> </div> <div class="refsect2" lang="en" xml:lang="en"> <a id="id536359" shape="rect" name="id536359"> </a> <h3>Creating folders</h3> <div class="cmdsynopsis"> <p><code class="command">mailtool</code> -create | -createdir <em class="replaceable"><code>folder</code></em> <em class="replaceable"><code>name</code></em> <em class="replaceable"><code>account</code></em></p> </div> <p><code class="literal">-create</code> creates a new subfolder of <em class="replaceable"><code>folder</code></em> in <em class="replaceable"><code>account</code></em>. The new subfolder's name is <em class="replaceable"><code>name</code></em>. <code class="literal">-createdir</code> creates a new folder directory (a folder that contains other folders).</p> <div class="informalexample"> <pre class="programlisting" xml:space="preserve"> mailtool -create INBOX.lists announcements maildir:Maildir </pre> </div> <p>This command creates a new folder “<span class="quote">announcements</span>” as a subfolders of “<span class="quote">INBOX.lists</span>” in the local maildir.</p> </div> <div class="refsect2" lang="en" xml:lang="en"> <a id="id536475" shape="rect" name="id536475"> </a> <h3>Deleting folders</h3> <div class="cmdsynopsis"> <p><code class="command">mailtool</code> -delete | -deletedir <em class="replaceable"><code>folder</code></em> <em class="replaceable"><code>account</code></em></p> </div> <p><code class="literal">-delete</code> deletes an existing <em class="replaceable"><code>folder</code></em> in <em class="replaceable"><code>account</code></em>.</p> <p><code class="literal">-deletedir</code> deletes a folder directory.</p> <div class="informalexample"> <pre class="programlisting" xml:space="preserve"> mailtool -delete INBOX.lists.announcements maildir:Maildir </pre> </div> </div> <div class="refsect2" lang="en" xml:lang="en"> <a id="id536570" shape="rect" name="id536570"> </a> <h3>Renaming folders</h3> <div class="cmdsynopsis"> <p><code class="command">mailtool</code> -rename <em class="replaceable"><code>oldfolder</code></em> <em class="replaceable"><code>folder</code></em> <em class="replaceable"><code>name</code></em> <em class="replaceable"><code>account</code></em></p> </div> <p><code class="literal">-renames</code> renames an existing <em class="replaceable"><code>oldfolder</code></em>. The folder is renamed as <em class="replaceable"><code>name</code></em>, as a subfolder of <em class="replaceable"><code>folder</code></em>. <em class="replaceable"><code>folder</code></em> may be an empty string if the folder should be moved to the top level of <em class="replaceable"><code>account</code></em>'s folder hierarchy.</p> <div class="informalexample"> <pre class="programlisting" xml:space="preserve"> mailtool -rename INBOX.lists.announcements INBOX.lists Announcements maildir:Maildir </pre> </div> <p>The folder “<span class="quote">INBOX.lists.announcements</span>” is renamed to “<span class="quote">INBOX.lists.Announcements</span>”. This slightly unusual way to rename folder allows folders to be relocated in the mail <em class="replaceable"><code>account</code></em>'s folder hierarchy.</p> </div> <div class="refsect2" lang="en" xml:lang="en"> <a id="id536686" shape="rect" name="id536686"> </a> <h3>Reading folder's index</h3> <div class="cmdsynopsis"> <p><code class="command">mailtool</code> -index <em class="replaceable"><code>folder</code></em> <em class="replaceable"><code>account</code></em></p> </div> <p><code class="literal">-index</code> downloads and prints a summary of all messages in <em class="replaceable"><code>folder</code></em>, in <em class="replaceable"><code>account</code></em>. The summary shows the sender's and recipients' address, the message's subject, and size.</p> <div class="informalexample"> <pre class="programlisting" xml:space="preserve"> mailtool -index INBOX imap://john@mail.example.com/novalidate-cert </pre> </div> </div> <div class="refsect2" lang="en" xml:lang="en"> <a id="id536756" shape="rect" name="id536756"> </a> <h3>Removing a message from a folder</h3> <div class="cmdsynopsis"> <p><code class="command">mailtool</code> -remove <em class="replaceable"><code>folder</code></em> <em class="replaceable"><code>n</code></em> <em class="replaceable"><code>account</code></em></p> </div> <p><code class="literal">-remove</code> removes message #<em class="replaceable"><code>n</code></em> (ranging from 1 to the number of messages in the folder) in <em class="replaceable"><code>folder</code></em>, in <em class="replaceable"><code>account</code></em>. The message numbers may be obtained by using <code class="literal">-index</code>.</p> <p><em class="replaceable"><code>n</code></em> may be a comma-separated list of message numbers, in strictly numerically increasing order. <code class="literal">-remove</code> confirms the list of messages to remove and issues a “<span class="quote">Ready:</span>” prompt. Press <span class="keycap"><strong>ENTER</strong></span> to remove the messages.</p> <div class="informalexample"> <pre class="programlisting" xml:space="preserve"> mailtool -remove INBOX 28,31 imap://john@mail.example.com/novalidate-cert </pre> </div> </div> <div class="refsect2" lang="en" xml:lang="en"> <a id="id536868" shape="rect" name="id536868"> </a> <h3>Filtering messages</h3> <div class="cmdsynopsis"> <p><code class="command">mailtool</code> -filter <em class="replaceable"><code>folder</code></em> <em class="replaceable"><code>account</code></em></p> </div> <p><code class="literal">-filter</code> is a combination of <code class="literal">-index</code> and <code class="literal">-remove</code>. <em class="replaceable"><code>folder</code></em>'s index is downloaded, and the summary of each message is shown, one message at a time. Each message's summary is followed by a prompt: “<span class="quote">Delete, Skip, or Exit</span>”. Pressing <span class="keycap"><strong>D</strong></span> removes the message, <span class="keycap"><strong>S</strong></span> leaves the message unchanged, and <span class="keycap"><strong>E</strong></span> leaves the remaining messages unchanged.</p> <div class="informalexample"> <pre class="programlisting" xml:space="preserve"> mailtool -filter INBOX pop3://john@mail.example.com/novalidate-cert </pre> </div> <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> <h3 class="title">Note</h3> <p><code class="literal">-filter</code> is not meant to be used with large folders. Unless messages are removed quickly, the connection to the server may be disconnected for inactivity.</p> </div> </div> <div class="refsect2" lang="en" xml:lang="en"> <a id="id536982" shape="rect" name="id536982"> </a> <h3>Copying folders</h3> <div class="cmdsynopsis"> <p><code class="command">mailtool</code> [-recurse] -tofolder <em class="replaceable"><code>tofolder</code></em> -copyto <em class="replaceable"><code>toaccount</code></em> -fromfolder <em class="replaceable"><code>fromfolder</code></em> <em class="replaceable"><code>fromaccount</code></em></p> </div> <p>This command copies an entire folder, <code class="literal">fromfolder</code> in <code class="literal">fromaccount</code> to a new folder, <code class="literal">tofolder</code> (which will be created, if necessary) in <code class="literal">toaccount</code>. Optionally, <code class="literal">-recurse</code> specifies that all subfolders of <code class="literal">fromfolder</code> should also be copied.</p> <div class="informalexample"> <pre class="programlisting" xml:space="preserve"> mailtool -tofolder INBOX -copyto maildir:Maildir \ -fromfolder "INBOX" imap://mbox100@mail.example.com/novalidate-cert mailtool -recurse -tofolder INBOX.converted_mail \ -copyto maildir:Maildir -fromfolder "mail" \ imap://mbox100@mail.example.com/novalidate-cert </pre> </div> <p>This example first copies the INBOX on the IMAP server to <code class="filename">$HOME/Maildir</code>, then copies subfolders of “<span class="quote">mail</span>” on the IMAP server to the “<span class="quote">converted_mail</span>” subfolder in the maildir.</p> <div class="informalexample"> <pre class="programlisting" xml:space="preserve"> mailtool -tofolder INBOX -copyto maildir:Maildir \ -fromfolder "INBOX" inbox:mail mailtool -recurse -tofolder INBOX.converted_mail \ -copyto maildir:Maildir -fromfolder "" mbox:mail </pre> </div> <p>This example first copies <code class="filename">$HOME/Inbox</code> (accessed as the INBOX folder in inbox:mail) to <code class="filename">$HOME/Maildir</code>, then copies mbox folders from <code class="filename">$HOME/mail</code> to the “<span class="quote">converted_mail</span>” subfolder in the maildir.</p> <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> <h3 class="title">Note</h3> <p>Mail accounts that contain hybrid folders (folders that contain both messages and subfolders) can only be copied to account types that also support hybrid folders: either local maildirs, or to remote servers that support hybrid folders.</p> </div> </div> </div> <div class="refsect1" lang="en" xml:lang="en"> <a id="id537183" shape="rect" name="id537183"> </a> <h2>SEE ALSO</h2> <p><a class="link" href="cone.html" title="cone" shape="rect"><span class="citerefentry"><span class="refentrytitle">cone</span>(1)</span></a>.</p> </div> </div> <div class="navfooter"> <hr/> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left" rowspan="1" colspan="1"> <a accesskey="p" href="leaf.html" shape="rect">Prev</a> </td> <td width="20%" align="center" rowspan="1" colspan="1"> <a accesskey="u" href="cone00index.html" shape="rect">Up</a></td> <td width="40%" align="right" rowspan="1" colspan="1">  <a accesskey="n" href="libmail.html" shape="rect">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top" rowspan="1" colspan="1">leaf </td> <td width="20%" align="center" rowspan="1" colspan="1"> <a accesskey="h" href="index.html" shape="rect">Home</a> | <a accesskey="t" href="bk01-toc.html" shape="rect">ToC</a></td> <td width="40%" align="right" valign="top" rowspan="1" colspan="1">  <span class="application">LibMAIL</span> reference</td> </tr> </table> </div> </body> </html>