3

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?

2 Answers 2

2

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.

1
  • 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, 2009 at 22:54
3

postmap is your friend!

Example usage:

postmap -q [email protected] hash:/etc/postfix/virtual
postmap -q [email protected] ldap:/etc/postfix/virtual.cf
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .