I decided to post a sendmail 8.10 rules for conditional
relay selection based on number of delivery attempts
and message size.
I think the rules may be useful for sites with less
than excellent internet connection.
Any comments are welcomed!
P.S.
The final version will contain a nice m4 macro
like:
SMARTER_HOST(ntries,size,mailer:host)
--------------------------------------------------
The lines below are needed in *.mc file to:
* make arith map available in sendmail.cf
* define SmartToTriple rule set
DO NOT FORGET TO PUT TAB (\t) BEFORE $:
---------->
LOCAL_CONFIG
# Make arith database available
Karith arith
LOCAL_RULESETS
SSmartToTriple
# if you see more then 3 lines below than line break occurred
R<$-:$-> <$+> $* $: <$(arith l $@ $&{ntries} $@ $1 $) : $(arith l
$@ $&{msg_size} $@ $2 $)>
<$3> $4
R<FALSE:FALSE> <$+> $* $: $>MailerToTriple <$1> $2
R<$*:$*><$+>$* $: $4
<----------
Sample use:
DO NOT FORGET TO PUT TAB (\t) BEFORE $:
---------->
LOCAL_NET_CONFIG
# send messages bigger than 1MB via uucp
R$* $: $>SmartToTriple <0:1000000> <uucp-dom:uucp-node> $1
# send messages bigger than 50KB via uucp after first delivery attempt
R$* $: $>SmartToTriple <1:100000> <uucp-dom:uucp-node> $1
# after 3 delivery attempts send messages via uucp
R$* $: $>SmartToTriple <3:0> <uucp-dom:uucp-node> $1
<----------
--------------------------------------------------
Possible use scenarios:
* send big messages via smart host (your ISP), send small
messages directly.
* select dsmtp mailer for huge messages and use another
sendmail.cf to deliver the messages during off peak hours
* after a few delivery attempt send to smart host (your ISP)
--
Andrzej (Andrew) A. Filip http://bigfoot.com/~anfi
an...@bigfoot.com an...@polbox.com an...@sdf.lonestar.org
Postings: http://deja.com/profile.xp?author=Andrzej%20Filip