Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My Postfix setup does not receive emails from anywhere other than the localhost (sendmail).

I can log in and send emails from my server, but nothing comes in.

Here is my postconf -n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = amavis:[127.0.0.1]:10024
disable_vrfy_command = yes
inet_interfaces = all
mailbox_size_limit = 0
message_size_limit = 0
mydestination =
mydomain = dangersalad.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mynetworks_style = host
myorigin = /etc/mailname
readme_directory = no
receive_override_options = no_address_mappings
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_delay_reject = yes
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject
smtpd_tls_cert_file = /etc/ssl/private/mail.mydomain.com.crt
smtpd_tls_key_file = /etc/ssl/private/mail.mydomain.com.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/maps/alias.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /var/spool/mail/virtual
virtual_mailbox_domains = mysql:/etc/postfix/maps/domain.cf
virtual_mailbox_limit = 0
virtual_mailbox_maps = mysql:/etc/postfix/maps/user.cf
virtual_uid_maps = static:5000

And here is the error in the log

Jan  9 19:14:06 mail postfix/smtpd[2389]: connect from mail-ie0-f171.google.com[209.85.223.171]
Jan  9 19:14:07 mail postfix/smtpd[2389]: NOQUEUE: reject: RCPT from mail-ie0-f171.google.com[209.85.223.171]: 554 5.7.1 <paul.dangersalad@gmail.com>: Sender address rejected: Access denied; from=<paul.dangersalad@gmail.com> to=<paul@dangersalad.com> proto=ESMTP helo=<mail-ie0-f171.google.com>
Jan  9 19:14:07 mail postfix/smtpd[2389]: disconnect from mail-ie0-f171.google.com[209.85.223.171]

Any advice?

share|improve this question
    
Ok, I have changed them back. –  DuineAnaithnid Jan 9 '13 at 19:23
    
What are you trying to accomplish here with your setup? What is the context of this mail server? This server is clearly not accepting mail inbound because of its configuration. Current values to both smtpd_recipient_restrictions and smtpd_sender_restrictions are preventing you to receive anything other than local network connected hosts as well as authenticated users. –  gertvdijk Jan 9 '13 at 19:26
    
I want to be able to receive mail from anywhere and only send mail from an authenticated user –  DuineAnaithnid Jan 9 '13 at 19:32

1 Answer 1

This behaviour is created by the lines

smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject

and

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128

Don't (repeat don't) just remove reject!

I advise against running any publicly accessible mail server unless you are already experienced with managing those beasts. Run it within your network, use a small virtualization structure to get a feeling for the pitfalls and read.

One good source for instance is the Ubuntu Server Guide

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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