Postfix

From The System Administrator Zone

How do you force it to reread the configuration files

postfix reload

Is there a quick way to send a test message?

date | mail -s test mailuser@example.com


Basic Commands

List mail queue

postqueue -p 

Flush mail queue

postqueue -f 

View contents of message with ID YYYYYYYYY in mail queue

postcat -q YYYYYYYYY

Delete message with ID YYYYYYYYY from queue

postsuper -d YYYYYYYYY

Mail Goes to /dev/null

E-mail to root ends up going to /dev/null.

Nov 29 10:35:13 Example postfix/pickup[3026]: 0D92F41ADE1: uid=0 from=<root>
Nov 29 10:35:13 Example postfix/cleanup[3231]: 0D92F41ADE1: message-id=<20081129183513.0D92F41ADE1@Example.local>
Nov 29 10:35:13 Example postfix/qmgr[3027]: 0D92F41ADE1: from=<root@Example.local>, size=302, nrcpt=1 (queue
active)
Nov 29 10:35:13 Example postfix/local[3233]: 0D92F41ADE1: to=<root@Example.local>, orig_to=<root>, relay=local,
delay=0.04, delays=0.01/0/0/0.03, dsn=2.0.0, status=sent (delivered to file: /dev/null)
Nov 29 10:35:13 Example postfix/cleanup[3231]: 169AB41ADE3: message-id=<20081129183513.169AB41ADE3@Example.local>
Nov 29 10:35:13 Example postfix/bounce[3234]: 0D92F41ADE1: sender delivery status notification: 169AB41ADE3
Nov 29 10:35:13 Example postfix/qmgr[3027]: 0D92F41ADE1: removed
Nov 29 10:35:13 Example postfix/qmgr[3027]: 169AB41ADE3: from=<>, size=1809, nrcpt=1 (queue active)
Nov 29 10:35:13 Example postfix/local[3233]: 169AB41ADE3: to=<root@Example.local>, relay=local, delay=0,
delays=0/0/0/0, dsn=2.0.0, status=sent (delivered to file: /dev/null)
Nov 29 10:35:13 Example postfix/qmgr[3027]: 169AB41ADE3: removed

The problem is the default entry in the aliases file:

/etc/aliases - Apple's default location
/opt/local/etc/aliases - If you are using the MacPorts version
#root:          you

Replace you with the e-mail address you wish the mail to go to and you are back in business.

Mail Setup

  • Edit /etc/hostconfig and add the following:
MAILSERVER=-YES-
  • Edit /etc/postfix/main.cf and setup your host and domain names
myhostname = enterprise.example.com
mydomain = example.com