Назад | Перейти на главную страницу

sendmail Из пустого при ретрансляции

При отправке почты авторизовался как ec2-user неизвестному пользователю:

echo "Subject: test" | /usr/lib/sendmail -v abc

в From:<> пусто при перенаправлении на псевдоним пользователя ec2, который заставляет внешний сервер отклонять почту. Даже установка -f "ec2-user@internal" не исправляет.

Внутри моего /etc/aliases у меня есть

root:     webmaster@external
ec2-user: webmaster@external

Подробный вывод отображает следующее:

abc... Connecting to [127.0.0.1] via relay...
220 internal ESMTP Sendmail 8.14.4/8.14.4; Thu, 24 Mar 2016 16:42:37 GMT
>>> EHLO internal
250-internal Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<ec2-user@internal> SIZE=14
250 2.1.0 <ec2-user@internal>... Sender ok
>>> RCPT To:<abc@internal>
>>> DATA
550 5.1.1 <abc@internal>... User unknown
503 5.0.0 Need RCPT (recipient)
>>> RSET
250 2.0.0 Reset state
>>> RSET
250 2.0.0 Reset state
ec2-user... Using cached ESMTP connection to [127.0.0.1] via relay...
>>> MAIL From:<> SIZE=1038
250 2.1.0 <>... Sender ok
>>> RCPT To:<ec2-user@internal>
>>> DATA
250 2.1.5 <ec2-user@internal>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 u2OGgbZL022963 Message accepted for delivery
ec2-user... Sent (u2OGgbZL022963 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 internal closing connection

Когда я отправляю письмо известному пользователю, например, ec2-user или root, письмо получено.

Как мне настроить sendmail установить From адрес при ретрансляции таким образом?

Хорошо - это на самом деле связано с политикой отказов

5.2.9 Command Syntax: RFC-821 Section 4.1.2 

The syntax shown in RFC-821 for the MAIL FROM: command omits the case of an empty path: "MAIL 
FROM: <>" (see RFC-821 Page 15). An empty reverse path MUST be supported. 

5.3.3 Reliable Mail Receipt 
....... 
If there is a delivery failure after acceptance of a message, the receiver-SMTP MUST formulate 
and mail a notification message. This notification MUST be sent using a null ("<>") reverse 
path in the envelope; see Section 3.6 of RFC-821. The recipient of this notification SHOULD be 
the address from the envelope return path (or the Return-Path: line). However, if this address 
is null ("<>"), the receiver-SMTP MUST NOT send a notification. If the address is an explicit 
source route, it SHOULD be stripped down to its final hop.

Также на WIKI

Bounce messages in SMTP are sent with the envelope sender address <>, known as the null sender address.

https://en.wikipedia.org/wiki/Bounce_message