diff --git a/etc/mail/sendmail.cf.additions b/etc/mail/sendmail.cf.additions index 0921b96cc21b..42305a8656b4 100644 --- a/etc/mail/sendmail.cf.additions +++ b/etc/mail/sendmail.cf.additions @@ -100,15 +100,23 @@ R$+.REJECT $#error $@ 5.2.1 $: 550 $1 R<$*> $* $: $1 # mail must NOT be addressed "fakenames"--END # mail must come from or go to this machine or machines we allow to relay--BEGIN -# R$* $: $>Parse0 $>3 $1 -# R$+ < @ $* . > $* $: $1 < @ $2 > -# R$+ < @ $=w> $@ OK -# R$+ < @ $* $=R> $@ OK -# R$* $: $(dequote "" $&{client_name} $) -# R$=w $@ OK -# R$* $=R $@ OK -# R$@ $@ OK -# R$* $#error $@ 5.7.1 $: "550 Relaying Denied" +# from http://www.informatik.uni-kiel.de/%7Eca/email/check.html#check_rcpt +R$+ $: $(dequote "" $&{client_addr} $) $| $1 +R0 $| $* $@ ok +R$={LocalIP}$* $| $* $@ ok +# not local, check rcpt +R$* $| $* $: $>3 $2 +# remove local part, maybe repeatedly +R$+ $:$>removelocal $1 +# still something left? +R$*<@$+>$* $#error $@ 5.7.1 $: 550 we do not relay +# +Sremovelocal +# remove RelayTo part (maybe repeatedly) +# R$*<@$*$={RelayTo}.>$* $>3 $1 $4 +R$*<@$=w.>$* $: $>removelocal $>3 $1 $3 +R$*<@$*>$* $@ $1<@$2>$3 +# dequote local part +R$- $: $>3 $(dequote $1 $) +R$*<@$*>$* $: $>removelocal $1<@$2>$3 # mail must come from or go to this machine or machines we allow to relay--END -R$* $@ OK -