• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Postfix configuration help needed.

yugpatel

Senior member
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
 
What are you using to send an email?

I know roundcude appends the entire hostname to emails which can be changed in the configuration.
 
Try commenting out the "myorigin = /etc/mailname" so it doesn't use it

and change the line "myhostname = mail.example.com"
to "myhostname = example.com"

restart postfix

run "postconf -n" to show just the changes from the default values
 
Try commenting out the "myorigin = /etc/mailname" so it doesn't use it

and change the line "myhostname = mail.example.com"
to "myhostname = example.com"

restart postfix

run "postconf -n" to show just the changes from the default values

I will give it a shot and post the result. In order to make sure my MX record,A record and DNS record is correct, I installed hMainserver under Win server 2008 and it worked flawlessly. It send out mail as foo@example.com.
 
Last edited:
Back
Top