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:
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
canonical_maps = regexp:/etc/postfix/canonical canonical_classes = envelope_sender
5. Reload Postfix:
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):