Postfix修改发件地址后maillog出现smtp_generic_maps未找到异常原因咨询
Let me walk through this scenario—this is a super common edge case when setting up Postfix's generic address rewriting. Here's exactly what's going on:
1. The "not found" error targets the log address, not root
When you configure Postfix to rewrite root@example.com to log@example.com, Postfix doesn’t stop at just that first rewrite. Its address pipeline automatically runs the newly rewritten address (log@example.com) through the same smtp_generic_maps again to check if further rewriting is needed.
Since your /etc/postfix/generic file only has an entry like:
root@example.com log@example.com
There’s no line telling Postfix what to do with log@example.com (either leave it as-is or rewrite it further). So when Postfix checks the generic map for log@example.com, it can’t find a match—hence the maps_find: smtp_generic_maps: log: not found error.
2. The "found" entry is for your original root mapping
The successful lookup you see a few lines later? That’s Postfix finding the root@example.com entry in your generic file—the one that actually rewrites the sender address to log@example.com. The earlier error is just a harmless side effect of Postfix double-checking the rewritten address.
3. Why mail still works perfectly
Postfix treats missing generic map entries as a non-fatal condition. If it can’t find a mapping for an address, it simply falls back to using the original address (in this case, log@example.com—exactly what you want). The error is purely informational and doesn’t block mail delivery at all.
How to clean up the logs (if you want to)
If you’d like to eliminate that "not found" message entirely, just add a line to your /etc/postfix/generic file that tells Postfix to leave the log@example.com address unchanged:
log@example.com log@example.com
Then run the mandatory postmap command to update the database:
postmap /etc/postfix/generic
And reload Postfix to apply the changes:
postfix reload
Now when Postfix checks the generic map for log@example.com, it’ll find a match and won’t log the error anymore.
内容的提问来源于stack exchange,提问作者Eric

