Smtp

De Mathux

Postfix with relayhost

Some documentation could be found [[1]]

Here is the result of postconf -n.

Be aware of the variables name : some are using stmp, some are using stmpd

alias_database = $alias_maps
alias_maps = hash:/etc/postfix/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
data_directory = /var/lib/postfix
debug_peer_level = 5
debug_peer_list = smtp-msa.orange.fr
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
mail_owner = postfix
mail_spool_directory = /var/spool/mail
mailbox_command = /usr/bin/procmail -Y -a "$DOMAIN"
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,	mail.$mydomain, www.$mydomain, ftp.$mydomain
mydomain = hectorone.homedns.org
myhostname = hectorone.homedns.org
mynetworks = 192.168.1.0/24, 127.0.0.0.8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
relay_domains = $mydestination
relayhost = [smtp-msa.orange.fr]:587
sample_directory = /etc/postfix/sample
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/saslpass
smtp_sasl_security_options = noanonymous
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
smtpd_delay_reject = yes
smtpd_recipient_restrictions = permit_sasl_authenticated, reject_unauth_destination, permit_mynetworks
smtpd_sasl_local_domain = 
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550

Some short explanations

debug_peer_level = 5
debug_peer_list = smtp-msa.orange.fr

This is used to increase verbosity for connect with the relay host

smtp_sasl_password_maps = hash:/etc/postfix/saslpass

This file (/etc/postfix/saslpass) is used to read password to connect to your relay_host

Each entries in this file should look like :

[my.stmp.relay]:port login:passwd

In orange smtp case, the login is your complete mail address including @orange.fr

This file should be transformed in hash table using the following command (otherwise you will get an error postfix/smtp[25238]: fatal: open database /etc/postfix/saslpass.db: Invalid argument):

sudo postmap hash:/etc/posfix/saslpass