The mailname of a host is the name that mail-related programs
use to identify the host. The file
/etc/mailname contains of this
name followed by a newline. The mailname is usually a fully qualified domain
name that resolves to one of the host's IP addresses. See
What the recipient of e-mail sees in the From: header of mail sent
by your Debian host depends on how Mail User Agents (MUA) and Mail Transfer
Agents (MTA) are configured. Suppose a local user foo
sends a mail from a host with mailname myhost.dom. The
From: header of outgoing e-mail will be:
"From: email@example.com" if the MUA
has no From: header set;
"From: firstname.lastname@example.org" if the MUA
has "From: bar" set;
"From: email@example.com" if the MUA
has "From: firstname.lastname@example.org" set.
Even when the MUA has a From: header set the MTA may add a
"Sender:email@example.com" header to
indicate its true origin.
Of course when any involved MTA performs address rewriting as discussed in Setting up a catchall for nonexistent
email addresses under Exim, Section 18.104.22.168 and Configuring selective address rewriting
for outgoing mail under Exim, Section 22.214.171.124, the e-mail address seen by
the recipient can be changed to something else.