linux – 配置sendmail以存档任何传出消息的副本

前端之家收集整理的这篇文章主要介绍了linux – 配置sendmail以存档任何传出消息的副本前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
如何配置sendmail以保留我发送的任何邮件的副本.一个选项是自动将副本发送回我的盒子.

解决方法

1创建文件${CFDIR} /mailer/copymail.m4:
PUSHDIVERT(-1)

ifdef(`COPYMAIL_MAILBox',`define(`COPYMAIL_MAILBox',`postmaster')')dnl
POPDIVERT

#########################################
###   COPYMAIL Mailer specification   ###
#########################################

VERSIONID(`$Id: cpsendmail.html,v 1.2 2002/06/14 18:39:10 freeman Exp $')dnl

LOCAL_CONFIG
D{COPYMAIL}COPYMAIL
C{CP}${COPYMAIL}

LOCAL_RULE_0
# Send all mail to copymail mailer
R$* < @ $+ . $~{CP} . >     $#copymail $@ $2 . $3 . ${COPYMAIL} $: $1 @ $2 . $3 . ${COPYMAIL}
# if mail has been processed by copymail mailer,process it usual way...
R$* < @ $* . ${COPYMAIL} >  $1 < @ $2 . >

# Send message to original recipient + additional mailBox: COPYMAIL_MAILBox
Mcopymail,P=/usr/sbin/sendmail,F=fmSDFMu,S=0,R=0,A=sendmail -N never COPYMAIL_MAILBox.${COPYMAIL} $u

2添加到结束sendmail.mc

define(`COPYMAIL_MAILBox',`user@domen')
MAILER(copymail)

3编译并安装新的sendmail.mc

4重新启动sendmail

5测试

猜你在找的Linux相关文章