I'm trying to set up postfix as a null client, that is, I just want local linux users to be able to send mails outside using postfix's sendmail binary.

No reception of emails, no relaying for other hosts, no local mail delivery to users (I don't see any use for it). I just want to allow sending emails outside.

I have set these parameters in /etc/postfix/main.cf:

myhostname = mail.thisisadomain.com
inet_interfaces = loopack-only
mydestination = 

Should I set other parameters or change anything else in the configuration ?

I'm particularly interested in knowing what to do with the relayhost parameter, since I don't understand what it does.

I've read the doc here http://www.postfix.org/STANDARD_CONFIGURATION_README.html#null_client but I still don't understand what the relayhost parameter does, and if it matters for a null client.

Thanks for your help.


As far as I understood, the author of http://www.postfix.org/STANDARD_CONFIGURATION_README.html#null_client assumed that null client is not an always-online-server e.g. sometimes it can safely be turn off or isolated from internet. This snippet from that page

1 /etc/postfix/main.cf:
2     myhostname = hostname.example.com
3     myorigin = $mydomain
4     relayhost = $mydomain
5     inet_interfaces = loopback-only
6     mydestination =
Line 4: Forward all mail to the mail server that is responsible for the "example.com" domain.
This prevents mail from getting stuck on the null client if it is turned off while some remote destination is unreachable. 

Without relayhost parameter, whenever the null client turned off, the email on your deferred queue will not retried until the server goes back online or turn on. So it possible when your machine turn on, the email queue already expired.

The reason why you should provide relayhost parameter is no matter the state of your box (online or offline), the relayhost server (the one who always stays online) will retry the stuck emails from your null client.

  • 1
    Think of null client as being sort of like what your desktop does (at least if you're not using webmail). It forwards outgoing email to a relayhost which is commonly provided by your ISP. The relayhost parameter is where to send that email. – mc0e Jan 22 '15 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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