divert(-1) # #` Prepared by Peter Barnard @ ASC WEB Limited, U.K.' #` peterb@ascweb.co.uk ' # #` Inspired by www.harker.com/sendmail/copyuser.html ' # #` For sendmail switch 8.10.0 the file needs to be' #` /usr/local/sendmail/smmta-8.10.0/cf/hack/mail-logger.m4' # #` Include in the main config using' #` HACK(mail-logger)' #` With smadmin this is the Custom Local Configuration box.' # #` Make a copy of all incoming and outgoing mail to "confMAIL_LOGGER_MAILBOX".' #` Operates by hooking into rule set 0 and recursively calling' #` sendmail to resend the mail to the original recipient and' #` the local archive. The recursion is broken by defining a macro' #` that will not match any mail address, thus preventing the next' #` recursive call.' # dnl divert(0) dnl VERSIONID(`$Id: mail-logger-devel.m4,v 8.12 2002/12/22 19:10:00 corvax Exp $') dnl divert(-1) dnl ifdef(`_CHECK_ENVELOPE_INIT_',,`HACK(`precheck-envelope')') ifdef(`_CHECK_ADDRESSES_INIT_',,`HACK(`precheck-addresses')') dnl divert(0) LOCAL_CONFIG Kstorage macro D{DONT_LABEL}.DONTCOPY H?${COPYING}?X-Privacy-Violation: The copy of this message was sent to due to business requirements $b LOCAL_RULESETS SLocal_check_rcpt R $* $: $(storage {DONTCOPY} $) $1 R $* $: $(storage {COPYING} $) $1 HX-Privacy-Violation: $>X_Privacy_Violation SX_Privacy_Violation R $* $: $(storage {DONTCOPY} $@ ${DONT_LABEL} $) $1 LOCAL_RULE_0 R $+ $: < $&{DONTCOPY} > $1 R < > $+ < @ $+ ${CP} > $* $#copymail $@ mail-logger $: $1 < @ $2 > $3 $(storage {COPYING} $@ YES $) R < $* > $+ $: $2 MAILER_DEFINITIONS #Mcopymail, P=/usr/lib/sendmail, F=fmSDFMu, # A=sendmail -N never -M{COPY}.NOCP -M{CHK}.NOCHK confMAIL_LOGGER_MAILBOX $u Mcopymail, P=/usr/lib/sendmail, F=fmSDFMu, A=sendmail -M{CP}.NOCP -M{CHK}.NOCHK confMAIL_LOGGER_MAILBOX $u