Что-то я потерялся, поэтому прошу помощи у профи в Sendmail.
На сервере example.com имеется включённая в конфиг пересылка всего на смарт хост.
# tail -n 5 example.com.mcFEATURE(`nullclient', `smarthost.com')
MAILER(local)
MAILER(smtp)
И оно всё работает замечательно до тех пор пока получателем не становится адрес в том же домене example.com. На смарт хост конверт приходит перезаписанным на его собственный домен smarthost.com.
Вот как это выглядит.
Sep 25 12:18:19 example sendmail[97979]: w8PAIJaC097979: from=root, size=28, class=0, nrcpts=1, msgid=<201809251018.w8PAIJaC097979@example.com>, relay=root@localhost
Sep 25 12:18:19 example sm-mta[97980]: STARTTLS=server, relay=localhost [127.0.0.1], version=TLSv1.2, verify=NO, cipher=DHE-RSA-AES256-GCM-SHA384, bits=256/256
Sep 25 12:18:19 example sendmail[97979]: STARTTLS=client, relay=[127.0.0.1], version=TLSv1.2, verify=FAIL, cipher=DHE-RSA-AES256-GCM-SHA384, bits=256/256
Sep 25 12:18:19 example sm-mta[97980]: w8PAIJ18097980: from=<root@example.com>, size=327, class=0, nrcpts=1, msgid=<201809251018.w8PAIJaC097979@example.com>, proto=ESMTPS, daemon=Daemon0, relay=localhost [127.0.0.1]
Sep 25 12:18:19 example sendmail[97979]: w8PAIJaC097979: to=hub, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30028, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (w8PAIJ18097980 Message accepted for delivery)
Sep 25 12:18:19 example sm-mta[97982]: STARTTLS=client, relay=smarthost.com., version=TLSv1.2, verify=FAIL, cipher=ECDHE-RSA-AES256-GCM-SHA384, bits=256/256
Sep 25 12:18:20 example sm-mta[97982]: w8PAIJ18097980: to=<test@example.com>, delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30327, relay=smarthost.com. [IPv6:2000:1:0:0:0:0:0:1], dsn=2.0.0, stat=Sent (OK id=1g4kQ8-0006EX-4r)
Вроде бы, нет проблем.
А вот на получателе.
Sep 25 12:18:20 smart exim[23965]: 1g4kQ8-0006EX-4r <= root@example.com H=(example.com) [2000:2::1] I=[2000:1::1]:25 P=esmtps X=TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256 CV=no S=857 id=201809251018.w8PAIJaC097979@example.com from <root@example.com> for test@smarthost.com
Sep 25 12:18:20 smart spamd[96014]: spamd: connection from localhost [::1]:50359 to port 783, fd 5
Sep 25 12:18:20 smart spamd[96014]: spamd: processing message <201809251018.w8PAIJaC097979@example.com> for test@smarthost.com:26
Sep 25 12:18:21 smart spamd[96014]: spamd: clean message (4.7/5.0) for test@smarthost.com:26 in 0.8 seconds, 857 bytes.
Sep 25 12:18:21 smart spamd[96014]: spamd: result: . 4 - BODY_SINGLE_WORD,PYZOR_CHECK,RDNS_NONE,SPF_HELO_PASS,SPF_PASS scantime=0.8,size=857,user=test@smarthost.com,uid=26,required_score=5.0,rhost=localhost,raddr=::1,rport=50359,mid=<201809251018.w8PAIJaC097979@example.com>,autolearn=no autolearn_force=no
Sep 25 12:18:21 smart exim[40270]: 1g4kQ8-000ATW-GL <= root@example.com U=mailnull P=sa-checked S=1630 id=201809251018.w8PAIJaC097979@example.com from <root@example.com> for test@smarthost.com
Sep 25 12:18:21 smart spamd[82285]: prefork: child states: II
Sep 25 12:18:21 smart exim[68331]: 1g4kQ8-000ATW-GL ** test@smarthost.com: Unrouteable address
Адрес конверта приходит перезаписанным уже от удалённого хоста - я трассировал SMTP сессию.
10:24:04 76182 SMTP>> 250-smarthost.com Hello example.com [2000:2::1]
10:24:04 76182 250-SIZE 33554432
10:24:04 76182 250-8BITMIME
10:24:04 76182 250-DSN
10:24:04 76182 250-PIPELINING
10:24:04 76182 250-AUTH LOGIN PLAIN
10:24:04 76182 250-CHUNKING
10:24:04 76182 250-PRDR
10:24:04 76182 250-SMTPUTF8
10:24:04 76182 250 HELP
10:24:04 76182 Calling SSL_read(0x805223a80, 0x805237000, 4096)
10:24:04 76182 SMTP<< MAIL From:<root@example.com> SIZE=337
10:24:04 76182 spool directory space = 1857744420K inodes = -579478456 check_space = 10240K inodes = 100 msg_size = 5337
10:24:04 76182 log directory space = 1857744420K inodes = -579478456 check_space = 10240K inodes = 100
10:24:04 76182 SMTP>> 250 OK
10:24:04 76182 tls_write(0x80526d000, 8)
10:24:04 76182 SSL_write(SSL, 0x80526d000, 8)
10:24:04 76182 outbytes=8 error=0
10:24:04 76182 Calling SSL_read(0x805223a80, 0x805237000, 4096)
10:24:04 76182 SMTP<< RCPT To:<test@smarthost.com>
Повторяясь, это происходит только в случае если адрес получателя находится в домене одноимённым с хостом отправителем (example.com).
Соответственно, вопрос - как отключить такое поведение.