Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to use a Postfix box to do two things:

  • Relay mail from any host on the internet addressed to one of my domains to my Zimbra server
  • Relay mail from my Zimbra server to any address on the internet.

To try and accomplish this I have configured Postfix thusly:

mynetworks =, zimbra_ip/32
myorigin = zimbra_server
mydestination = localhost, zimbra_server
relay_domains =
transport_maps = hash:/etc/postfix/transport_map
local_transport = error:no mailboxes on this host

transport_map looks like this: smtp:[zimbra_server] smtp:[zimbra_server]

Now, this works and passes the Open Relay tests. However, I am seeing in the maillog that the server is relaying spam that has a From: address of <> to domains that are not mine. How do I stop this behavior?

share|improve this question
up vote 1 down vote accepted

You need to put in smtpd_recipient_restrictions for some in-bound header checking. There are tones of example on the web, following is an example for relay only host

smtpd_helo_restrictions =

smtpd_recipient_restrictions =

reject_unauth_destination should reject email to domains that are not yours.

reject_non_fqdn_sender should reject (some) email with improper From field.

You may want to remove *reject_invalid_hostname* from both of them if you get too many false positive.

reject_rbl_client is another one you should research into. I give you one in the example. You can add more.

That should give you a starting point. Those option names should be self-explanatory. Detail information can be found on postfix site.

You may even add spam filtering and virus scanner like amavis. Again there are lots of example if you do some search.

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.