0

I am trying a simple postfix relay of emails via an SMTP server. But I see from the logs that the mails are relayed to local and not to the relay host.

The main.cf configurations are below,

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database=btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database=btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

#transport_maps = hash:/etc/postfix/transport

myhostname=testingserver.com
alias_maps=hash:/etc/aliases
alias_database=hash:/etc/aliases
myorigin=/etc/mailname
mydestination=testingserver.com, testingserver.intranet.com, localhost.testingserver.com, localhost.testingserver.intranet.com, localhost
mynetworks=127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
#mailbox_command = procmail -a "$EXTENSION"
#mailbox_size_limit = 0
#recipient_delimiter=+
inet_interfaces=all
relayhost = smtp.intranet.com
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =

The mail.log while sending an email is below,

testingserver.com postfix/pickup[27297]: 63A3720CAA: uid=1000 from=<ubuntu>
testingserver.com postfix/cleanup[27316]: 63A3720CAA: message-id=<[email protected]>
testingserver.com postfix/qmgr[27298]: 63A3720CAA: from=<[email protected]>, size=768, nrcpt=1 (queue active)
testingserver.com postfix/local[27319]: 63A3720CAA: to=<[email protected], orig_to=<ubuntu>, relay=local, delay=0.1, delays=0.07/0/0/0.02, dsn=2.0.0, status=sent (delivered to mailbox)
testingserver.com postfix/qmgr[27298]: 63A3720CAA: removed

Not sure how to debug this, any pointers would be great.

1 Answer 1

1

relayhost is only used when you are sending email that is routed to a 'remote' host.

Since you have your postfix installation with the testingserver.com as myhostname, and you are trying to send the test email to a @testingserver.com email, postfix will rule this email local and will deliver it to the local user.

Your configuration should work, just test with a 'remote' address. Try to send to a gmail account for example.

0

You must log in to answer this question.

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