procmail
[Top] [All Lists]

Re: ? test for DNS records

2006-06-16 08:49:47
Don Russell writes:
Primarily as a self-learning exercise, I'm writing a procmail script to 
look at the List-ID: header (RFC 2919)
(Ref: http://ietfreport.isoc.org/idref/rfc2919/)

I would like to do a DNS check for the list specified in this header. 
After parsing the field contents for the list ID to look up, I thought 
the following would work:

:0
*$ ? nslookup ${LISTID}
{
    dns records were found
}
:0 E
{
    dns records were not found (conclusion - fake list = spam/junk, or 
DNS server unavailable)
}

However, the :0 E clause is never executed, even if the command line 
nslookup fails with a "non-existant domain" message.

Any suggestions?
 
 I am unfamiliar with the specifics of this header, but I presume you
 are extracting a hostname from it? The header for this list, for example,
 does not contain a valid DNS host or domain name.

 nslookup is not a good tools for this. Try dig and parse/grep for an
 ;; ANSWER SECTION: or just the existance of it.



____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>