Linux – Network – Technology
Posts tagged postfix
Postfix smart hot with gmail
Jan 2nd
Installation de Postfix
apt-get install postfix
configurationType of mail server : Satellite System
- Mail Name : example.org (the name you want on your outbound mail)
- SMTP relay host : smtp.gmail.com
- Postmaster : I left this blank
- Other destinations : I left this blank
- Synchronous Queues : your choice, won’t impact the relaying
- Network blocks to allow relay : default (unless you know what your doing)
- Mailbox size : your choice, won’t impact relaying
- Local address : i left this as ‘+’
- Listen Address : all, your choice
Editer le fichier de config
vi /etc/postfix/main.cf smtp_use_tls=yes smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_sasl_tls_security_options = noanonymous
Création du fichier de sasl_passwd
vi /etc/postfix/sasl_passwd smtp.gmail.com some.user@gmail.com:PASSWORD
Rebuild Hash
postmap/etc/postfix/sasl_passwd
Restart postfix
/etc/init.d/postfix restart
On sécurise un peu
chmod640/etc/postfix/sasl_passwd*chownpostfix.postfix/etc/postfix/sasl_passwd*
Postfix – Specify output ip per domain
May 10th
We have to use de function sender_dependent_default_transport_maps.
-
Edit a new file
vi sdd_transport_maps.regexp /@opilab\.ch$/ opilab_ch: /@opilab\.com$/ opilab.com:
-
Edit master.conf
vi /etc/postfix/master.conf
opilab_ch unix - - n - - smtp
-o smtp_bind_address=IP1
-o smtp_helo_name=opilab.ch
-o syslog_name=postfix-opilab_ch
opilab_com unix - - n - - smtp
-o smtp_bind_address=IP2
-o smtp_helo_name=opilab.com
-o syslog_name=postfix-opilab_com
-
Edit main config
vi /etc/postfix/main.cf sender_dependent_default_transport_maps = regexp:/etc/postfix/sdd_transport_maps.regexp