Flexion.Org
Bad grammar and typos for total strangers
Wiki › Email Server
Wiki Index All Recent Edit Bottom

Email Server

1.   Introduction
1.1   Integrating Postfix and Dovecot
1.2   Defeating Spam
1.3   Migrating mail accounts

Introduction

This is still being worked on and is subject to change. The basic idea is that

  • Postfix is the SMTP server
  • Dovecot in the POP3/IMAP server.
  • Postfix uses Dovecot's SASL Library for SMTP Auth
  • Both Postfix and Dovecot use a CACert.org signed certificate for TLS/SSL
  • Both Postfix and Dovecot integrate with Virtual Hostess

Integrating Postfix and Dovecot

OK, here are the steps. The docs have the right information in them but not necessarily in the right order (yet) ;-)

Defeating Spam

I have attempted to put anti spam and anti virus counter measures in place that keep the resource overhead down and remain simple to administer.

Migrating mail accounts

apt-cache search imap sync tell me that the following tools...

  • imapcopy - IMAP backup, copy and migration tool
  • imapsync - IMAP synchronization, copy and migration tool
  • isync - Synchronize a local maildir with a remote IMAP4 mailbox
  • mailsync - Synchronize IMAP mailboxes
  • offlineimap - IMAP/Maildir synchronization and reader support

...might be of use when migrating mail account from one server to another. Hmmm, which to use?

IMAP Migration

 apt-get install imapsync

Test IMAP Sync
 imapsync --syncinternaldates --host1 old.example.org --user1 user@example.org --password1 secret --host2 new.example.org --user2 user@example.org --password2 secret --dry

Run IMAP Sync
 imapsync --syncinternaldates --host1 old.example.org --user1 user@example.org --password1 secret --host2 new.example.org --user2 user@example.org --password2 secret --delete --expunge --exclude Spam

POP3 Migration


Fetchmail

Some of the users of my email system have POP3 accounts provided by their ISPs. I use fetchmail to periodically collect mail from those remote accounts and inject it into their Inbox on my server.

  apt-get install fetchmail

Enable Fetchmail daemon mode by editing '/etc/default/fetchmail' and adding...

 START_DAEMON=yes

Now create '/etc/fetchmailrc'

 vi /etc/fetchmailrc

Sample

 # /etc/fetchmailrc for system-wide daemon mode
 # This file must be chmod 0600, owner fetchmail
 
 # The default for this option is 300, which polls the server every 5
 # minutes.
 #
 set daemon      43200

 # By default, the system-wide fetchmail will output logging messages to
 # syslog; uncomment the line below to disable this. This might be useful
 # if you are logging to another file using the 'logfile' option.
 #
 # set no syslog
 
 # Avoid loss on 4xx errors. On the other hand, 5xx errors get more
 # dangerous.
 #
 set no bouncemail
 
 # The following defaults are used when connecting to any server, and can
 # be overridden in the server description below.
 # 
 # Set antispam to -1, since it is far safer to use that together with no
 # bouncemail.
 #
 defaults:
   antispam -1 
   batchlimit 100
 
 # Example server section.
 #
 poll foo.bar.org with protocol pop3
   user baka there is localbaka here smtphost smtp.foo.bar.org;

Change the ownership and permissions.

 chown fetchmail /etc/fetchmailrc
 chmod 600 /etc/fetchmailrc

Finally, start the fetchmail daemon...

 /etc/init.d/fetchmail start

References

$Id: EmailServer,v 1.27 2008/07/08 13:56:54 martin Exp $

Wiki Index All Recent Edit Top
 
Valid XHTML Valid CSS Hacker