Настраивать 'sendmail' заголовков для заданий крона (crontab-user@mydomain.xyz)

Я использую Ubuntu 14 на AWS EC2. У меня есть некорневой пользователь crontab. После завершения задания крона электронное письмо к MAILTO адрес, как начато crontab. Почтовый отправитель похож на это:
root@ip-111-11-0-11.us-east-1.compute.internal

Как может я изменяться "от" электронной почты до также:

  • crontab-username@my-domain.com или
  • do-not-reply@my-domain.com ?

РЕДАКТИРОВАНИЕ 1: После внесенных комментариев я выполнился telnet localhost 25 в терминале и возвратился:

220 ip-111-11-0-11.us-east-1.compute.internal ESMTP Sendmail 8.14.4/8.14.4/Debian-4.1ubuntu1
Tue, 5 Jul 2016 13:38:31 GMT
(No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1]

Таким образом, мой MTA sendmail, и мой вопрос становится:

Как я настраиваю sendmail, таким образом, мои почтовые заголовки заданий крона как выше?

2
задан 6 July 2016 в 05:06

1 ответ

man 5 crontab решит Вашу проблему. Это говорит, частично:

An  active line in a crontab will be either an environment setting or a
   cron command.  An environment setting is of the form,

       name = value

   where the spaces around  the  equal-sign  (=)  are  optional,  and  any
   subsequent  non-leading  spaces  in  value  will  be  part of the value
   assigned to name.  The value string may be placed in quotes (single  or
   double, but matching) to preserve leading or trailing blanks.

   Several   environment   variables  are  set  up  automatically  by  the
   bcron-exec(8) program.  SHELL is set to /bin/sh, and LOGNAME, USER, and
   HOME are set from the /etc/passwd line of the crontab's owner.

   In  addition to LOGNAME, USER, HOME, and SHELL, bcron-exec(8) will look
   at MAILTO if it has any reason to send mail  as  a  result  of  running
   commands  in  ``this''  crontab.  If MAILTO is defined (and non-empty),
   mail is sent to the user so named.  If  MAILTO  is  defined  but  empty
   (MAILTO=""), no mail will be sent.  Otherwise mail is sent to the owner
   of the crontab.  This option is  useful  if  you  decide  on  /bin/mail
   instead  of  /usr/lib/sendmail  as your mailer when you install cron --
   /bin/mail doesn't do aliasing, and UUCP usually doesn't read its mail.
0
ответ дан 6 July 2016 в 05:06
  • 1
    Попытайтесь узнать. То, что Вы думаете, является " good" я мог бы жаждать бросить вниз от 6-го этажа;-) – Rinzwind 30 January 2018 в 03:56

Другие вопросы по тегам:

Похожие вопросы: