divert(-1) # # Copyright (c) 2003, 2004 Victor Ustugov # This hack is under BSD License # Redistributions of source code must retain the above copyright notice # # hacks disscussion's maillist - http://www.mta.org.ua/mailman/listinfo/sendmail-conf # # divert(0) VERSIONID(`$Id: cfhead.m4,v 8.12-0.02 2004/07/29 15:19:49 corvax Exp $')dnl divert(-1) dnl dnl LOCAL_CONFIG dnl dnl define(`_FEEDBACK_MSG_', `ifelse(len(X`'_ARG_),`1',`" - If you have any questions please email postmaster@$j"', " - "`'_ARG_)')dnl dnl D{Feedback_Msg}`'_FEEDBACK_MSG_ D{SpamMsg}we do not want to receive spam messages dnl dnl find substring `$2' in string `$1' define(`ifelse_strstr',`define(`_STR_INDEX_',`index(`$1',`$2')')`'define(`_IS_SET_',`eval(_STR_INDEX_ >= 0)')`'ifelse(_IS_SET_,`1',`$3',`$4')') dnl dnl repeat `$2' string `$3' times and append it to `$1' string define(`repeat_str',`ifelse($3,`1',$1$2,`repeat_str($1$2,$2,eval($3-1))')') dnl dnl delete all spaces from a string $1 if they are there define(`del_spaces', `define(`_STR_INDEX_',`index(`$1',` ')')`'define(`_IS_SET_',`eval(_STR_INDEX_ >= 0)')`'ifelse(_IS_SET_,`1',`del_spaces(_DELCHAR_($1, ` '))',`$1')') dnl Klog syslog Kmacro macro Karith arith # map for DNS based lookups Kdns_a dns -R A -a. -T -r`'ifdef(`EDNSBL_TO',`EDNSBL_TO',`5') Kdns_ptr dns -R PTR -a. -T -r`'ifdef(`EDNSBL_TO',`EDNSBL_TO',`5') Kdns_txt dns -R TXT -a. -T -r`'ifdef(`EDNSBL_TO',`EDNSBL_TO',`5') Kmxserved_best bestmx -T Kmxserved bestmx -z: -T # # Regular expression to reject: # * connections from dial-up/dsl/cable networks # # Kdulpat01 regex -a@MATCH ^(.+\.)*(.*dsl|dial-*(up|in)|ppp|ts|[dhc])-*[0-9A-Fa-f-]+[.-] # Kdulpat01 regex -a@MATCH ^(.*cable|host|ip|dyn-*ip|cpe|modem|pool|cable|dhcp|.*dsl|dial-*(up|in)|ppp|pppoe|d|user)-*[0-9A-Fa-f-]+[\.-] Kdulpat01 regex -a@MATCH ^(.+\.)*(.*dsl|pool-|dial-*(up|in)|ppp)-*[0-9A-Fa-f-]+[.-] #Kdulpat02 regex -a@MATCH ^(.+\.)*(adsl|dsl|dhcp|cable|dslam|user|client|pool|subnet|network)(\.|-|[0-9]|_) Kdulpat02 regex -a@MATCH (dial|dialup|adsl|dsl|dhcp|dyn|ip|ipt|ppp|cable|dslam|user|client|pool|subnet|network)(\.|-|[0-9]|_) Kdulpat03 regex -a@MATCH ^(.+[\.\-])?(adsl|cable|client|dhcp|dial|dial-in|dial-up|dialup|dsl|dyn|dynamic|dyndsl|pool|ppp|user|xdsl)[\.\-_0-9].+ Kdulpat sequence dulpat01 dulpat02 dulpat03 # # Regular expression to reject (in MAIL FROM and RCPT TO fields): # * numeric-only (possible "-") localparts from geocities.com # * numeric-only localparts from aol.com and msn.com # * localparts starting with a digit from juno.com # * localparts longer than 20 characters from aol.com # Kcheckaddress_canonified regex -a@MATCH ^([0-9\-]+<@geocities\.com|[0-9]+<@(aol|msn)\.com|[0-9][^<]*<@juno\.com|.{20}[^<]+<@aol\.com)\.?> # # Regular expression to reject the same addresses but in FROM and TO fields: # dnl Kcheckaddress regex -a@MATCH ^([0-9\-]+@geocities\.com|[0-9]+@(aol|msn)\.com|[0-9][^@]*@juno\.com|.{20}[^@]+<@aol\.com) Kcheckaddress regex -a@MATCH ^.*? # # Regular expression to reject: # * numeric-only mailboxes # Kallnumbers regex -a@MATCH ^[0-9]+$ Kallnumbersdots regex -a@MATCH ^[0-9]+[0-9\._]+[0-9]+$ LOCAL_RULESETS ###################################################################### ### ### use Translate rule for checking relays and check_compat: ### Translate,checkrelay zuka.ru.ru $| 1.2.3.4 ### Translate,check_compat sender@address.tld $| recipient@address.tld ### ###################################################################### STranslate R $* $$| $* $: $1 $| $2 dnl ###################################################################### ### AdvD: AdvLookUpDomain -- search for domain in access database ### ### Parameters: ### <$1> -- key (domain name) ### <$2> -- default (what to return if not found in db) ### <$3> -- mark (must be <(!|+) single-token>) ### ! does lookup only with tag ### + does lookup with and without tag ### <$4> -- passthru (additional data passed unchanged through) ### <$5> -- found key (domain name) ###################################################################### SAdvD R<$*> <$+> <$- $-> <$*> $: < $(access $4:$1 $: ? $) > <$1> <$2> <$3 $4> <$5> R <$+> <$+> <+ $-> <$*> $: < $(access $1 $: ? $) > <$1> <$2> <+ $3> <$4> R <[$+.$-]> <$+> <$- $-> <$*> $@ $>AdvD <[$1]> <$3> <$4 $5> <$6> R <[$+::$-]> <$+> <$- $-> <$*> $: $>AdvD <[$1]> <$3> <$4 $5> <$6> R <[$+:$-]> <$+> <$- $-> <$*> $: $>AdvD <[$1]> <$3> <$4 $5> <$6> R <$+.$+> <$+> <$- $-> <$*> $@ $>AdvD <$2> <$3> <$4 $5> <$6> R <$+> <$+> <$- $-> <$*> $@ <$2> <$5> <$1> R<$* > <$+> <$+> <$- $-> <$*> $@ <> <$6> <$2> R<$*> <$+> <$+> <$- $-> <$*> $@ <$1> <$6> <$2>