加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

sendmail – 如何再次发送/ var / mail / root?

发布时间:2020-12-13 18:10:52 所属栏目:Linux 来源:网络整理
导读:通过一些配置错误,我在/ var / mail / root和/ var / mail / www-data中发了很多电子邮件 如何“循环”这些文件并再次发送每封邮件? 解决方法 formail,procmail的一部分(可能已在您的系统上可用)可以获取邮箱,将其拆分为消息,然后在每个邮箱上运行命令.从手
通过一些配置错误,我在/ var / mail / root和/ var / mail / www-data中发了很多电子邮件

如何“循环”这些文件并再次发送每封邮件?

解决方法

formail,procmail的一部分(可能已在您的系统上可用)可以获取邮箱,将其拆分为消息,然后在每个邮箱上运行命令.从手册页:
-s   The input will be split up into separate mail messages,and  piped
        into  a  program  one  by  one (a new program is started for every
        part).  -s has to be the last option specified,the first argument
        following  it  is  expected to be the name of a program,any other
        arguments will be passed along to it.  If you  omit  the  program,then  formail  will  simply  concatenate the split mails on stdout
        again.  See FILENO.

所以你可以做我想你想要的事情:

formail -s /usr/sbin/sendmail -oi -t < /var/mail/root

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读