/etc/mailname no longer used for outgoing message domain

Bug #1388043 reported by Chris Cowan
6
This bug affects 1 person
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

Revision history for this message
Chris Cowan (macil) wrote :

I guess it's "mail" that sets the From value, not postfix, so this isn't a postfix issue then.

Revision history for this message
Kenyon Ralph (kralph) wrote :

marking invalid for postfix per comment #1

Changed in postfix (Ubuntu):
status: New → Invalid
Revision history for this message
Kjeld Flarup (kfc-j) wrote :

Through not beeing a postfix problem, postfix may be able to rewrite the From value.
eg. localhost.company.com can be rewritten to company.com by this rule
masquerade_domains = company.com
Or more generic since $myorigin is by default read from /etc/mailname
masquerade_domains = $myorigin

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.