ENABLING MAILDIR, CONFIGURING IMAP AND POP ------------------------------------------ 1. Edit the file "main.cf" (using vi or ee) Add the following lines to main.cf: home_mailbox = Maildir/ 2. Create a Maildir folder for the sysadm user: (DO THIS AS THE SANOG USER!) $ mkdir /home/sysadm/Maildir Note: if you do not do this as the sysadm user, the mail system will NOT be able to deliver mail. 3. Try sendmail mail again to your domain: $ echo "test with maildir" | mail -s "test maildir" sysadm@MYNAME.ws.nsrc.org * Now, run mutt again: $ mutt ... do you see your mail ? No, the reason is that now the mail is not stored in /var/mail, but in the "Maildir/" directory in your home dir. To access it, first quit mutt ('q'), then relaunch mutt like this: $ mutt -f ~sysadm/Maildir/ ... this explicitly tells mutt to access the "Maildir" in the home (~) directory of the user "sysadm". Why Maildir ? It's a better mail storage format when many mails need to be accessed quickly - one email / file on the disk. But what if you want to read your mail remotely ? 4. Install and configure the Courier IMAP daemon # apt-get install courier-imap When asked about the web-enabled configuration file, say NO It should now be started! 5. You may now use mutt to read your mail via POP, and IMAP * First, tell mutt NOT to attempt SSL negotiation: $ echo 'set ssl_starttls = no' > /home/sysadm/.muttrc (We have not configured an SSL certificate yet, therefore we need to disable this option for the time being) Now, run mutt: POP: $ mutt -f pop://sysadm@pcX (where pcX is your own machine) Password for sysadm@pcX: IMAP: $ mutt -f imap://sysadm@pcX (where pcX is your own machine) Password for sysadm@pcX: ... you can now read your mail remotely, and you can also read mail on other machines: $ mutt -f pop://sysadm@pcY (where pcY is another machine in the room) or $ mutt -f imap://sysadm@pcY (where pcY is another machine in the room) 6. Open another window (or terminal), and log in as 'root'. * Now, run tcpdump so you can see the contents of the traffic on the POP (110) and IMAP (143) ports: # tcpdump -X -s0 -n port 143 or port 110 * Now ask someone else to read mail on YOUR server * What do you observe in the tcpdump window ? 7. Try to setup your mail program on your laptop (Outlook, Thunderbird, ...) to read mail on your newly installed POP/IMAP server!