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/

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):



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!


About the Writer
Chris Lessley
Author: Chris Lessley
A server admin, dev ops warrior and website designer since 2002, Chris is a lover of all things Linux and open-source! Each blog topic has been tested by fire in the real world and shared with the hope to help others. Need more help? Hire me! Chris' other interests include fine art and the humanities in the classical tradition and can be found writing for our friends over at If you like this content, kindly consider donating to keep this website free to all, without ads.

Comments powered by CComment

Member of The Internet Defense LeagueOpen Source Initiative