Изменить отправителя sendmail с помощью bash - PullRequest
16 голосов
/ 16 сентября 2011

Выполнение команды sendmail. Обычно я получаю письма с отправителем, например username@hostname.

. Есть ли способ отправки писем с использованием sendmail, если для отправителя задано значение, отличное от учетной записи пользователя, используемой для запуска команды??

1 Ответ

34 голосов
/ 16 сентября 2011

То, что вы ищете, это -f:

sendmail -F "Your name" -f "your-address@example.com" < your-message.txt

со страницы руководства sendmail :

 -Ffullname  Set the full name of the sender.

 -fname      Sets the name of the ``from'' person (i.e., the sender of the
             mail).  -f can only be used by ``trusted'' users (normally
             root, daemon, and network) or if the person you are trying to
             become is the same as the person you are.
...