procmail
[Top] [All Lists]

Re: Verify Mail Has Valid 'From:' Field?

1998-01-12 02:01:05
Thu 97-12-18 rsr(_at_)macromedia(_dot_)com list.procmail
| Has anyone figured out how to do a sanity check on mail to make
| sure it's coming from a valid domain name? I'm thinking of
| something that would

IMO, bad idea. 
a) The address may be down or inaccessible, so you
   can't get 100% assurance.
b) It takes lot of time for _each_ mail if you try to do even nslookup,
   the call may block for several seconds. --> your other messages 
   are stuck until the domain is resolved or your mailsystem forks procmail
   processes like crazy (It depends if you has "w" flag or not in a recipe)
c) It's a known fact that it's impossible to verify the existense of an
   email address. (That has been discussed to boredom in news and always
   the results is zero: you can't do that reliable enough)

| A) Take the 'From:' line;
| B) Strip out everything but the TLD (rsr(_at_)host(_dot_)macromedia(_dot_)com 
->
| macromedia.com)
| C) Verify that the TLD is valid

jari