Centos – Having Trouble Setting Up CentOS Email Server

centosemail-serverpostfixsendmail

I'm having some trouble setting up a mail server on CentOS, as of right now, nothing is getting sent at all and I'm not entirely sure why, I've tried a few guides, but none of them seem to explain anything about the problems, I don't know if I possibly have entered something wrong somewhere.

I'm not entirely sure what configs I'll need to post here, but if you need them, just ask 🙂

The server that I'm using is a CentOS server hosted at my home, we have set it up to receive a port forward from the router from port 1 to 65556, so all of the ports are available to the server, there should be no trouble in that respect.

This is the local user error log:

/var/log/maillog:

Mar  2 18:03:12 localhost postfix/smtp[6113]: 4BE3A959E: to=<conner@******.com>, relay=mx1.ovh.net[213.186.33.29]:25, delay=62, delays=0.06/0.01/62/0.08, dsn=5.0.0, status=bounced (host mx1.ovh.net[213.186.33.29] said: 552 sorry, your envelope sender domain must exist (#5.7.1) (in reply to MAIL FROM command))
Mar  2 18:03:12 localhost postfix/smtp[6113]: 4BE3A959E: lost connection with mx1.ovh.net[213.186.33.29] while sending RCPT TO
Mar  2 18:03:12 localhost postfix/cleanup[6112]: 3036911153: message-id=<20140302180312.3036911153@localhost.localdomain>
Mar  2 18:03:12 localhost postfix/bounce[6114]: 4BE3A959E: sender non-delivery notification: 3036911153
Mar  2 18:03:12 localhost postfix/qmgr[8477]: 3036911153: from=<>, size=2799, nrcpt=1 (queue active)
Mar  2 18:03:12 localhost postfix/qmgr[8477]: 4BE3A959E: removed

postconf -n Output:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = localhost
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550

Error Log After Suggested Answer:

Mar  3 19:55:25 localhost sendmail[2711]: s23JtP5O002711: localhost.localdomain [127.0.0.1] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
Mar  3 19:55:26 localhost sendmail[2712]: s23JtPJc002712: conner@koanhosting.com... User unknown
Mar  3 19:55:26 localhost sendmail[2712]: s23JtPJc002712: from=derp@koangaming.com, size=0, class=0, nrcpts=0, proto=SMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Mar  3 19:58:03 localhost sendmail[2756]: s23Jw3lq002756: localhost.localdomain [127.0.0.1] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
Mar  3 19:58:04 localhost sendmail[2757]: s23Jw3dS002757: localhost.localdomain [127.0.0.1] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
Mar  3 19:58:07 localhost sendmail[2759]: s23Jw7wq002759: localhost.localdomain [127.0.0.1] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
Mar  3 19:58:08 localhost sendmail[2760]: s23Jw7kP002760: conner@koanhosting.com... User unknown
Mar  3 19:58:08 localhost sendmail[2760]: s23Jw7kP002760: from=conner@koanhosting.com, size=0, class=0, nrcpts=0, proto=SMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Mar  3 19:58:56 localhost sendmail[2764]: s23Jws2r002764: cpc2-sgyl27-2-0-cust995.sgyl.cable.***********.net [82.41.183.228] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
Mar  3 19:58:56 localhost sendmail[2765]: s23Jwutl002765: cpc2-sgyl27-2-0-cust995.sgyl.cable.***********.net [82.41.183.228] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
Mar  3 19:59:12 localhost sendmail[2767]: s23JxBSD002767: cpc2-sgyl27-2-0-cust995.sgyl.cable.***********.net [82.41.183.228] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
Mar  3 19:59:14 localhost sendmail[2768]: s23JxCnO002768: conner@***********.com... User unknown
Mar  3 19:59:14 localhost sendmail[2768]: s23JxCnO002768: from=conner@koangaming.com, size=0, class=0, nrcpts=0, proto=SMTP, daemon=MTA, relay=cpc2-sgyl27-2-0-cust995.sgyl.cable.virginm.net [82.41.183.228]

New Postconf -n Settings:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = localhost
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = **********.co.uk
myhostname = mail.***********.co.uk
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550

Best Answer

status=bounced (host mx1.ovh.net[213.186.33.29] said: 552 sorry, your envelope sender domain must exist (#5.7.1) (in reply to MAIL FROM command))

As I see from the log, you are tried to send mail from non exist domain. I assume that you are using localhost or localhost.localdomain. You should use fqdn instead

Add the following lines to the main.cf and restart postfix

myhostname = mail.example.net
mydomain = example.net
myorigin = $mydomain

P.S. You should replace example.net with your real domain name

Related Topic