【问题标题】:Using mailx command not able to send email使用 mailx 命令无法发送电子邮件
【发布时间】:2014-05-27 07:04:12
【问题描述】:

我在我的脚本中使用 mailx 命令发送电子邮件,而 mailx 函数的行为很奇怪。至于一些 mailx 命令正在发送电子邮件,而其他命令则不是。 这是从脚本本身起作用的那个。

mailx -r MSAR_COPY -s "MSAR COPY - Error starting due to existence of ERRORFILE from previous run" $MAILLIST 

但是另一个没有触发电子邮件,所以我什至尝试简单地从 shell 发送电子邮件。这似乎也不起作用。

 va10puvfns001b(fnsw)/home/fnsw/bin/msar_copies> mailx -r MSAR_COPY -s "MSAR COPY -Error starting as FileNet is down" gaurav.pareek@wellpoint.com

  (Interrupt -- one more to kill letter)

一旦我在输入命令后点击输入,它就会开始计时,我需要在一段时间后手动使用 ctrl+c 将其杀死。然后我得到(中断 - 再杀死一个字母)的东西,我需要再次给出ctrl+c 进入提示。 任何想法为什么它不能一直工作?

这是调试模式下脚本的输出:

  • echo 所有 MSAR 文件系统都在使用中。当前使用的文件系统已满后,将不再有文件系统可用于复制 msar dat 文件。启动 尽快获取新文件系统的过程。
  • 1> /home/fnsw/bin/msar_copies/WARNFILE
    • mailx -r MSAR_COPY -s MSAR COPY - 所有文件系统都在使用中 filenet.admin@wellpoint.com
  • 0
  • cut -d -f2 /home/fnsw/bin/msar_copies/msar_fs.out
    • awk {print $1}
  • grep /msar21 /home/fnsw/bin/msar_copies/msar_fs.out 满=0
  • [[ 0 -gt 33544232 ]]
  • 标志=1
  • [[ 1 -eq 1 ]]
  • echo 退出,因为副本没有足够的可用空间
  • 1> /home/fnsw/bin/msar_copies/ERRORFILE
  • mailx -r MSAR_COPY -s MSAR COPY - 紧急错误 - 目标文件夹没有足够的空间。需要立即请求新的文件系统。 filenet.admin@wellpoint.com
  • 0
  • 退出 5

【问题讨论】:

    标签: shell email aix


    【解决方案1】:

    在挣扎了 2-3 个小时后,我才知道问题是由于某些 mailx 命令中的一些特殊字符造成的。

    我从脚本中删除了一些 mailx 行并重写了它们并运行了脚本。它现在工作正常。

    【讨论】:

      猜你喜欢
      • 2011-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-19
      • 1970-01-01
      • 2015-03-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多