【问题标题】:mailx not working but sendmail is workingmailx 不工作,但 sendmail 工作
【发布时间】:2018-12-19 06:11:14
【问题描述】:

最近我的生产服务器升级了。之后我们的mailx 命令不起作用。它正在发送没有附件的邮件,然后邮件中有垃圾字符。 错误是这样的。

Hello Team,

Please find the attached list of files which have been purged.

Regards,
Axiom Tech Support
begin 644 purge_files_2018-07-07.log.gz
M'XL("&,005L``W!U<F=E7V9I;&5S7S(P,3@M,#<M,#<N;&]G`-2=6V^<-Y*&
M[^=7]/4"M'DF*W>)DVQF,3/Q1@[V8K!H%,DJ6[`L"9*3&<^OGY=JM91(:K5R
ML=W?.@8LRVZ#1=;A>8N'_-V6U_CIK:LKE[ZR^&G_]ZO5R6>Y7+GY*U]]7OUR
MN;K0U>4O5^]E/?@SK\?IU?6KC]<?_O0?__<__K2Z^>_OSPS4?[5ZB\&=GK]?
MG7S]=C6'N%*1<;VZ.!MRM?K\@<]7KEK\R9?K`XWYN?&&^_&^.?EI&>/=,<?N
MJ3'_\.-//Y_\_QAVO!_VG_]V\N[KO[WY;O7?[WY:_=>/WYS<#EY/SV1AGO+4
MK/_YAS?+F?(_,.UG%^^?F.)TN!&_YLO+Z]?\S].+3VM\N?FJO,:XKE]?R]6O

现有的命令就像

uuencode purge_files_2018-07-07.log.gz  purge_files_2018-07-07.log.gz   | mailx "Subject:Purge file";echo -e "\nHello Team,\n\nPlease find the attached list of files which have been purged -s onkar.tiwar90@gmail.com

现在我用

替换了它
echo "Subject:Purge file";echo -e "\nHello Team,\n\nPlease find the attached list of files which have been purged.\n\nRegards,\nAxiom Tech Support";/usr/bin/uuencode purge_files_2018-07-07.log.gz purge_files_2018-07-07.log.gz)|/usr/sbin/sendmail -t "onkar.tiwar90@gmail.com"

所以我的问题是为什么mailx 不工作但sendmail 工作。实际上我将不得不更改多个脚本,所以我正在寻找解决方案。

【问题讨论】:

    标签: shell email unix mailx uuencode


    【解决方案1】:

    Mailx 升级将其切换为使用 MIME 作为邮件内容而不是纯文本。您的电子邮件客户端无法识别 MIME 中的 uuencoded 内容。

    你可以停止使用uuencode并切换到

    mailx -a <filename>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-02-12
      • 1970-01-01
      • 1970-01-01
      • 2016-09-18
      • 1970-01-01
      • 1970-01-01
      • 2017-06-26
      • 1970-01-01
      相关资源
      最近更新 更多