Welcome to the Linux Foundation Forum!

Postfix cannot send emails outside of network

I know this issue comes up a lot, but none of the fixes I have found in the last couple days will work. I guess I will have to post my config and hope something sticks out to somebody. I have postfix installed on Ubuntu server 10.0.4 lts and can send/receive internally via smtp telnet session. I know this is probably something very simple, I just feel like I have tried everthing I have found to try. I followed the guide at https://help.ubuntu.com/community/Postfix . Here is my postconf -n:

[email protected]:~$ 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

home_mailbox = Maildir/

inet_interfaces = all

inet_protocols = all

mailbox_command =

mailbox_size_limit = 0

mydestination = myserver.mydomain.com, mydomain.com, localhost.mydomain.com, , localhost

mydomain = mydomain.com

myhostname = myserver.mydomain.com

mynetworks = 127.0.0.0/8, 192.168.20.0/24

myorigin = $mydomain

readme_directory = no

recipient_delimiter = +

relayhost =

smtp_tls_note_starttls_offer = yes

smtp_tls_security_level = may

smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)

smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination

smtpd_sasl_auth_enable = yes

smtpd_sasl_local_domain =

smtpd_sasl_security_options = noanonymous

smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem

smtpd_tls_auth_only = no

smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt

smtpd_tls_key_file = /etc/ssl/private/smtpd.key

smtpd_tls_loglevel = 1

smtpd_tls_received_header = yes

smtpd_tls_security_level = may

smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache

smtpd_tls_session_cache_timeout = 3600s

smtpd_use_tls = yes

tls_random_source = dev:/dev/urandom

And I get this message trying to send:

554 5.7.1 : Relay access denied

Comments

  • I found the problem...finally! And of course it was something incredibly simple. Since I set it to use all protocols I needed [::1]/128 in the mynetworks = line. Is [::1]/128 the same as 127.0.0.0/8 in the sense that it is only my local machine? I am not opening up a security risk?

    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
    home_mailbox = Maildir/
    inet_interfaces = all
    inet_protocols = all
    mailbox_command =
    mailbox_size_limit = 0
    mydestination = myserver.mydomain.com, mydomain.com, localhost.mydomain.com, localhost
    mydomain = mydomain.com
    myhostname = myserver.mydomain.com
    mynetworks = 127.0.0.0/8, 192.168.20.0/24, [::1]/128
    myorigin = /etc/mailname
    readme_directory = no
    recipient_delimiter = +
    relayhost =
    smtp_tls_note_starttls_offer = yes
    smtp_tls_security_level = may
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_local_domain =
    smtpd_sasl_security_options = noanonymous
    smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
    smtpd_tls_auth_only = no
    smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt
    smtpd_tls_key_file = /etc/ssl/private/smtpd.key
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_security_level = may
    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    smtpd_tls_session_cache_timeout = 3600s
    smtpd_use_tls = yes
    tls_random_source = dev:/dev/urandom
  • thank you!

Categories

Upcoming Training