使用默认发件人和收件人地址发送带有crontab的邮件

使用默认发件人和收件人地址发送带有crontab的邮件,cron,sendmail,Cron,Sendmail,当我运行sendmail时,crontab会在mail.log中的日志下面显示 2020-07-17T02:50:12.431886-07:00 localhost postfix/qmgr[1371]: 681EC1FFEF: from=<nramasurbramanian@localhost>, size=777, nrcpt=1 (queue active) 2020-07-17T02:50:12.435570-07:00 localhost postfix/local[269

当我运行sendmail时,crontab会在mail.log中的日志下面显示

2020-07-17T02:50:12.431886-07:00 localhost postfix/qmgr[1371]: 681EC1FFEF: from=<nramasurbramanian@localhost>, size=777, nrcpt=1 (queue active)
2020-07-17T02:50:12.435570-07:00 localhost postfix/local[26936]: 681EC1FFEF: to=<nramasurbramanian@localhost>, orig_to=<nramasurbramanian>, relay=local, delay=0.03, delays=0.02/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
2020-07-17T02:50:12.435720-07:00 localhost postfix/qmgr[1371]: 681EC1FFEF: removed
2020-07-17T02:50:12.431886-07:00本地主机后缀/qmgr[1371]:681EC1FFEF:from=,size=777,nrcpt=1(队列活动)
2020-07-17T02:50:12.435570-07:00本地主机后缀/本地[26936]:681EC1FFEF:to=,orig_to=,relay=local,delay=0.03,delays=0.02/0/0,dsn=2.0.0,status=sent(发送到邮箱)
2020-07-17T02:50:12.435720-07:00本地主机后缀/qmgr[1371]:681EC1FFEF:已删除
和我在命令行中正常运行时一样,它工作正常,如下所示

2020-07-17T02:51:17.838476-07:00 localhost postfix/qmgr[1371]: CC8291FFEF: from=<support@test.com>, size=2239, nrcpt=1 (queue active)
2020-07-17T02:51:19.016735-07:00 localhost postfix/smtp[27130]: CC8291FFEF: to=<in.support@test.com>, relay=aspmx.l.google.com[108.177.127.27]:25, delay=1.2, delays=0/0.02/0.76/0.4, dsn=2.0.0, status=sent (250 2.0.0 OK  1594979478 x17si5640395edq.338 - gsmtp)
2020-07-17T02:51:19.016905-07:00 localhost postfix/qmgr[1371]: CC8291FFEF: removed
2020-07-17T02:51:17.838476-07:00本地主机后缀/qmgr[1371]:CC8291FFEF:from=,size=2239,nrcpt=1(队列活动)
2020-07-17T02:51:19.016735-07:00本地主机后缀/smtp[27130]:CC8291FFEF:to=,relay=aspmx.l.google.com[108.177.127.27]:25,延迟=1.2,延迟=0/0.02/0.76/0.4,dsn=2.0.0,状态=sent(250 2.0.0.0正常1594979478 x17si5640395edq.338-gsmtp)
2020-07-17T02:51:19.016905-07:00本地主机后缀/qmgr[1371]:CC8291FFEF:已删除

从crontab运行时是否有默认配置?

在提供sendmail/usr/sbin/sendmail的绝对路径并在crontab中设置后,该配置工作正常