I received e-mails from Arrigo Triulzi and Martin Mokrejs
The suggestion is to use sendmail 8.9.1.
I guess I am the only one with older version. I can't find the time to do it.
The DU4.0E comes with sendmail 8.8.8 as a supported product. So I thought that's the easiest and fastest way is to install 4.0E.
I was wrong.
I got sendmail configured and running using mailsetup/mailconfig. There was no config option to disallow third party relay.
So I access www.sendmail.org to get some hints/solutions.
None of them worked. I guess sendmail.cf generated by COMPAQ is different.?!
Finally I contacted Claus Assmann, he sent me a corrected code. See below.
I still do not understand why COMPAQ could not include this feature in its setup. RedHat Linux 5.2 (freeware?) comes with sendmail 8.8.8 and with custom anti-relay custom code.
Here is the code:
Scheck_rcpt
# first: get client addr
R$+ $: $(dequote "" $&{client_addr} $) $| $1
R0 $| $* $@ ok no client addr: directly invoked
R$={LocalIP}$* $| $* $@ ok from here
# 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
instead (removed the trailing dots in removelocal).