IMAP: Difference between revisions
(→Courier IMAP on Ubuntu: MailDir --> Maildir !!!) |
(→Courier IMAP: Moved on own page) |
||
(7 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
; [http://www.washington.edu/imap/ UW IMAP] |
; [http://www.washington.edu/imap/ UW IMAP] |
||
: IMAP server developped by the University of Washington. Uses a proprietory mailbox format '''mbx''', which is more or less a binary version of the usual mailbox format. A binary package exists on ''cygwin'', but it regularly suffers from locking problems. A patch exists to use '''maildir''' format though, but patch seems outdated. |
: IMAP server developped by the University of Washington. Uses a proprietory mailbox format '''mbx''', which is more or less a binary version of the usual mailbox format. A binary package exists on ''cygwin'', but it regularly suffers from locking problems. A patch exists to use '''maildir''' format though, but patch seems outdated. |
||
; [ |
; [[Courier|Courier IMAP]] |
||
: Courier-IMAP is a fast, scalable, enterprise IMAP server that uses ''Maildirs''. |
: Courier-IMAP is a fast, scalable, enterprise IMAP server that uses ''Maildirs''. |
||
; [http://cyrusimap.web.cmu.edu/ Cyrus IMAP] |
; [http://cyrusimap.web.cmu.edu/ Cyrus IMAP] |
||
: Developped by Carnegie Mellon. Also uses a private mailbox format. |
: Developped by Carnegie Mellon. Also uses a private mailbox format. |
||
;[[Dovecot|Dovecot IMAP]] |
|||
: A very fast IMAP server focusing on security, which supports mbox and Maildir. |
|||
== |
== Synchronizing IMAP == |
||
=== |
=== offlineimap === |
||
'''offlineimap''' allows you to read the same mailbox from multiple computers and ensures that your changes will be automatically reflected on all computers.<br> |
|||
* [http://www.courier-mta.org/imap/ Courier IMAP homepage] |
|||
See Yoni's page at [http://wiki.yobi.be/wiki/Offlineimap]. |
|||
** [http://www.courier-mta.org/maildir.html maildir - E-mail directory] |
|||
** [http://www.courier-mta.org/FAQ.html Courier FAQ] |
|||
* On ''openSUSE'': |
|||
** Package doc at <tt>/usr/share/doc/packages/courier-authlib</tt> and <tt>/usr/share/doc/packages/courier-imap</tt>. |
|||
* On ''Ubuntu'': |
|||
** https://help.ubuntu.com/community/Courier |
|||
* Manpages & package documentation: |
|||
** [http://www.courier-mta.org/maildirmake.html maildirmake(1)] |
|||
** couriertcpd(1) |
|||
** imapd(8) |
|||
** userdb(8) |
|||
** makeuserdb(8) |
|||
** <tt>/usr/share/doc/courier-doc</tt> (on Ubuntu, with package '''courier-doc''' installed) |
|||
=== |
=== imapsync === |
||
'''imapsync''' is very easy to use to migrate from one mailbox to another. The procedure here is based on the one given here [http://www.howtoforge.com/how-to-migrate-mailboxes-between-imap-servers-with-imapsync] |
|||
<source lang="bash"> |
|||
To install Courier IMAP: |
|||
# Migrating from me@host1.com to me@host2.com |
|||
* Install the required packages: |
|||
echo 'password' > pwd1 # We hide the password in files so that they don't appear with the command "ps aux" |
|||
<div style="padding-left:2em;"><source lang="bash">sudo apt-get install courier-imap courier-doc courier-imap-ssl</source></div> |
|||
echo 'password' > pwd2 |
|||
* Create '''/etc/courier/userdb.dat''' |
|||
chmod 600 pwd1 |
|||
<div style="padding-left:2em;"><source lang="bash"> |
|||
chmod 600 pwd2 |
|||
sudo su |
|||
imapsync --host1 host1.com --user1 me@host1.com --passfile1 pwd2 --host2 host2.com --user2 me@host2.com --passfile2 pwd2 |
|||
pw2userdb >/etc/courier/userdb |
|||
rm -f pwd1 |
|||
chmod 600 /etc/courier/userdb |
|||
rm -f pwd2 |
|||
makeuserdb |
|||
⚫ | |||
maildirmake /etc/skel/Maildir # Create Maildir directory for all new users |
|||
⚫ | |||
=== Courier IMAP on openSUSE === |
|||
Binary package for '''Courier IMAP''' is available on '''openSUSE''' (package '''courier-authlib''' and '''courier-imap'''). However it conflicts with the default IMAP server, ('''UW IMAP'''), which must first be uninstalled. |
|||
However it seems that '''imapsync''' is one-way only, and so not suitable for syncing live the same mailbox between several computers [http://www.zimbra.com/forums/migration/13702-imapsync-both-ways.html].<br> |
|||
=== Courier IMAP on Cygwin === |
|||
For this purpose, better use '''offlineimap'''. |
|||
See the page dedicated to [[Courier Cygwin]]. |
|||
== Testing IMAP == |
== Testing IMAP == |
||
Line 90: | Line 77: | ||
== Troubleshooting == |
== Troubleshooting == |
||
* Can't connect |
* Can't connect |
||
** Frequent mistake is that <tt>~/ |
** Frequent mistake is that <tt>~/Maildir</tt> was not created. Create the Maildir directory with: |
||
<div style="padding-left:4em;"><source lang="bash"> |
<div style="padding-left:4em;"><source lang="bash"> |
||
su accountname |
su accountname |
||
maildirmake ~/ |
maildirmake ~/Maildir |
||
</source></div> |
</source></div> |
Latest revision as of 15:13, 21 February 2011
IMAP servers
There are basically three main IMAP server solutions:
- UW IMAP
- IMAP server developped by the University of Washington. Uses a proprietory mailbox format mbx, which is more or less a binary version of the usual mailbox format. A binary package exists on cygwin, but it regularly suffers from locking problems. A patch exists to use maildir format though, but patch seems outdated.
- Courier IMAP
- Courier-IMAP is a fast, scalable, enterprise IMAP server that uses Maildirs.
- Cyrus IMAP
- Developped by Carnegie Mellon. Also uses a private mailbox format.
- Dovecot IMAP
- A very fast IMAP server focusing on security, which supports mbox and Maildir.
Synchronizing IMAP
offlineimap
offlineimap allows you to read the same mailbox from multiple computers and ensures that your changes will be automatically reflected on all computers.
See Yoni's page at [1].
imapsync
imapsync is very easy to use to migrate from one mailbox to another. The procedure here is based on the one given here [2]
# Migrating from me@host1.com to me@host2.com
echo 'password' > pwd1 # We hide the password in files so that they don't appear with the command "ps aux"
echo 'password' > pwd2
chmod 600 pwd1
chmod 600 pwd2
imapsync --host1 host1.com --user1 me@host1.com --passfile1 pwd2 --host2 host2.com --user2 me@host2.com --passfile2 pwd2
rm -f pwd1
rm -f pwd2
However it seems that imapsync is one-way only, and so not suitable for syncing live the same mailbox between several computers [3].
For this purpose, better use offlineimap.
Testing IMAP
Tools
Simply use tool like telnet to connect to the IMAP server. Or equivalently use netcat or socat:
% telnet server 143
% nc server 143
% socat - TCP:server:143
!!! Problem when connecting to Microsoft servers !!! - These servers explicitly require CRLF as line-terminator, not CR as sent by Linux tools. Only workaround so far is to connect through a windows telnet.
Scripts
Here some scripts to test that an IMAP server is working properly.
- To quickly test an imap server using telnet use:
% telnet server 143
01 LOGIN username password
02 LIST "" * # show all available mailboxes
03 SELECT mailbox # mailbox: e.g. INBOX
04 LOGOUT
- To show the information about a mailbox:
% telnet server 143
04 STATUS mailbox (MESSAGES)
- Between () you can place one or more of the following: MESSAGES, UNSEEN, RECENT UIDNEXT UIDVALIDITY
- And one of the following commands to view a message (1 is the first message * is wildcard for all):
05 FETCH 1 ALL # All IMAP headers
05 FETCH 1 FULL # Full headers and body info
05 FETCH 1 BODY # Body
05 FETCH 1 ENVELOPE # Envelope
05 FETCH * FULL # All email
- To fully retrieve a message use:
06 UID fetch 1:1 (UID RFC822.SIZE FLAGS BODY.PEEK[])
Troubleshooting
- Can't connect
- Frequent mistake is that ~/Maildir was not created. Create the Maildir directory with:
su accountname
maildirmake ~/Maildir