A
A
Anatoly2019-08-09 13:06:30
Email
Anatoly, 2019-08-09 13:06:30

How to configure postfix relay via smtp.mail.ru?

I configure postfix as relay for a mailbox on mail.ru. For yandex and gmail it works correctly, for mail.ru it doesn't work at all.
Config /etc/postfix/main.cf

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = 'PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5'
html_directory = no
inet_interfaces = localhost
inet_protocols = ipv4
mail_owner = postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = мой_хостнейм
myhostname = мой_хостнейм
mynetworks = 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
queue_directory = /var/spool/postfix
setgid_group = postdrop
smtp_tls_security_level = encrypt
smtp_use_tls = yes
unknown_local_recipient_reject_code = 550
sendmail_path = /usr/sbin/sendmail
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
mailq_path = /usr/bin/mailq
newaliases_path = /usr/bin/newaliases
opendkim_opendkim_genkey_path = /usr/bin/opendkim-genkey
smtp_generic_maps = hash:/etc/postfix/generic
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
relayhost = [smtp.mail.ru]:587

/etc/postfix/sasl_passwd
[smtp.mail.ru]:587 имя@почтовый_домен:пароль
/etc/postfix/generic
root имя@почтовый_домен
Testing mail sending:
echo "Test message" | mail -s "Test subject" -a "From: Test <[email protected]_domain>" [email protected]
in logs
Aug  9 13:02:43 monitoring postfix/pickup[31441]: ABB3016611F4: uid=0 from=<имя@почтовый_домен>
Aug  9 13:02:43 monitoring postfix/cleanup[39537]: ABB3016611F4: message-id=<[email protected]мой_домен>
Aug  9 13:02:43 monitoring postfix/qmgr[31442]: ABB3016611F4: from=<имя@почтовый_домен>, size=365, nrcpt=1 (queue active)
Aug  9 13:02:43 monitoring postfix/smtp[39539]: ABB3016611F4: SASL authentication failed; server smtp.mail.ru[217.69.139.160] said: 535 Authentication failed. Please verify your account by going to https://e.mail.ru/login?email=имя@почтовый_домен
Aug  9 13:02:43 monitoring postfix/smtp[39539]: ABB3016611F4: to=<имя@gmail.com>, relay=smtp.mail.ru[94.100.180.160]:587, delay=0.26, delays=0.02/0.01/0.22/0, dsn=4.0.0, status=deferred (SASL authentication failed; server smtp.mail.ru[94.100.180.160] said: 535 Authentication failed. Please verify your account by going to https://e.mail.ru/login?email=имя@почтовый_домен)

Distribution:
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.3 LTS
Release:	18.04
Codename:	bionic

Why can't postfix log in to smtp.mail.ru? username\password is exactly correct, I log in through the browser successfully.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anatoly, 2019-08-10
@skylinetux

Understood, in the password there was a percentage sign (%). I reset the password and it worked.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question