Настройка postfix и dovecop для пересылки почты (Plaintext Authentication)
# yum install -y \
dovecot
# chkconfig --level 345 dovecot on
# service dovecot start
# cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.bkp
# cp /etc/postfix/master.cf /etc/postfix/master.cf.bkp
# vi /etc/dovecot/dovecot.conf
protocols = imap pop3
login_greeting = POP3/IMAP server ready.
listen = *
# service dovecot restart
# netstat --inet -lpn | grep dovecot
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 1095/dovecot
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 1095/dovecot
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 1095/dovecot
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 1095/dovecot
Check that it's allowing remote logins
# nc sysadm.ru 143
a login "username" "password"
// В моем случае это:
a login bill.gates 1234
* BAD [ALERT] Plaintext authentication not allowed without SSL/TLS, but your client did it anyway. If anyone was listening, the password was exposed.
a NO [PRIVACYREQUIRED] Plaintext authentication disallowed on non-secure (SSL/TLS) connections.
// Разрешаем plaintext аутентификацию
disable_plaintext_auth = no
mail_location = maildir:~/Maildir
# nc sysadm.ru 143
a login "username" "password"
// Check that it finds INBOX
b select inbox
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.
* 2 EXISTS
* 2 RECENT
* OK [UNSEEN 1] First unseen.
* OK [UIDVALIDITY 1387822975] UIDs valid
* OK [UIDNEXT 3] Predicted next UID
* OK [HIGHESTMODSEQ 1] Highest
b OK [READ-WRITE] Select completed.
============================================
Нужно проверить:
Забрать письмо из консоли:
ns sysadm.ru 110
USER bill.gates
PASS 1234
list
retr 1
dele 1
quit
============================================
После подключаю thunderbird.
Почту удается успешно забрать.
При попытке отправить сообщение, получаю сообщение.
An error occurred while sending mail. The mail server responded: 5.7.1 : Relay access denied. Please check the message recipient [email protected] and try again.
Dec 24 10:44:50 mailserv postfix/smtpd[3799]: connect from podzapretom.static.corbina.ru[95.31.31.8]
Dec 24 10:44:50 mailserv postfix/smtpd[3799]: NOQUEUE: reject: RCPT from podzapretom.static.corbina.ru[95.31.31.8]: 554 5.7.1 : Relay access denied; from= to= proto=ESMTP helo=<[192.168.1.5]>
vi /etc/postfix/main.cf
Добавил в доверительные сети ip адрес машины с которой я подключаюсь к серверу через интернет:
mynetworks = 95.31.31.8
Почта стала отправляться на gmail.com
http://wiki2.dovecot.org/ru/
http://tnadm.blogspot.ru/2012/08/blog-post_16.html
http://www.ussr.kiev.ua/ru/Debian-Postfix-Dovecot