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

通过一些配置错误,我在/ 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

相关文章

/etc/sysctl.conf这个目录主要是配置一些系统信息,/etc/sys...
1.作用 useradd或adduser命令用来建立用户帐号和创建用户的起...
它们都是多模式编辑器,不同的是vim 是vi的升级版本,它不仅...
不管是我们在安装软件还是监测软件的使用性能,我们都要随时...
装好Tomcat7后,发现除了本机能访问外界访问不了,岂有此理。...
修改防火墙配置需要修改 /etc/sysconfig/iptables 这个文件,...