When configuring Postfix, the "mail name" setting determines the default domain portion for outgoing emails. Many administrators face confusion between using:
- The organizational domain (e.g., pacificseatheat.org)
- The fully qualified domain name (e.g., mercury.pacificseatheat.org)
Postfix uses the system mail name for:
1. Default sender addresses
2. Bounce message formatting
3. Local delivery resolution
For most production deployments, you should use your organizational domain (pacificseatheat.org in your case) because:
- It provides consistent branding across all servers
- Makes email routing more flexible
- Follows common mail server conventions
To set this during interactive installation:
sudo dpkg-reconfigure postfix
# Select "Internet Site"
# Enter "pacificseatheat.org" as system mail name
For manual configuration in main.cf:
myorigin = /etc/mailname
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
Consider using mercury.pacificseatheat.org only if:
- This is a dedicated mail server with no other services
- You need strict host-based mail routing
- You're running multiple independent mail services on subdomains
After configuration, test with:
postconf mail_name
sendmail -bv root
Check /etc/mailname contains just the domain without hostname:
cat /etc/mailname
# Should show: pacificseatheat.org
When configuring Postfix's mailname
parameter, administrators often face confusion between using their bare domain versus the Fully Qualified Domain Name (FQDN). The correct choice impacts email delivery and server identification.
The system mail name (set in /etc/mailname
or during Postfix installation) serves two primary purposes:
- Default domain for locally generated mail (e.g., cron jobs)
- EHLO/HELO identification in SMTP transactions
For your specific case where:
Hostname: mercury FQDN: mercury.pacificseatheat.org
You have two valid approaches:
Option 1: Using FQDN (Recommended)
# /etc/mailname contents: mercury.pacificseatheat.org
Benefits:
- Precise server identification in SMTP transactions
- Reduces risk of being flagged as spam (many spam filters check HELO consistency)
- Matches reverse DNS records
Option 2: Using Domain Only
# /etc/mailname contents: pacificseatheat.org
Considerations:
- May cause delivery issues if your PTR record points to FQDN
- Can complicate troubleshooting when multiple servers share a domain
- Often requires additional SPF/DKIM configuration
After configuration, verify with:
postconf mailname
Test SMTP greeting with:
telnet localhost 25 EHLO example.com
For a server handling multiple domains, consider this main.cf
extract:
myhostname = mercury.pacificseatheat.org mydomain = pacificseatheat.org myorigin = $mydomain