2

I followed this tutorial and was able to create a mail account that can be configured in an email client.

The problem is that I can't receive any messages to my inbox BUT I can send messages perfectly fine. I tried to send an email from gmail to my newly created account and got an error message automatically sent to my Gmail in the picture below.

Here is my config from /etc/postfix/main.cf:

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


myhostname = mail.dougb3ney.com
mydomain = dougb3ney.com
myorigin = $mydomain
home_mailbox = mail/
mynetworks = 127.0.0.0/8
inet_interfaces = all
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes


smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reje$

smtp_tls_security_level = may
smtpd_tls_security_level = may
smtp_tls_note_starttls_offer = yes
smtpd_tls_loglevel = 1
smtpd_tls_key_file = /etc/postfix/ssl/server.key
smtpd_tls_cert_file = /etc/postfix/ssl/server.crt
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom


smtpd_milters           = inet:127.0.0.1:8891
non_smtpd_milters   = $smtpd_milters
milter_default_action   = accept
milter_protocol         = 2

Also, the CentOS server that this is running on has an A-record for mail.dougb3ney.com.

UPDATE: Mail is still not showing up in my inbox, BUT the sender is no longer getting a failure message.

I am still getting a funky error in /var/log/maillog

 Nov 10 17:07:27 mail dovecot: pop3-login: Login: user=<email>, method=PLAIN, rip=33.23.4.250, lip=162.243.7.7, mpid=10638, TLS, session=<p1By7zYkXgBgJwT6>
Nov 10 17:07:27 mail dovecot: pop3(email): Disconnected: Logged out top=0/0, retr=0/0, del=0/1, size=1235
Nov 10 17:08:12 mail postfix/submission/smtpd[10653]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Nov 10 17:08:12 mail postfix/submission/smtpd[10653]: warning: cannot get RSA certificate from file /etc/ssl/certs/ssl-mail.pem: disabling TLS support
Nov 10 17:08:12 mail postfix/submission/smtpd[10653]: warning: TLS library problem: 10653:error:02001002:system library:fopen:No such file or directory:bss_file.c:398:fopen('/etc/ssl/certs/ssl-mail.pem','r'):
Nov 10 17:08:12 mail postfix/submission/smtpd[10653]: warning: TLS library problem: 10653:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:400:
Nov 10 17:08:12 mail postfix/submission/smtpd[10653]: warning: TLS library problem: 10653:error:140DC002:SSL routines:SSL_CTX_use_certificate_chain_file:system lib:ssl_rsa.c:722:
Nov 10 17:08:12 mail postfix/submission/smtpd[10653]: connect from mail-qk0-f173.google.com[209.85.220.173]
Nov 10 17:08:12 mail postfix/submission/smtpd[10653]: lost connection after STARTTLS from mail-qk0-f173.google.com[209.85.220.173]
Nov 10 17:08:12 mail postfix/cleanup[10656]: E3BF73FD10: message-id=<20151110220812.E3BF73FD10@mail.dougb3ney.com>
Nov 10 17:08:12 mail postfix/qmgr[10564]: E3BF73FD10: from=<double-bounce@mail.dougb3ney.com>, size=904, nrcpt=1 (queue active)
Nov 10 17:08:12 mail postfix/submission/smtpd[10653]: disconnect from mail-qk0-f173.google.com[209.85.220.173]
Nov 10 17:08:12 mail postfix/local[10658]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Nov 10 17:08:12 mail postfix/local[10658]: E3BF73FD10: to=<root@dougb3ney.com>, orig_to=<postmaster>, relay=local, delay=0.04, delays=0.02/0.01/0/0, dsn=2.0.0, status=sent (delivered to maildir)
Nov 10 17:08:12 mail postfix/qmgr[10564]: E3BF73FD10: removed
Nov 10 17:08:26 mail dovecot: pop3-login: Login: user=<email>, method=PLAIN, rip=33.23.4.250, lip=162.243.7.7, mpid=10664, TLS, session=<f4P68jYkaABgJwT6>
Nov 10 17:08:27 mail dovecot: pop3(email): Disconnected: Logged out top=0/0, retr=0/0, del=0/1, size=1235
| improve this question | | | | |
  • what does the reject message in your mail server's /var/log/mail.log look like. i.e. edit your question and add the output from grep -i 'reject:.*email@dougb3ney.com' /var/log/mail.log (or grep whichever log file centos uses for mail if it's not mail.log) – cas Nov 10 '15 at 3:55
2

Try putting permit_auth_destination in the smtpd_recipient_restrictions (between permit_mynetworks and reject).

Without that, your local networks are allowed to send mail, but there's nothing that tells postfix that it's allowed to accept some mail (e.g. for your domains).

Alternatively, change reject to reject_unauth_destination, permit

In other words, you need to have either:

...,permit_auth_destination,reject

or

...,reject_unauth_destination,permit
| improve this answer | | | | |
  • Thanks for the try. Unfortunately it didn't appear to do anything. Just to be clear I did it correctly, my new line is smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks, reject_auth_destination, permit _unauth_destination. I also tried the vice versa method as you mentioned. – Doug Beney Nov 10 '15 at 21:27
  • read my answer again, you either got it wrong in your config or wrong in your comment just now. – cas Nov 10 '15 at 21:32
  • Sorry about that. I fixed the code and we are getting closer! If you can, read my update in the question. The sender no longer gets an error email, but the mail is still not making it to my inbox. – Doug Beney Nov 10 '15 at 22:22
  • it looks like your postfix is configured for TLS but you haven't generated a certificate. – cas Nov 11 '15 at 1:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.