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 have a server set up running postfix and dovecot, accepting email locally for four domains (using virtual_mailbox_domains and virtual_mailbox_maps) and forwarding email to other locations for another six domains (using virtual_alias_domains and virtual_alias_maps).

I also have twenty or so email addresses being rejected (using check_recipient_access).

Two of the domains use catchall email addresses, the rest just accept for the required postmaster, webmaster, and abuse.

Somewhere in my configuration I have an error, because some of the mail for a local address is being delivered to the wrong local email account, and some of the mail that should be rejected is being delivered.

What I can't find is a utility that, given an email address, prints out where the email should be delivered, either locally or forwarded, based on my configuration files.

Does one exist?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

postmap -q is the right tool to use to test maps, but has limitations:

  • It only searches for the key you give it, rather than trying keys in the order of precedence specified in access(5) or virtual(5).
  • It assumes you know which table to search.

To test end-to-end rewriting, use sendmail -bv, which generates and emails a report containing the address rewriting and routing details. This, of course, is part of the sendmail command-line interface, and so doesn't simulate rewriting that is explicitly performed by smtpd, such as FILTER or REDIRECT actions in access maps.

share|improve this answer
    
This did it. Sending email from my account sent me an email which had the original email address and the expanded email address and where it was delivered locally or forwarded. I was able to track down in my configuration values where they were overlapping and causing problems. –  kitt Aug 24 '09 at 22:54
add comment

postmap is your friend!

Example usage:

postmap -q info@example.com hash:/etc/postfix/virtual
postmap -q info@example.com ldap:/etc/postfix/virtual.cf
share|improve this answer
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.