I have followed the article ([http]https://www.digitalocean.com/community/articles/how-to-set-up-a-postfix-e-mail-server-with-dovecot[/http]) to set up e-mail server. The problem I face is, emails are being sent as foo@mail.example.com instead of foo@example.com. What am I doing wrong
Here is my main.cf:
**********************************
myorigin = /etc/mailname
myhostname = mail.example.com
mydestination = localhost, mail.example.com, localhost.example.com
smtpd_banner = $myhostname ESMTP
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
smtpd_tls_cert_file=/etc/ssl/private/cert.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-key.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_tls_security_level=may
smtpd_tls_protocols = !SSLv2, !SSLv3
smtpd_helo_required = yes
local_recipient_maps = proxy:unix
asswd.byname $alias_maps
smtpd_helo_restrictions = permit_mynetworks,
reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname,
reject_unknown_helo_hostname, permit
smtpd_recipient_restrictions = reject_unknown_client_hostname,
reject_unknown_sender_domain, reject_unknown_recipient_domain,
reject_unauth_pipelining, permit_mynetworks,
permit_sasl_authenticated, reject_unauth_destination,
reject_invalid_hostname, reject_non_fqdn_sender
smtpd_sender_restrictions = reject_unknown_sender_domain,
reject_sender_login_mismatch
**************************************************
/etc/mailname is:
example.com
Here is my main.cf:
**********************************
myorigin = /etc/mailname
myhostname = mail.example.com
mydestination = localhost, mail.example.com, localhost.example.com
smtpd_banner = $myhostname ESMTP
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
smtpd_tls_cert_file=/etc/ssl/private/cert.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-key.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_tls_security_level=may
smtpd_tls_protocols = !SSLv2, !SSLv3
smtpd_helo_required = yes
local_recipient_maps = proxy:unix
smtpd_helo_restrictions = permit_mynetworks,
reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname,
reject_unknown_helo_hostname, permit
smtpd_recipient_restrictions = reject_unknown_client_hostname,
reject_unknown_sender_domain, reject_unknown_recipient_domain,
reject_unauth_pipelining, permit_mynetworks,
permit_sasl_authenticated, reject_unauth_destination,
reject_invalid_hostname, reject_non_fqdn_sender
smtpd_sender_restrictions = reject_unknown_sender_domain,
reject_sender_login_mismatch
**************************************************
/etc/mailname is:
example.com