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 am trying to set up a perimeter spam and malware filter using CentOS/Postfix/SpamAssassin. Unfortunately, I am still stuck on the PostFix part. I've setup a new subdomain DNS with its own A/MX record (the MX points to the A), and that's working fine. I've also setup a basic PostFix conf using Webmin and editing the main.cf file according to http://www.postfix.org/STANDARD_CONFIGURATION_README.html, with an entry for relay_domains = mailtest.mydomain.com. I send an email to user@mailtest.mydomain.com expecting it to recognize mailtest.mydomain.com as a relay domain, and at least get to the point of trying to figure out how to relay it (maybe there would be a failure in terms of looking up whether it is allowed to be relayed, where it's relayed to, the receiving host barfs, etc.) However, it never gets that far, and in my maillog I see:

Apr  5 16:06:59 localhost postfix/smtpd[13518]: NOQUEUE: reject: RCPT from mailout-       
us.gmx.com[74.208.5.67]: 550 5.1.1 <jshin@mailtest.#####.com>: Recipient address
rejected: User unknown in local recipient table; from=<randymoses@gmx.com> to
<jshin@mailtest.#####.com> proto=SMTP helo=<mailout-us.gmx.com>

...so I can conclude it's still trying to deliver locally.

Now, I have not disabled local delivery, mainly because I do not know how to do so. I would think however that it would at least try to relay it and match it against a domain.

One line in the main conf file that troubling to me was the following

# NOTE: Postfix will not automatically forward mail for domains that
# list this system as their primary or backup MX host. See the
# permit_mx_backup restriction description in postconf(5).

Where am I going wrong?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

That's not "not getting that far", it's getting past there by recognizing it as a local hostname, which obviously doesn't need to be relayed. You do not want the mailer to consider the relay domain local; you want it to have its own local hostname, with the MX pointing to it (i.e. not MX and A being the same; that's actually quite meaningless as it implies relaying to itself).

share|improve this answer
    
Forgive me if this is thick, but what do you suggest I do to resolve the problem? The local hostname of my CentOS vm != dns name... I just it to sit "in front of" my Exchange server and forward all mail for relay_domains to it at this point. –  tacos_tacos_tacos Apr 5 '12 at 20:38
    
Nevermind... you were right! My host name was NOT the same as the DNS name, BUT I had specified the relay domain as an accepted domain for local delivery, effectively the same effect... –  tacos_tacos_tacos Apr 5 '12 at 20:42
add comment

Your Answer

 
discard

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.