Ubuntu – Cannot send email outside of network using Postfix

emailpostfixrequest-trackersmtpUbuntu

I've set up an Ubuntu server with Request Tracker following this guide (the section about inbound mail would be relevant). However, while I'm able to send mail to other users within the network/domain, I cannot seem to reach beyond – such as my personal accounts etc. Now I have no idea what is causing this, I thought that all it takes is for the system to fetch mail through our exchange server and be able to deliver in the same way. However, that hasn't been the case.

I have found another server setup in a similar fashion (CentOS 5, Request Tracker but using Sendmail), however it is a dated server and whoever's built it has kindly left no documentation on how it works, making it a pain to use that as a reference system! 🙂

At one point, I was told I need to set up a relay between the local server's email add and our AD server but this didn't seem to work. Sorry, I know next to nothing about mailservers, my colleagues nothing about Linux so it's a hard one for me.

Thank you!

EDIT: Result of postconf -N with details masked =)

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = myhost.mydomain.com, localhost.mydomain.com, , localhost
myhostname = myhost.mydomain.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost = EXCHANGE IP
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes

Sample log message:

Sep 4 12:32:05 hostname postfix/smtp[9152]: 2147B200B99:
   to=<foo@bar.com>, relay= RELAY IP :25, delay=0.1, delays=0.05/0/0/0.04,
   dsn=5.7.1, status=bounced (host HOST IP said: 550 5.7.1 Unable to relay
   for foo@bar.com (in reply to RCPT TO command))

Best Answer

First of all you need to check that your firewall allows outboud connections to port 25(SMTP).
If it does, you need to check that your emails simply don't get banned. Checking the logs might help as it will show you bounced emails here. If this is the case then you need to setup RDNS, a SPF Record and optionally DKIM
If after this emails still fail to go out then you need to analyze the logs and see what they say since it might be something else.

Related Topic