Answer the question
In order to leave comments, you need to log in
How to set up Exim for multiple boxes?
According to the instructions on the Internet, I configured Exim4 as a smarthost to send mail via smtp.yandex.ru. It works for one user, but it is impossible to send from another user - it does not authorize. Now in more detail:
Debian8 system, it has two users user1 and user2
The /etc/email-addresses file looks like this:
user1: [email protected]
user2: [email protected]
smtp.yandex.ru: [email protected]:pass1
smtp.yandex.ru: [email protected]:pass2
exim -v [email protected]
Test
LOG: MAIN
<= [email protected] U=user1 P=local S=334
[email protected]:/usr/lib/exim4$ delivering 1caeri-0007hL-BS
R: smarthost for [email protected]
T: remote_smtp_smarthost for [email protected]
Connecting to smtp.yandex.ru [2a02:6b8::38]:25 ... connected
SMTP<< 220 smtp1p.mail.yandex.net ESMTP (Want to use Yandex.Mail for your domain? Visit http://pdd.yandex.ru)
SMTP>> EHLO s052d78582331.mydomain.ru
SMTP<< 250-smtp1p.mail.yandex.net
250-8BITMIME
250-PIPELINING
250-SIZE 42991616
250-STARTTLS
250-AUTH LOGIN PLAIN XOAUTH2
250-DSN
250 ENHANCEDSTATUSCODES
SMTP>> STARTTLS
SMTP<< 220 Go ahead
SMTP>> EHLO [email protected]
SMTP<< 250-smtp1p.mail.yandex.net
250-8BITMIME
250-PIPELINING
250-SIZE 42991616
250-AUTH LOGIN PLAIN XOAUTH2
250-DSN
250 ENHANCEDSTATUSCODES
SMTP>> AUTH PLAIN ********************************************
SMTP<< 235 2.7.0 Authentication successful.
SMTP>> MAIL FROM:<[email protected]> SIZE=1366 [email protected]
SMTP>> RCPT TO:<[email protected]>
SMTP>> DATA
SMTP<< 250 2.1.0 <[email protected]> ok
SMTP<< 250 2.1.5 <[email protected]> recipient ok
SMTP<< 354 Enter mail, end with "." on a line by itself
SMTP>> writing message and terminating "."
SMTP<< 250 2.0.0 Ok: queued on smtp1p.mail.yandex.net as 1486370501-foDUWiYyKD-feQSes2E
SMTP>> QUIT
LOG: MAIN
=> [email protected] R=smarthost T=remote_smtp_smarthost H=smtp.yandex.ru [2a02:6b8::38] X=TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128 DN="C=RU,O=Yandex LLC,OU=ITO,L=Moscow,ST=Russian Federation,CN=smtp.yandex.ru,[email protected]" A=plain C="250 2.0.0 Ok: queued on smtp1p.mail.yandex.net as 1486310501-foDUWiYyKD-feQSes5E"
LOG: MAIN
Completed
exim -v [email protected]
sdfsdfs
LOG: MAIN
<= [email protected] U=user2 P=local S=335
[email protected]:/usr/lib/exim4$ delivering 1caf4f-0001zq-UF
R: smarthost for [email protected]
T: remote_smtp_smarthost for [email protected]
Connecting to smtp.yandex.ru [2a02:6b8::38]:25 ... connected
SMTP<< 220 smtp2p.mail.yandex.net ESMTP (Want to use Yandex.Mail for your domain? Visit http://pdd.yandex.ru)
SMTP>> EHLO s052d78583321.mydomain.ru
SMTP<< 250-smtp2p.mail.yandex.net
250-8BITMIME
250-PIPELINING
250-SIZE 42991616
250-STARTTLS
250-AUTH LOGIN PLAIN XOAUTH2
250-DSN
250 ENHANCEDSTATUSCODES
SMTP>> STARTTLS
SMTP<< 220 Go ahead
SMTP>> EHLO s052d78583321.mydomain.ru
SMTP<< 250-smtp2p.mail.yandex.net
250-8BITMIME
250-PIPELINING
250-SIZE 42991616
250-AUTH LOGIN PLAIN XOAUTH2
250-DSN
250 ENHANCEDSTATUSCODES
SMTP>> AUTH PLAIN ************************************
SMTP<< 235 2.7.0 Authentication successful.
SMTP>> MAIL FROM:<[email protected]> SIZE=1367 [email protected]
SMTP>> RCPT TO:<[email protected]>
SMTP>> DATA
SMTP<< 553 5.7.1 Sender address rejected: not owned by auth user.
SMTP<< 503 5.5.4 Bad sequence of commands.
SMTP<< 503 5.5.4 Bad sequence of commands.
SMTP>> QUIT
LOG: MAIN
** [email protected] R=smarthost T=remote_smtp_smarthost X=TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128 DN="C=RU,O=Yandex LLC,OU=ITO,L=Moscow,ST=Russian Federation,CN=smtp.yandex.ru,[email protected]": SMTP error from remote mail server after MAIL FROM:<[email protected]> SIZE=1367 [email protected]: host smtp.yandex.ru [2a02:6b8::38]: 553 5.7.1 Sender address rejected: not owned by auth user.
LOG: MAIN
<= <> R=1caf4f-0001zq-UF U=Debian-exim P=local S=1403
LOG: MAIN
Completed
#smtp.yandex.ru: [email protected]:pass1
smtp.yandex.ru: [email protected]:pass2
# Закоменчен первый пользователь
smtp.yandex.ru: [email protected]:pass2
smtp.yandex.ru: [email protected]:pass1
# Поменяны местами
Answer the question
In order to leave comments, you need to log in
Didn't have to configure smarthost.
I can suggest using two different passwd.client files, choosing the right one, depending on the required user.
I can tell you something in more detail only after seeing your router and transport.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question