/etc/mailname no longer used for outgoing message domain
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mailutils |
New
|
Undecided
|
Unassigned | ||
postfix (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I've recently been setting up a new server using Ubuntu 14.04 to replace a 12.04 server, and found if not a bug, then at least a breaking change that doesn't seem to match up intuitively with the documentation.
Both servers have postfix installed. (12.04 has 2.9.6, and 14.04 has 2.11.1, as reported by postconf mail_version.) Each have a hostname unrelated to their FQDN. On the 12.04 server, sending mail with the `mail` utility sends the messages as $user@$fqdn correctly. On the 14.04 server, sending mail with the `mail` utility sends the messages as $user@$hostname instead. There don't appear to be any differences in how they're configured. Even if I copy the whole /etc/postfix folder from the 12.04 server to the 14.04 server and restart postfix, the issue persists.
To make sure I'm not crazy, I tested against new 12.04 and 14.04 VMs (using vagrant, which made it quick to test). Here are my notes. Please tell me if there's something I'm doing wrong or overlooking.
#For 12.04
vagrant init hashicorp/precise64
#For 14.04 instead
vagrant init ubuntu/trusty64
# Connect to the new VM
vagrant up
vagrant ssh
# Now inside the VM
sudo apt-get update
sudo apt-get install postfix mailutils
# Pick <Internet Site> option when presented
# Enter the fqdn of "blahblah.org"
# Note that the following has the machine's original hostname:
hostname
# and this has "blahblah.org":
cat /etc/mailname
# Run
echo a | mail <email address hidden>
# Now check the logs to see who the email was sent as.
# On 12.04, this will give results as expected:
sudo fgrep "$<email address hidden>" /var/log/syslog
# On 14.04, this one will give results instead:
sudo fgrep "$USER@$(hostname)" /var/log/syslog
I guess it's "mail" that sets the From value, not postfix, so this isn't a postfix issue then.