5

I run into problem where I cannot send mail via SMTP by using for example Thunderbird - but locally from machine, mail sending works perfectly fine. Mail server got configured also dovecot - that is working ok and spamassassin - also work ok. I'm probably missing something obvious but I just cannot find it.

In logs I got this when trying to send mail via Thunderbird on remote host:

May 22 14:06:16 d7205 postfix/smtpd[11560]: setting up TLS connection from unknown[x.y.z.c]
May 22 14:06:16 d7205 postfix/smtpd[11560]: Anonymous TLS connection established from unknown[x.y.z.c]: TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)
May 22 14:06:17 d7205 postfix/smtpd[11560]: NOQUEUE: reject: RCPT from unknown[x.y.z.c]: 554 5.7.1 : Relay access denied; from= to= proto=ESMTP helo=
May 22 14:06:18 d7205 postfix/smtpd[11560]: disconnect from unknown[x.y.z.c]

Current postfix config (postfix -n):

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
bounce_queue_lifetime = 2d
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_owner = postfix
mail_spool_directory = /var/spool/mail
mailbox_size_limit = 256000000
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
maximal_queue_lifetime = 3d
mydestination = pcre:/etc/postfix/mydomains
mydomain = domain.tld
myhostname = domain.tld
mynetworks = 192.168.1.0/24, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
queue_run_delay = 30s
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
recipient_delimiter = +
relay_domains = $mydestination
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_sasl_security_options = noplaintext, noanonymous
smtp_tls_cert_file = /etc/pki/tls/certs/postfix.crt
smtp_tls_key_file = /etc/pki/tls/certs/postfix.key
smtp_tls_note_starttls_offer = yes
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP
smtpd_recipient_restrictions = reject_unauth_destination, permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = permit_sasl_authenticated,
        reject_unknown_sender_domain,
        reject_non_fqdn_sender,
        reject_unknown_address,
        permit
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/pki/tls/certs/postfix.crt
smtpd_tls_key_file = /etc/pki/tls/certs/postfix.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550 

and maste.cf looks like this:

smtp      inet  n       -        -      -       -       smtpd
submission inet n       -       n       -       -       smtpd
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
   -o content_filter=spamassassin
smtps     inet  n       -       -       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#628      inet  n       -       n       -       -       qmqpd
pickup    fifo  n       -       n       60      1       pickup
cleanup   unix  n       -       n       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       n       1000?   1       tlsmgr
rewrite   unix  -       -       n       -       -       trivial-rewrite
bounce    unix  -       -       n       -       0       bounce
defer     unix  -       -       n       -       0       bounce
trace     unix  -       -       n       -       0       bounce
verify    unix  -       -       n       -       1       verify
flush     unix  n       -       n       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       n       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       n       -       -       smtp
        -o smtp_fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       n       -       -       showq
error     unix  -       -       n       -       -       error
retry     unix  -       -       n       -       -       error
discard   unix  -       -       n       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       n       -       -       lmtp
anvil     unix  -       -       n       -       1       anvil
scache    unix  -       -       n       -       1       scache  

dovecot   unix  -       n       n       -       -       pipe
  flags=DRhu argv=/usr/lib/dovecot/deliver -d ${recipient}

spamassassin unix -     n       n       -       -       pipe
   user=spamd argv=/usr/bin/spamc -f -e
   /usr/sbin/sendmail -oi -f ${sender} ${recipient}
2
  • 2
    Is Thunderbird set to authenticate?
    – cjc
    May 22, 2012 at 12:41
  • 1
    There's no authentication in that log... Usually authentication is required to relay.
    – Chris S
    May 22, 2012 at 12:49

1 Answer 1

3

Problem was that I did not have this particular settings in postfix configuration:

smtpd_recipient_restrictions =
   permit_sasl_authenticated,
   permit_mynetworks,
   check_relay_domains

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .