简体   繁体   English

mailx不起作用,但sendmail起作用

[英]mailx not working but sendmail is working

Recently my production server has been upgraded. 最近,我的生产服务器已升级。 after that our mailx command is not working. 之后,我们的mailx命令不起作用。 it is sending the mail without attachment and then there is junk character in mail. 它发送的邮件没有附件,然后邮件中有垃圾字符。 error is like. 错误就好。

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

the existing command was like 现有的命令就像

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

now I have replaced it with 现在我已经用

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"

So my question is why mailx is not working but sendmail is working. 所以我的问题是为什么mailx不起作用而sendmail起作用。 actually i will have to change in multiple scripts so I am seeking the solution. 实际上,我将不得不更改多个脚本,因此我正在寻找解决方案。

Mailx upgrade switched it to use MIME as mail content instead of plain text. Mailx升级将其切换为使用MIME代替纯文本作为邮件内容。 Your email client does not recognise uuencoded content within MIME. 您的电子邮件客户端无法识别MIME中的uuencoded内容。

You can stop using uuencode and switch to 您可以停止使用uuencode并切换到

mailx -a <filename>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM