Changing default domain in mailutils

I have installed mailutils on Ubuntu 12.10 and I have run into a problem where the domain being attached is the fully qualified host and not just the domain. For example,

mail user2 [enter] then enter message and send produces a from address of [email protected]

I want the from address to be just [email protected]. I did not have this problem in 12.04, it only started when I upgraded to 12.10. Is there a system config file somewhere that would allow me to only set the domain.com as being added to the username when sending mail and not the full host name?

Thanks, Tim


To use a local domain other than the hostname in Mailutils:

Create a file /etc/mailutils.conf with the following contents:

address {
  email-domain somedomain.com;
};

You can see what else can be configured in mailutils.conf with:

$ mail --config-help

Frustratingly there is no easy generic mailutils configuration file way to do what you are asking (have the mail program from mailutils use a different default domain through said configuration file).

FWIW I've found that mailutils mail crafts addresses that look like user@host when sending a mail to just 'user' before the mail is given to the MTA. Thus how the FQDN is actually created was down to the MTA configuration (e.g. you can configure some MTAs to always append the contents of /etc/mailname thus creating other problems). That might explain why other answers on this question linked to the other answers explaining how to make to force headers when using mail (e.g. https://stackoverflow.com/a/380573/4513656 ).