S
S
Sergei Iamskoi2017-02-06 12:28:58
Debian
Sergei Iamskoi, 2017-02-06 12:28:58

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]

(mail pdd.yandex.ru)
file /etc/exim4/passwd.client looks like this:
smtp.yandex.ru: [email protected]:pass1
smtp.yandex.ru: [email protected]:pass2

Next, we check, first from the user user1:
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

Everything is fine, the mail is gone. Now we try to send from user2 user:
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

From this user does not send any more. But! Once you edit the passwd.client file like this:
#smtp.yandex.ru: [email protected]:pass1
smtp.yandex.ru: [email protected]:pass2
# Закоменчен первый пользователь

or even like this:
smtp.yandex.ru: [email protected]:pass2
smtp.yandex.ru: [email protected]:pass1
# Поменяны местами

The second user immediately starts sending mail, but the first does not.
Those. The problem seems to be in the wrong configuration of this file. But how to set it up correctly? Everywhere examples are only for one box, but you need to use several (

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2017-02-06
@syamskoy

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 question

Ask a Question

731 491 924 answers to any question