Postfix Gmail Smarthost

Если вы пользуетесь Gmail и у вас есть свой выделенный сервер, то достаточно просто заставить postfix на этом сервере отправлять почту через ваш Gmail аккаунт. Для ubuntu все, что нужно сделать, это:

Файл /etc/postfix/main.cf:

relayhost = smtp.gmail.com:587
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

Создать файл /etc/postfix/sasl_passwd с параметрами авторизации Gmail:

smtp.gmail.com:587 user@gmail.com:PASSWORD

Выполнить комманды:

postmap /etc/postfix/sasl_passwd
chmod 640 /etc/postfix/sasl_passwd*
chown postfix.postfix /etc/postfix/sasl_passwd*
/etc/init.d/postfix restart

Ну и убедиться, что почта правильно уходит.

3 Comments

  1. serbog:

    Вот небольшой список хостингов предоставляющих выделенные сервера: http://bestdedicatedserver.blogspot.com/

  2. AntonPetrov:

    1. chown postfix.postfix /etc/postfix/sasl_passwd*

    я бы заменил на

    chown root.postfix /etc/postfix/sasl_passwd*

    2. не забудьте положить корневой сертификат (для проверки сертификата gmail.com) и сказать к нему путь
    3. если это Debian то libsasl2-modules должен стоять

  3. Jetman:

    По пункту 2 не помешали бы детали, где брать и как прописывать. Спасибо за дополнения.

Leave a comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Subscribe without commenting