#!/bin/rc
<<<<<<< /mail/lib/validateaddress
# validateaddress
rfork e
switch($1){
case blue8.cs.bell-labs.com!* lax6.cs.bell-labs.com!* \
graceland.research.bell-labs.com!* \
dhcp9165.cs.bell-labs.com!* dhcp9158.cs.bell-labs.com!*
exit 'only spammers use this address'
}
outside=no
if(cmp -s /mail/lib/smtpd.conf /mail/lib/smtpd.conf.ext)
outside=yes
if(~ $1 bell-labs.com!* && ~ $outside yes){
echo '550-
'
echo '550- We''re the wrong gateway from the outside world for bell-labs.com,
'
echo '550- so this is probably spam.
'
echo '550-
'
exit 'wrong gateway'
}
if(~ $1 *.bell-labs.com!rsc && ~ $outside yes){
echo '550-
'
echo '550- I get too much spam sent to' $1'
'
echo '550- So now I only accept mail from inside Lucent.
'
echo '550-
'
echo '550- To email me, send mail directly to rsc@swtch.com.
'
echo '550-
'
echo '550- Sorry for the trouble.
'
echo '550-
'
exit 'too much spam'
}
# accept if there are any deliverable addresses in expansion, even if some aren't.
if(mail -x $1 | grep -vs '^unknown user')
exit ''
exit 'unknown user'
||||||| validateaddress.orig
mail -x $1 | grep -vs '^unknown user'
=======
mail -x $1 | grep -vs '^unknown user|^Invalid address'
>>>>>>> validateaddress
|