Setting Up The Postfix Mail System: Peter Ross
Setting Up The Postfix Mail System: Peter Ross
Setting Up The Postfix Mail System: Peter Ross
html
These notes describe how to set up the Postfix mail system on your Linux box
so that you can send out emails via a Napier University Microsoft Exchange
server. The notes assume that you are using Linux Mandrake 10.0, although
they very probably apply to any other Linux system that has Postfix too.
See here if you want some ideas of why you should even bother.
What is Postfix? It is a mail delivery agent, not a program for actually letting
you read and reply to your emails. The old-timer of such mail delivery agents is
sendmail, which is notoriously hard to configure correctly for any but the
simplest of set-ups. Postfix is a more modern replacement that is very much
easier to configure.
How do you know if you've got it installed? One simple way is to list all the
installed packages with the command rpm -qa and extract from that list any
occurrence of the string "postfix", in a case-independent way:
How do you know if it's active? Check whether it gets started at boot time, by
using one of the standard tools such as the Mandrake Control Centre (alias
/usr/X11R6/bin/DrakConf) to examine/change which services are running and
whether they are to be started at boot time.
How do you configure it? You need to edit the file /etc/postfix/main.cf (as
root) as follows:
1 de 4 24-10-2010 12:04
Setting up the Postfix mail system http://www.soc.napier.ac.uk/~peter/linux/postfix.html
The second of these tells Postfix not to try anonymous login with the
Exchange server. The fourth line tells it where to look up the appropriate
login/password info. You need to create the file /etc/postfix/sasl_passwd
to contain, eg, the single line:
ex-server1.napier.ac.uk cs999:steamer6
and it will create the file sasl_passwd.db. Note that SASL is actually
something distinct from Postfix -- SASL stands for Simple Authentication
and Security Layer and is a separate software library designed to manage
various possible authentication dialogues for connection-based
communication protocols such as TCP/IP. The SASL software may or may
not be already installed on our system, see below.
finally, somewhere, add these two lines:
sender_canonical_maps = hash:/etc/postfix/sender_canonical
recipient_canonical_maps = hash:/etc/postfix/recipient_canonical
These files will contain details for rewriting certain outbound and inbound
email addresses, see below.
This should be all you need to do to /etc/postfix/main.cf (but do read the rest
and see if there is anything else you wan to tweak). But there is more still to
do!
You will need at least these (the version numbers may vary):
2 de 4 24-10-2010 12:04
Setting up the Postfix mail system http://www.soc.napier.ac.uk/~peter/linux/postfix.html
libsasl2-2.1.15-10mdk
libsasl2-plug-login-2.1.15-10mdk
but if you want to cope with all the standard sorts of dialogue, for example
because you also want to send mail via your favourite external ISP, then you
would also need:
libsasl2-plug-anonymous-2.1.15-10mdk
libsasl2-plug-plain-2.1.15-10mdk
libsasl2-plug-crammd5-2.1.15-10mdk
libsasl2-plug-srp-2.1.15-10mdk
libsasl2-plug-digestmd5-2.1.15-10mdk
libsasl2-plug-otp-2.1.15-10mdk
libsasl2-plug-gssapi-2.1.15-10mdk
libsasl2-plug-sasldb-2.1.15-10mdk
libsasl2-plug-ntlm-2.1.15-10mdk
peter@pc162119.napier.ac.uk P.Ross@napier.ac.uk
peter@localhost.napier.ac.uk P.Ross@napier.ac.uk
This lot is essentially a belt-and-braces measure. If, at some stage in the future,
you adjust the mail setup to also accept messages from external hosts, then
inbound messages addressed to any of these will be delivered to peter locally.
And, of course, you need to get these text files turned into database format by
these commands in the directory /etc/postfix:
# postmap sender_canonical
# postmap recipient_canonical
Finally, you need to get Postfix to notice all these changes you have made. Get
it to re-read its configuration information by the command:
# postfix reload
3 de 4 24-10-2010 12:04
Setting up the Postfix mail system http://www.soc.napier.ac.uk/~peter/linux/postfix.html
and you should now be able to send email to anyone anywhere, and their
replies will come back to the Exchange server and await your pleasure there.
Of course, you may not want to use Outlook on a Windows box to read your
email on the Exchange server, you may prefer to collect it and have it delivered
to you on your Linux box. The simplest way to do this is to use the fetchmail
program. You will need a $HOME/.fetchmailrc file that contains something like
this:
This does not have to be all on one line. You can get fetchmail to run every few
minutes -- see the man page, or use one of the standard command-scheduling
tools such as at and cron.
4 de 4 24-10-2010 12:04