Postfix is an alternative to Sendmail program. It starts at IBM research.
It will describe how to config postfix for SM to send mail to HP smtp server.
Test Env:
$ uname -a Linux smcfrd64 2.6.18-128.el5 #1 SMP Wed Dec 17 11:42:39 EST 2008 i686 i686 i386 GNU/Linux
SM version: SM 9.21.032
Linux computer IP: 16.186.77.7
Postfix 2.3.3.
If you are not root, please use sudo to run the commands below. 1. Install Postfix
1) Download postfix 2.3.3 from ftp://ftp.porcupine.org/mirrors/postfix-release/official/postfix-2.3.3.tar.gz.
2) Untar it to a directory, such as /home/admin/postfix 2.3.3, enter this directory
3) Config the build
If you need to support TLS/SSl, run the command below:
Rename sendmail, newaliases and mailq program to other names. These binary may be in /usr/sbin, /usr/bin or other places.
5) Create user and group for postfix
Create a user account "postfix" with a user id and group id that are not used by any other user account. Preferably, this is an account that no-one can log into. The account does not need an executable login shell, and needs no existing home directory.My password and group file entries look like this:
Create a group "postdrop" with a group id that is not used by any other user account. Not even by the postfix user account. My group file entry looks like:
/etc/group: postdrop:*:54321:
6) Compile postfix
$make
7) Install postfix
$make install (interactive version, first time install) or $make update (non-interactive version, for upgrades)
Note: The interactive version ("make install") asks for pathnames for Postfix data and program files, and stores your preferences in the main.cf file. If you don't want Postfix to overwrite non-Postfix "sendmail", "mailq"and "newaliases" files, specify pathnames that end in ".postfix". For the install root, just use the recommended value (/).
When install is finished, the postfix configuration will be stored at /etc/postfix/, main programs, such assendmail, postmap, postconf, will be located at /usr/sbin. 2. Configure postfix
The items in bold font are added or modified compared to the original main.cf. The value of mynetworks is depended on the IP address and the network mask. It is necessary in my local env. To use external smtp server, therelayhost and other items prefix with smtp are necessary. After configure, you can run "postconf -n" to view all your postfix configuration.
2) /etc/postfix/aliases
In main.cf, we config the alias_maps to hash:/etc/postfix/aliases, edit file hash:/etc/postfix/aliases.
If you want to send a mail to jay@XX.com, you need to add an item for "jay" in this file:
jay: jay@XX.com.
Also, need to add an user jay to the Linux OS. Otherwise, when sending mail, the log will report unknown user error.
After configuration, generate the lookup table by the command followed:
$postmap hash:/etc/postfix/aliases
This command will generate a aliases.db file.
3) /etc/postfix/sasl_passwd
In main.cf, we config the smtp_sasl_password_maps to hash:/etc/postfix/sasl_passwd. This is necessary for postfix to send mail to external smtp server. Create file /etc/postfix/sasl_passwd and add the line to it:
smtp.XX.com:25 jay@XX.com:password
After configuration, generate the lookup table by the command followed:
$postmap hash:/etc/postfix/sasl_passwd
This command will generate a sasl_passwd.db file. Till now, you can remove the file sasl_passwd.
3. Start postfix
Run the command to start or restart postfix:
$/usr/sbin/postfix start (or reload)
4. Test it
$echo "test van Brunöö, this is één mail"|mail -s "test éne mail" XXXXX@XX.com
You can view the log /var/log/maillog to check whether the mail is sent successfully.