Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm having a bit of trouble setting up postfix as a null client and have some questions.

I'll be aiming to use SMTP as this is what most web applications use as a way to connect to the email server.

The goal is to use it for email notifications from web applications and monitoring software on the machine.

  1. Are things like SASL and TLS needed? It sounds like encrypting the connection between my web application and the email server is uesless when they're on the same box.
  2. Which user should I connect to the SMTP server as? I originally used the user account I use for daily activities, but this screams bad as my login information is in the wild if my web application is ever cracked. I also tried creating a user with /usr/sbin/nologin as it's shell, but this didn't work either (I'd prefer it the user didn't have shell access).

Any other things to think about while doing this?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

I believe what you are asking is for a way to have the mail server accept e-mail that you generate from your web application on the same machine and deliver it to the final destination? I'm not entirely sure because "null client" and your description don't make sense together to me.

Anyway, the way this would typically be done is that in postfix you set "mynetworks" to include "", and you have your web applications connect to "" to send e-mail. Mail coming from a host listed in "mynetworks" is not limited in it's ability to send e-mail to only user-names the postfix server directly handles, so you can have your web applications mail your normal e-mail account, or other external users.

mynetworks usually contains, so this is likely to be the default configuration.

So, use "postconf mynetworks" to see the current value. Change /etc/postconf/main.cf or use "postconf" to change the value and then restart postfix. Check the logs if your mail still isn't working then.

share|improve this answer

Postfix is a Mail Transfer Agent, not a Mail User Agent (client). Will it send mail out to other SMTP servers or will it spool mail to be accessed via IMAP or POP? My guess is, you want it to relay the alert email to your company's mail server.

By the way, Postfix may be overkill. You can use /usr/bin/mail or mailx to get things like Logwatch reports mailed to you.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.