An improper envelope from address can really ruin your day if you are building SaaS services that need to send email to customers or community users.
Some receipient email (most all really) will reject or silently drop your improperly labeled email envelop; they believe such to indicate a spoofing attack. That means no email "arrives" at someone's inbox but your server will say it was sent ok nonetheless (because it will).
The pattern in the from section will look like this: www-data@. It might say www-data@ or whatever your specific envelop was set as on creation.
The fix is pretty simple but it may involve creating a new file if you are using Ubuntu along with Postfix and/or PHP Mail.
1. Check for the existance of a "canonical" file in: /etc/postfix
2. Create this file it does not exist.
3. Inside the canonical file enter:# Use the empty regexp to map *any* address to the desired envelope sender.
//
4. Append the following to /etc/postfix/main.cf:
canonical_maps = regexp:/etc/postfix/canonical canonical_classes = envelope_sender
5. Reload Postfix: postfix reload
6. Send a new email and confirm the correct from label.
Here is an image of where the two files should exist on Ubuntu (19.04):
References: https://stackoverflow.com/questions/50144690/www-data-appending-issue-postfix
References: https://serverfault.com/questions/533912/how-do-i-change-the-envelope-from-in-postfix
If your in-house web-guy is more UX and not-so-much Server Administrator, we are here to save you! Give us a call at (559) 242-6647, send us an email or send a SMS now to get started!
