divert(-1) # # Copyright (c) 2002 Professional Software Engineering. # All rights reserved. # # By using this file, you agree to hold the author and it's agents harmless. # # The rules provided herein are intended only to demonstrate the basic # functionality of procmail as a sendmail rule-invoked mailer. # # # ifelse(defn(`_ARG_'), `', ifdef(`PROCMAIL_MAILER_PATH', PROCMAIL_MAILER_PATH, `/usr/local/bin/procmail'), _ARG_)) divert(0) VERSIONID(`$Id: procmailhandler.m4,v 8.12 2002/02/01 12:58:08 sbs Exp $') MAILER(`procmail', PROCMAIL_MAILER_PATH)dnl LOCAL_RULE_0 R$* $: $>ProcmailHandler $1 # procmail filtering LOCAL_RULESETS SProcmailHandler # Following three lines are from Adrezej Filip on comp.mail.sendmail 20030412 # This allows sendmail to ignore the hack when it processes newaliases R$* $: <${opMode}> $1 R<i>$* $@ $1 R<$*>$* $: $2 # parse for local users (single token, no domain) # note that depending upon where you place the hook for this ruleset, # this may occur before or after sendmail expands aliases which may # resolve an apparent local delivery to a remote address - place your # hook as you see fit. R$- .procmail $@ $1 # procmail has already looked at this R$- $#procmail $@/etc/procmailrcs/outbound.rc $: $1 . procmail # invoke procmail # parse for canonical domains # (resolved domains will have a dot trailing the domain name) R$* < @ $+ .procmail > $@ $1 < @ $2 . > # procmail has already looked at this. R$* < @ $+ . > $#procmail $@/etc/procmailrcs/outbound.rc $: $1 < @ $2 .procmail > # invoke procmail # parse for non-resolveable canonical domains # (unresolved domains will NOT have a dot trailing the domain name) R$* < @ $+ .xprocmail > $@ $1 < @ $2 > # procmail has already looked at this. R$* < @ $+ > $#procmail $@/etc/procmailrcs/outbound.rc $: $1 < @ $2 .xprocmail > # invoke procmail # other examples would include filtering for a specific user address or # hostname/domain or inbound vs. outbound. Handle more specific cases FIRST. divert(0)