如何configurationsendmail以保留我发送的任何消息的副本。 一个选项是自动发送一个副本回我的箱子。
1创build文件$ {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
5testing
检查语法如下
即“ TAB HERE ”
R$* < @ $+ . $~{CP} . >"**TAB HERE**"$#copymail $@ $2 . $3 . ${COPYMAIL} $: $1 @ $2 . $3 . ${COPYMAIL} # if mail has been processed by copymail mailer, process it usual way... R$* < @ $* . ${COPYMAIL} >"**TAB HERE**"$1 < @ $2 . >