Tag: dovecot


Linksys NSLU2: time server with NTP

Apr 24, 2008 Author Nik

If you’re running an email server on your Slug, where accurate server time is vital, or you simply want the Slug’s system time to be accurate, you need to make a few changes.

When it comes out of the factory the Slug has an inherrent bug which causes the internal clock to lose time; apparently Linksys tried to fix this problem by adjusting the time regularly (using cron) but it seems the time is adjusted in the wrong direction – thus, the error is doubled. This problem is fixed in Unslung 2.6 and higher anyway (Unslung 2.10 is the latest release as at Jan 2009), so we can remove the relevant crontab entry.

Edit the crontab file:

vi /etc/crontab

Comment out the call to hwclock (the Linksys ‘fix’). The hash (#) symbol is used to denote a comment:

#1 * * * * root /usr/sbin/hwclock -s &>/dev/null

Now install ntpd, and edit the config file to contain time servers that are geographically close to you – you can find out what these are by visiting http://www.pool.ntp.org/. Editing the config file is quite self-explanatory.

install ntp
vi /opt/etc/ntp/ntp.conf

Now edit the ntp startup script; there are a few things we need to do to make sure the time is set and maintained correctly.

vi /opt/etc/init.d/S77ntp

Add the following lines just before the existing call to ntp:

/opt/bin/tickadj 10000 > /dev/null
/opt/bin/ntpd -q -c /opt/etc/ntp/ntp.conf > /dev/null

The first line corrects the Slug’s tick value, and the second line makes ntp quickly (-q) set the time using the specified time servers, and exits. It is important to note that when ntp is running, it does not just simply set the correct time regularly; it constantly checks the time against that of the time servers, and gradually brings the system time in line. The call we just added, with the -q flag, ensures that the Slug has pretty accurate time before ntp starts properly.

Speaking of which, you will need to make sure the Slug has accurate time now. This can be done using the web interface, for example. It only needs to be as accurate as you can get it, and ntp will take care of the rest.

Now simply restart ntp:

/opt/etc/init.d/S77ntp restart

It will take a while for ntp to synchronise with the time servers you specified in the config file, sometimes upwards of 15 minutes – so don’t be too concerned if nothing seems to be happening straight away. You can check what’s going on with the ntpq tool:

ntpq -p

The command will list information about the time servers. If ntp has decided on a server’s suitability for synchronisation, the time server’s name will be preceeded by * (the chosen server), + (server is suitable), or - (server is unsuitable).

Note: if you are running Dovecot on your Slug, and ntp adjusts the time backwards after you initially set the Slug’s time (using the web interface), Dovecot will complain about time going backwards, and die. You will need to restart Dovecot; but this only happens while you’re configuring ntp, and won’t happen during normal operation once ntp is running.

If this information was useful, please leave a comment to let me know!


Linksys NSLU2: SSL and TLS for Postfix and Dovecot

Apr 23, 2008 Author Nik

If you installed openssh (which is highly recommended, rather than using telnet to connect to your Slug), you already have openssl installed. It can’t hurt to check though (openssl is a prerequisite for this guide):

ipkg install openssl

Without going too deeply into SSL or TLS discussion, there are a few things to know. TSL is the successor to SSL, but they’re both very similar, being protocols for secure communication. We’ll be using SSL for pop3 and TLS for smtp.

In addition to encryption, SSL and TLS offer the ability to ensure we are communicating with the server we think we are. This is achieved through trust; when we first enter communication with our server, it will send us its certificate. This certificate is signed by a Certification Authority (CA) attesting that the server is who it says it is. Of course, we have to trust the CA’s word on this, but usually the CA will be someone reputable like Comodo or VeriSign.

But we don’t need to convince the public we are who we say we are, we only need to make sure that we’re connecting to our own email server. So we’ll be acting as our own CA, and signing our own certificate. After all, if you can’t trust yourself, who can you trust?

Versions

This how-to guide was updated in May 2009 for compatibility with the following package versions:

  • Postfix 2.3.6-3
  • Dovecot v1.2.0.beta1-2

This how-to may also work with previous versions, but may require slight changes with respect to paths – for example, previous versions of Dovecot installed dovecot.conf to /opt/etc/dovecot.conf, but the latest version installs it to /opt/etc/dovecot/dovecot.conf.

Creating the CA key and certificate

First of all, let’s find somewhere to store all our SSL stuff. I chose /opt/etc/ssl. Make the directory if it’s not already there, and cd to it. We need to create a few directories and files that openssl expects.

mkdir certs crl csr newcerts private
touch index.txt
echo 01 > serial

The openssl distribution came with a default configuration file, and we’re going to edit some of the values, so be sure to back it up first:

cp /opt/share/openssl/openssl.cnf /opt/share/openssl/openssl.cnf.orig

Now edit the config file:

vi /opt/share/openssl/openssl.conf

And modify the contents as you see fit. Pay particular attention to the paths; there’s only a few things you need to change:

dir = /opt/etc/ssl
[ policy_match ]
countryName = match
stateOrProvinceName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
emailAddress = optional

Save the file, and you are ready to create your own CA private key and certificate with the following command:

openssl req -new -x509 -days 3650 -keyout private/cakey.pem -out cacert.pem

You’ll be prompted for a little bit of information; you can leave fields empty to accept the [default], or enter a period to leave the field blank. Note that I edited the default values in the config file.

Country Name (2 letter code) [UK]:
State or Province Name (full name) [England]:
Locality Name (eg, city) [London]:
Organization Name (eg, company) []:
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:Nik Rivers CA
Email Address []:

The important field is Common Name (CN); it is the name of your CA. Once you have entered all the required data, openssl will generate a private key and a certificate. Note that you will be asked for a passphrase; your private key cannot be used by anyone who doesn’t know this passphrase. You can remove the passphrase if you like – I chose to do so because I couldn’t imagine anyone wanting to misuse it, let alone being able to find it in the first place.

mv private/cakey.pem private/cakey.pem.orig
openssl rsa -in private/cakey.pem.orig -out private/cakey.pem
rm private/cakey.pem.orig

Creating the mail server key and certificate

Now simply issue this command to create your mail server certificate signing request:

openssl req -newkey rsa:1024 -keyout private/mailserver.key -keyform PEM -out csr/mailserver.csr

You’ll be asked a few familiar questions; this time, answer the questions bearing in mind this is the certificate for your mail server. Of particular importance is the CN field, which should ideally be the fully-qualified hostname of your mail server, such as mail.yourdomain.com. The challenge password and optional company name can be left blank. Now we must remove the passphrase from the mail server key – since otherwise Dovecot requires the passphrase to be provided in the config file (in plain text) and Postfix just plain won’t work.

mv private/mailserver.key private/mailserver.key.orig
openssl rsa -in private/mailserver.key.orig -out private/mailserver.key
rm private/mailserver.key.orig

Finally, sign your request with:

openssl ca -in csr/mailserver.csr

You will be asked if you want to sign the certificate, and whether you want to commit. Double-check the data, answer yes to both questions, and openssl will dump a load of info in front of you. You can now view your mail server’s signed certificate with the command:

more newcerts/01.pem

You can copy and rename the 01.pem and cacert.pem files to something more meaningful if you like, and if you will be using Windows clients to access the email server I recommend changing the file extension from pem to crt, so that Windows understands the file format:

cp newcerts/01.pem certs/mailserver.pem
cp newcerts/01.pem certs/mailserver.crt
cp cacert.pem certs/
cp cacert.pem certs/ca.crt

I then removed the certificate signing request.

rm csr/mailserver.csr

Configuring Postfix

vi /opt/etc/postfix/main.cf

Add this at the bottom of the file:

# TLS
smtpd_tls_cert_file = /opt/etc/ssl/certs/mailserver.crt
smtpd_tls_key_file = /opt/etc/ssl/private/mailserver.key
smtpd_tls_security_level = may

Setting the smtpd_tls_security_level parameter to may allows clients to connect with or without TLS; we could set this to encrypt, which forces the use of TLS, but my testing shows that it prevents other MTAs from being able to relay mail to the Slug.

Restart Postfix:

/opt/etc/init.d/S69postfix restart

Configuring Dovecot

vi /opt/etc/dovecot/dovecot.conf

Change or add (as appropriate) the following:

protocols = pop3s
ssl_disable = no
ssl_cert_file = /opt/etc/ssl/certs/mailserver.crt
ssl_key_file = /opt/etc/ssl/private/mailserver.key

Restart Dovecot:

/opt/etc/init.d/S90dovecot restart

Done.

Using the certificates

You have a couple of options. Your email client will probably ask you if you should trust the server’s certificate now and always, and agreeing to this is good enough.

Or you could install your CA certificate on your computer, which would cause all certificates that you, as a CA, sign – including your mail server’s certificate.

In Windows Vista, this is simply a case of right-clicking on the cakey.crt file, and selecting Install Certificate. The Certificate Import Wizard then guides you through the process – but when it asks you which certificate store to use, select the Trusted Root Certification Authorities store. Now when you open your mailserver.crt file Windows will show the certificate as being trusted implicitly since it was issued by you.

Configuring your mail client

All you need to do is tell your mail client to use TLS when connecting to the smtp server, and to use SSL over port 995 (pop3s) when connecting to the pop3 server.

For example, in Office Outlook 2007, when editing your mail account, click More Settings… and go to the Advanced tab. Under Incoming server (POP3) tick This server requires an encrypted connection (SSL). This will automatically change the pop3 port to 995. Under Outgoing server (SMTP) change Use the following type of encrypted connection to TLS. The Auto setting will also work, but why make Outlook guess when you can tell it the answer?

If this information was useful, please leave a comment to let me know!


Linksys NSLU2: email with Postfix and Dovecot

Apr 22, 2008 Author Nik

I’m using Postfix as the mail transport agent (MTA) and Dovecot as the mail delivery agent (MDA), and the mail server will serve just one domain (for now). The domain will be served as a virtual host. This means that the mail users don’t need their own login account on the server, and additional domains can be served in future with minimal changes.

Many thanks go to Raymond Mentjens (www.mentjens.nl) for his help in fixing a few (actually, quite a few) errors, and for all his feedback while he followed this article.  He has also created his own guides in Dutch – so if you read Dutch better than English, you may want to take a look at his site.

Versions

This how-to guide was updated in May 2009 for compatibility with the following package versions:

  • Postfix 2.3.6-3
  • Dovecot v1.2.0.beta1-2

This how-to may also work with previous versions, but may require slight changes with respect to paths – for example, previous versions of Dovecot installed dovecot.conf to /opt/etc/dovecot.conf, but the latest version installs it to /opt/etc/dovecot/dovecot.conf.

Install Postfix

Issue the command:

ipkg install postfix

The Postfix installation automatically creates a new group called maildrop; check maildrop is created:

more /etc/group

If the group is not there, you will have to create it yourself. Also note that it might suddenly disappear, requiring you to add it manually. For both eventualities, see the notes below.

Now we’ll need to start editing the configuration files to customise Postfix to our needs.

vi /opt/etc/postfix/master.cf

Add -v to the end of the line that specifies the smtp daemon so it reads smtpd -v (the line you need to modify is the first in the table, just beneath several lines of comments). This enables verbose output to the log file, which you should monitor in a separate PuTTY window using the following command:

tail -f /var/log/messages

This will help give you an idea of when and why problems occur. Note that tail sometimes hangs, and if you don’t see log output when you think you should then it may be time to abort tail (with CTRL+C) and restart it.

Let’s edit the main Postfix configuration file:

vi /opt/etc/postfix/main.cf

And provide our own values for the following parameters:

myhostname = <your slug’s host name – eg. mail.yourdomain.com>
inet_interfaces = all
proxy_interfaces = <your external ip address>
mynetworks_style = subnet

Before Postfix can be started, it needs to know where to deliver mail that is addressed to users such as root, postmaster, and other pseudo-accounts. The file that contains this mapping is /opt/etc/postfix/aliases. Edit the file:

vi /opt/etc/postfix/aliases

Uncomment the root alias, and provide the address where mail to root should be delivered (using your own address is a wise choice):

# Person who should get root’s mail. Don’t receive mail as root!
root: <your email address>

Now the file should be copied to /opt/etc/aliases, and turned into a hash file that postfix can read, using the newaliases tool. The output file is /opt/etc/aliases.db:

cp /opt/etc/postfix/aliases /opt/etc/aliases
newaliases

Now start Postfix, keeping an eye on your second PuTTY window for any messages Postfix might emit.

/opt/etc/init.d/S69postfix

At various points you’ll need to change Postfix configuration, and Postfix will need to reload those changes. You can do this with:

/opt/etc/init.d/S69postfix restart

Or, if you don’t like to keep stopping and starting it, you can simply issue:

postfix reload

Testing Postfix

Use telnet to connect to your slug’s smtp port:

telnet <slug’s host name or IP address> smtp

Make sure you can send mail, by having the following conversation with Postfix:

220 mail.yourdomain.com ESMTP Postfix
mail from:some_user
250 2.1.0 Ok
rcpt to:<an external email address you can check>
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
Subject:Test Mail 1
This is a test message.
.
250 2.0.0 Ok: queued as EF7E4208003

When you check the email address to which you sent your test mail, you’ll see it comes from some_user@mail.localdomain (or something similar, according to what you put in your postfix configuration file), and is generally badly formed. Don’t worry, a proper email client will provide the necessary data, whereas we only provided the bare minimum. Note that some mail servers may reject this test mail because the sender’s address is malformed (i.e. the domain doesn’t exist). In this case, you will need to use a valid-looking email address (such as some_user@test.com) or even your own address.

If you don’t receive the test email, you can check the postfix queue to see whether an error occured:

postqueue -p

And also delete any failed/stuck messages:

postsuper -d <queue_id>

On a side note, it’s a good demonstration of how easy it is to send untraceable spam. The IP address in the email header is the only indication of where the email originated; but this can be faked quite easily.

Finalise Postfix Configuration

There’s already a convenient user and group (both called mail) configured by the system which Postfix can use to manage the mail store, so all we need to do it find out the uid and gid.

grep mail /etc/passwd

The 3rd and 4th elements of the output are the uid and gid respectively. Write them down; we’ll need them in a minute.

We need a disk location for storing users’ mail; I chose /var/spool/vmail, which seems as good as any. The following script creates the initial directory structure, along with the additional directories for user@yourdomain.com mail storage. The /var/spool directory didn’t exists on my system, so rather than checking to see if there was a more logical/suitable storage location elsewhere, I simply created it with brute force.

mkdir /var/spool
cd /var/spool
mkdir vmail
cd vmail
mkdir yourdomain.com
cd yourdomain.com
mkdir user
cd user
mkdir new cur tmp

Now the new directories need the right owners and permissions: root owns /var/spool (and gives full permission to everyone), whereas the vmail directory (and everything within it) is owned by mail, and only mail (and members of the mail group) have permissions.

chmod ugo=rwx /var/spool
chown -R mail:mail /var/spool/vmail
chmod -R ug=rwx,o= /var/spool/vmail

You can double-check this afterwards:

ls -l -R /var/spool/vmail | more

In order to use Dovecot’s SMTP AUTH mechanism, Postfix needs to know where Dovecot’s daemon socket is located. Currently it isn’t located anywhere, so that needs to be fixed:

cp /opt/var/spool/postfix/private/anvil /opt/var/spool/postfix/private/auth
chmod go=rw /opt/var/spool/postfix/private/auth
chown mail:mail /opt/var/spool/postfix/private/auth

Time to edit the postfix config again.

vi /opt/etc/postfix/main.cf

The config file isn’t set up with default values for virtual hosts, so these need to be added. We also tell Postfix that we’re using Dovecot for SMTP AUTH, and point it to the socket location we just created (relative to the queue directory). Note that as soon as we tell Postfix about the socket, it will grumble and complain (and fail to run) because Dovecot hasn’t created the socket yet. We’ll do that shortly.

# LOCAL CONFIG
local_recipient_maps = $virtual_mailbox_maps
# SMTP AUTH
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
# VIRTUAL HOSTS
# Config for virtual domains that are hosted by this server.
virtual_mailbox_domains = /opt/etc/postfix/virtual-hosts
virtual_mailbox_base = /var/spool/vmail
virtual_mailbox_maps = hash:/opt/etc/postfix/virtual-maps
virtual_uid_maps = static:<mail uid>
virtual_gid_maps = static:<mail gid>
virtual_minimum_uid = <mail uid>

Replace <mail uid> and <mail gid> with the uid and gid you noted earlier on.

Now we are left with two files to create. The file /opt/etc/postfix/virtual-hosts should contain a list of all the domains you are hosting, one on each line. The file /opt/etc/postfix/virtual-maps defines the storage location for your mail users.

virtual-hosts:

yourdomain.com

virtual-maps:

you@yourdomain.com yourdomain.com/you/
me@yourdomain.com yourdomain.com/me/

The second column is the storage path, relative to $virtual_mailbox_base. So mail for you@yourdomain.com will be stored in /var/spool/vmail/yourdomain.com/you. The trailing slash in the file is important, and specifies that the Maildir format of mail storage is to be used, as opposed than mbox. Maildir stores each mail as a separate file, which makes more sense to me than mbox, which stores all mail in one file.

We now turn /opt/etc/postfix/virtual-maps into a hash file, and give Postfix read permission:

postmap /opt/etc/postfix/virtual-maps
chmod o+r /opt/etc/postfix/virtual-maps.db

You can now restart the server so your changes take effect, but bear in mind that the smptd process will crash if you try to connect to it – because the Dovecot socket doesn’t exist yet.

/opt/etc/init.d/S69postfix restart

Install Dovecot

ipkg install dovecot

First, a warning: Dovecot caused more trouble than anything I’ve done with the Slug so far. It’s easier to configure than Postfix, but easier to mess up, too!

For starters, you will definitely want to edit the Dovecot config to turn logging on:

vi /opt/etc/dovecot/dovecot.conf

At the start of the file insert the following parameters (we’ll be removing them again later):

log_path = /var/log/dovecot
info_log_path = /var/log/dovecot
auth_debug = yes
auth_verbose = yes

Let’s tell Dovecot where mail can be found. Edit the mail_location parameter as follows. This tells Dovecot that mail for you@yourdomain.com can be found at /var/spool/vmail/yourdomain.com/you. Note that in older versions of Dovecot this setting was default_mail_env.

mail_location = maildir:/var/spool/vmail/%d/%n

Now we want to tell Dovecot about the STMP AUTH socket it needs to create. Find the auth default configuration block (about 80% of the way through the file) and add/edit the following configuration block inside the auth default block.

socket listen {
client {
path = /opt/var/spool/postfix/private/auth
mode = 0660
user = mail
group = mail
}
}

This tells Dovecot what we’ve already told Postfix – now Dovecot knows to create the auth socket, and put it in the right location. We now need to tell Dovecot which users are allowed to use our SMTP server and where it can find their passwords. The relevant sections, passdb and userdb, already exist in the auth default block, and should be edited as follows.

passdb passwd-file {
args = /etc/passwd-mail
}

userdb static {
args = uid=<mail uid> gid=<mail gid>
}

The passdb section tells Dovecot to use a passwd-like file located at /etc/passwd-mail to check users’ passwords. The userdb section is usually used in a similar way to look up valid email users – but since we don’t need another look up, we can use the ‘static’ mechanism, in which case Dovecot will rely on the passdb section for both valid users AND passwords.

Don’t forget to replace <mail uid> and <mail gid> with the uid and gid of your mail user and group. If your uid is less than 500 (which, if you used the built-in mail account, it is) you will need to change the first_valid_uid value in the config file to something less than or equal to the uid you are using.

The last thing involving the configuration file is to tell Dovecot which protocol we want clients to be able to use. By default, Dovecot supports only IMAP – but I prefer POP3.

#protocols = imap imaps
protocols = pop3

IMAP has some significant advantages over POP3, providing an Exchange-like environment for email, but it also has its disadvantages. If you’re happy to store all your email locally, you’re only going to connect from a single client, and prefer ISP-like email, the more common POP3 should be just fine.

Now we need to create the passwd-like lookup file.

vi /etc/passwd-mail

It’s content will be of the format <username>:{encryption_scheme}password, for example:

you@yourdomain.com:{plain}yourpassword

The {plain} directive denotes that the password is in plain text; this overrides whatever encryption Dovecot might be expecting – DES in this case (the same as you’d find in /etc/passwd). If you DES-encrypt your password before putting it in /etc/passwd-mail you do not need an {encryption_scheme} directive.

By default, the dovecot-auth process runs as user admin, which is a member of the group administrators. You can change this by editing dovecot.conf, but it is not necessary. The admin user needs read privileges on the mail password file, so give this permission to the group to which user admin belongs:

chown root:administrators /etc/passwd-mail
chmod g=r /etc/passwd-mail

Now you’re ready to start Dovecot. You may like to open a separate session on your Slug and run tail -f /var/log/dovecot to monitor what’s going on:

/opt/etc/init.d/S90dovecot start

If this produces errors, double-check the edits you made to /opt/etc/dovecot/dovecot.conf – a common problem is the mismatching of curly braces { and }.

Testing Dovecot

Now use telnet to connect to Dovecot on your slug:

telnet <slug’s host name or IP address> pop3

You can have the following conversation with it:

+OK Dovecot ready.
user you@yourdomain.com
+OK
pass wrongpassword
-ERR Authentication failed.
user you@yourdomain.com
+OK
pass yourpassword
+OK Logged in.

Great. You now have a working email server which offers SMTP without being an open relay, and provides POP3 to the user(s) you specified.

If Dovecot crashes when you authenticate, and logs “Panic: POP3(you@yourdomain.com): Trying to allocate 0 bytes“, you have found a kown bug with the Dovecot 1.2 beta 1 release (the latest release that is available through ipkg). Although this doesn’t prevent you from using Dovecot, most email clients will complain that the connection to the POP3 server was prematurely terminated. A patch is available at http://hg.dovecot.org/dovecot-1.2/rev/22d70947597c, but I have not had a chance to try it.

Finally

Don’t forget to turn off verbose logging for Postfix and Dovecot. For Postfix, remove the ‘-v’ smtpd parameter from /opt/etc/postfix/master.cf, and for Dovecot remove the first four lines of /opt/etc/dovecot/dovecot.conf (log_path, info_path, auth_debug and auth_verbose).

Limitations

The one big limitation with this set up is that the administration of mail users involves a lot of work. Every time you add a user you must create the relevant entry in virtual-maps, create the user’s mail delivery directory structure, and set permissions. The mitigation against this drawback is that you (probably) won’t be using your Slug as a mail server for more than a handful of email addresses – any heavier use would probably require a more significant investment, and hence more powerful tools.

Notes

Group ‘maildrop’ disappears
It seems that, at some point, the maildrop group ‘disappears’ from /etc/group. It may be something to do with the fact that /etc/group is a symbolic link to /share/flash/conf/group, and thus may be more closely-managed by the Slug than it appears. Regardless, it causes SMTP clients to be unable to connect (because Postfix fails to start), and Postfix emits an appropriate message to /var/log/message.

This can be resolved by manually recreating the appropriate entry in /etc/group for maildrop:

maildrop:x:69:

Fortunately, it seems that this is only required once.

Using your ISP’s SMTP server
Some ISPs may require that any email you send is relayed through their SMTP server; in this case you will likely need to add the relayhost parameter to your main.cf as well (although this wasn’t necessary in my case). Documentation for this parameter can be found on the Postfix website at http://www.postfix.org/postconf.5.html#relayhost. Explicit authentication with your ISP’s SMTP server is usually not required as long as you are connected to the Internet via that ISP’s connection (either dial-up or always-on).

Encryption of stored passwords
When installing and configuring Dovecot, I store email users’ passwords in plain text. If you want to store passwords in an encrypted format, see http://wiki.dovecot.org/Authentication/PasswordSchemes for an explanation.

Next Steps

Firewall
If you have a firewall or NAT between your Slug and the outside world (which is highly recommended) and you want to access your email from anywhere, you will need to configure your firewall or NAT to forward ports 25 (smtp) and 110 (pop3) to your Slug.

Of course, if you open up your email server to the rest of the world, you may want to make sure it can’t be abused. Go to http://www.abuse.net/relay.html, provide your external IP address, and let it test your email server for being an open relay.

Date/Time
It’s a good idea to keep your Slug’s time accurate so that the mail server can timestamp email correctly. This can be done by running an NTP client, which will synchronise the Slug’s time with reliable time servers around the world, or by running an NTP server, which will synchronise the Slug’s time AND allow you to synchronise your network computers’ time with the Slug.

Due to a glitch in the Slug, this isn’t as straight-forward as it could be – but it’s not beyond anyone with enough patience to work with vi.

Detailed instructions are here.

SSL/TLS
These instructions give you a working email server, but all authentication is performed using plain text. That means that anyone using a network sniffer in the right place at the right time could steal your usernames and passwords as you transmit them to the server.

Rather than configure authentication mechanisms that prevent this (and which, to be honest, look difficult to configure), we can encrypt the whole of the communication between client and server using SSL and TLS.

Detailed instructions are here.

Useful Links

http://www.postfix.org/
http://www.dovecot.org/
http://www.nslu2-linux.org/
http://www.howtoforge.com/linux_postfix_virtual_hosting
http://www.howtoforge.com/linux_postfix_virtual_hosting_2

If this information was useful, please leave a comment to let me know!

Bad Behavior has blocked 19 access attempts in the last 7 days.

Bear