Hi! On Mon, Oct 06, 2003 at 06:30:22PM +0300, Victor Forsyuk writes:
VNG> Не подскажете, как в sendmail'е разрешить релеинг для доменов, у VNG> которых все более приоритетные mx'ы находятся в определенном наборе VNG> сетей? VNG> Т.е. я хочу сделать smart relay, для всех моих сетей, чтобы VNG> не прописывать каждый домен по отдельности.
Заодно: а подобное для exim'а есть?
Есть. И выглядит вполне по-человечески :)
Мне в exim-users ответили, что такого нету, после чего пришлось наваять следующий acl: ======== acl_check_bestmx: # Return accept if primary MX for domain in $acl_m3 is in relayed-bestmx # 1. Find primary MX preference and save it in $acl_m4 # Allways pass through this rule deny set acl_m3 = ${lookup dnsdb{mx=$acl_m3}} set acl_m4 = -1 set acl_m5 = 1 acl = acl_bestpref deny condition = ${if >{$acl_m5}{16}{yes}{no}} # 2. Check all MX's with best priority with dbm accept set acl_m5 = 1 acl = acl_mx_loop deny acl_bestpref: # End of recursion: # $acl_m6 = $acl_m3[$acl_m5] deny set acl_m6 = ${extract{$acl_m5}{\n}{$acl_m3}} condition = ${if eq{$acl_m6}{}{yes}{no}} deny condition = ${if >{$acl_m5}{16}{yes}{no}} deny # acl_m4 = min($acl_m4, $1) if $acl_m3 =~ /^\d+/ set acl_m6 = ${extract{1}{ }{$acl_m6}} set acl_m4 = ${if ={$acl_m4}{-1}{$acl_m6}{$acl_m4}} set acl_m4 = ${if <{$acl_m4}{$acl_m6}{$acl_m4}{$acl_m6}} set acl_m5 = ${eval:$acl_m5+1} acl = acl_bestpref deny acl_mx_loop: # End of recursion: # $acl_m6 = $acl_m3[$acl_m5] deny set acl_m6 = ${extract{$acl_m5}{\n}{$acl_m3}} condition = ${if eq{$acl_m6}{}{yes}{no}} # acl_m4 = min($acl_m4, $1) if $acl_m3 =~ /^\d+/ accept condition = ${if ={${extract{1}{ }{$acl_m6}}}{$acl_m4}{yes}{no}} condition = ${if eq{${lookup{${extract{2}{ }{$acl_m6}}}dbm{/etc/exim/relayed-bestmx.db}}}{}{no}{yes}} accept condition = ${if ={${extract{1}{ }{$acl_m6}}}{$acl_m4}{yes}{no}} set acl_m6 = ${lookup dnsdb{a=${extract{2}{ }{$acl_m6}}}} set acl_m7 = 1 acl = acl_check_mx_ip accept set acl_m5 = ${eval:$acl_m5+1} acl = acl_mx_loop deny acl_check_mx_ip: # IP list is in $acl_m6 # Counter is in $acl_m7 # check all of its by relayed-bestmx deny condition = ${if eq{${extract{$acl_m7}{\n}{$acl_m6}}}{}{yes}{no}} accept condition = ${if eq{${lookup{${extract{$acl_m7}{\n}{$acl_m6}}}dbm{/etc/exim/relayed-bestmx.db}}}{}{no}{yes}} deny condition = ${if >{${eval:$acl_m7+$acl_m5}}{15}{yes}{no}} accept set acl_m7 = ${eval:$acl_m7+1} acl = acl_check_mx_ip deny ======== -- Lucky carrier, Паша. =================================================================== uanog mailing list. To Unsubscribe: send mail to majordomo@uanog.kiev.ua with "unsubscribe uanog" in the body of the message