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

I'm trying to configure a basic postfix server to allow receipt of email from anywhere to local addresses but not be an open relay.

Current config, seemingly relevant rules:

mydestination = $myhostname, localhost.$mydomain, localhost
mynetworks =
relay_domains = $mydestination

If I change mynetworks back to it doesn't receive external mail. Leaving relay_domains blank seems to make no difference and keeps this as an open relay.

What am I missing?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

First, relay_domains is not necessary unless you're making this system a backup MX (you aren't) and therefore should be removed.

Second, mynetworks = makes you an open relay. It also should be removed and replaced with something more sensible, such as mynetworks =

Finally, mydestination should specify the domains for which you want to receive email. You don't seem to have listed any domains here. Add in your domain names.

Once you fix all three of these issues, you should have a functional mail server which isn't open relaying.

share|improve this answer
Great, that worked for me - I'd have sworn I tried that combination! Thank you –  moztech Jan 20 '13 at 23:43
In addition to the above, please use something like spamhelp.org/shopenrelay to externally verify that your relay is not accidentally an open relay. Five minutes of checking now can save you days and days of pain down the line. –  Scrivener Jan 21 '13 at 0:00
@Scrivener agreed - I was actually using an open relay test (telnet and dnsstuff.com), spamhelp.org was showing me some connect errors I couldn't replicate –  moztech Jan 24 '13 at 12:27

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.