old-www/LDP/LG/issue29/tag_procmail.html

166 lines
6.9 KiB
HTML

<!--startcut ======================================================= -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<META NAME="generator" CONTENT="lgazmail v1.1pre6">
<TITLE>The Answer Guy 29: Automated Handling for MAILER-DAEMON Messages</TITLE>
</head>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#A000A0"
ALINK="#FF0000">
<!--endcut ========================================================= -->
<H4>"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>
<P> <hr> <P>
<!-- =============================================================== -->
<H1 align="center"><A NAME="answer">
<img src="../gx/dennis/qbubble.gif" alt="" border="0" align="middle">
<a href="./index.html">The Answer Guy</a>
<img src="../gx/dennis/bbubble.gif" alt="" border="0" align="middle">
</A></H1> <BR>
<H4 align="center">By James T. Dennis,
<a href="mailto:linux-questions-only@ssc.com">linux-questions-only@ssc.com</a><BR>
Starshine Technical Services,
<A HREF="http://www.starshine.org/">http://www.starshine.org/</A> </H4>
<p><hr><p>
<H3><img src="../gx/dennis/qbub.gif" alt="(?)" width="50" height="28"
align="left" border="0">Automated Handling for MAILER-DAEMON
Messages</H3>
<h4 align="center">Read the Sources, Luke.</h4>
<p><strong>From Adrian Lattke on 28 Apr 1998
<br><br>
Mr.Dennis:
<br><br>
I must conratulate you. I found your page on
"<a href="../issue14/procmail.html">Procmail Mini-Tutorial:
Automated Mail Handling</a>" extremely useful. You
see, I was browsing the web in search for a program that will filter Mailer
Daemon bouncebacks. Would you happen to know, if there is any way, from a
<tt>perl</tt> script, to determine if an email address is valid? Or, how
exactly should I configure <tt>procmail</tt> and its files to filter daemons
into a directory? What I want to say is, do you know of any program with a
set of rules for identifying a bounceback, and extracting the address that it
bounced from, appending it to a file?
<br><br>
Thank you very much for your help,
<br>Adrian Lattke
</strong></p>
<blockquote><img src="../gx/dennis/bbub.gif" width="50" height="28" alt="(!)"
align="left" border="0">
There is
<a href="http://www.cbi.tamucc.edu/~duff/perl/pod/perlfaq8.html#How_do_I_check_a_valid_email_add">no way to determine</a>
if an address is "valid" in the
sense that it really leads to someone's inbox, other than
sending them mail and getting a response. Anything else is
only a guess. (Technically that's "verification" rather than
"validation" -- but the terms are often interchanged and misused).
<br><br>
In the more precise sense it is possible to validate a string
as complying with
<a href="http://www.cis.ohio-state.edu/htbin/rfc/rfc822.html"
>RFC&nbsp;822</a>. That's the IETF document that defines
the proper formatting and structure of Internet e-mail headers
and addresses. However this is not a trivial task. (I think
Tom Christiansen mentioned that it took him a hundred ugly lines of
<a href="http://www.perl.com/CPAN/authors/Tom_Christiansen/scripts/ckaddr.gz"
>perl code</a> to do it). You might look at
<a href="http://www.cpan.org/">CPAN</a> (the Comprehensive
Perl Archive Network --- a set of co-operating mirror sites that
forms the canonical repository of publicly available perl sources
libraries and modules). Look at
<a href="http://www.perl.org/">http:/www.perl.org/</a> for starters.
<br><br>
As I said, procmail does handle many of these details for you
--- which is why I use it. I figure Stephen R. van den Berg
(procmail's author) knows alot more about RFC822 parsing than I
want to.
<br><br>
Regarding your desire to automatically extract and record addresses
that result in bounce messages (responses from MAILER-DAEMON):
<br><br>
I'd suggest that you grab a copy of
<a href="ftp://ftp.informatik.rwth-aachen.de/pub/packages/procmail/"
>SmartList</a> (the automated mailing list management package that's
built over procmail, and is by the same author). That has the best
"bounce handling" features that are available among the
<a href="http://www.greatcircle.com/majordomo/">Majordomo</a>,
<a href="http://www.lsoft.com/listserv.stm">ListServ</a>,
<a href="http://www.cren.net/listproc/index.html">ListProc</a> set
(from what I hear on the
<a href="http://www.greatcircle.com/lists/list-managers/"
>list-managers</a> mailing list at
<a href="http://www.greatcircle.com/">GreatCircle.com</a>). So,
you could grab it and look through its procmail sources to find out
how it handles the automated removal of "dead" addresses from its
subscriber lists. That's got to be pretty close to what you've
described.
</blockquote>
<!--================================================================-->
<P> <hr> <P>
<H5 align="center"><a href="http://www.linuxgazette.com/copying.html"
>Copyright &copy;</a> 1998, James T. Dennis <BR>
Published in <I>Linux Gazette</I> Issue 29 June 1998</H5>
<P> <hr>
<!--================================================================-->
<p align="center"><table width="95%"><tr align="center">
<td rowspan="4"><A HREF="lg_answer29.html"><IMG
SRC="../gx/dennis/answernew.gif"
ALT="[&nbsp;Answer&nbsp;Guy&nbsp;Index&nbsp;]"i
align="left"></A></td>
</tr><tr align="center">
<!-- begins -->
<td><A HREF="tag_versions.html">versions</A></td>
<td><A HREF="tag_lilo.html">lilo</A></td>
<td><A HREF="tag_virtdom.html">virtdom</a></td>
<td><A HREF="tag_kernel.html">kernel</A></td>
<td><A HREF="tag_winmodem.html">winmodem</a></td>
<td><A HREF="tag_basicmail.html">basicmail</a></td>
<td><A HREF="tag_betterbak.html">betterbak</a></td>
</tr><tr align="center">
<td><A HREF="tag_shadow.html">shadow</a></td>
<td><A HREF="tag_dell.html">dell</a></td>
<td><A HREF="tag_dumbterm.html">dumbterm</a></td>
<td><A HREF="tag_whylinux.html">whylinux</a></td>
<td><A HREF="tag_redhat.html">redhat</a></td>
<td><A HREF="tag_netcard.html">netcard</a></td>
<td><A HREF="tag_macrovir.html">macrovir</a></td>
</tr><tr align="center">
<td><A HREF="tag_newlook.html">newlook</a></td>
<td><A HREF="tag_tacacs.html">tacacs</a></td>
<td><A HREF="tag_sendmail.html">sendmail</a></td>
<td><A HREF="tag_dialdppp.html">dialdppp</a></td>
<td><A HREF="tag_ppp233.html">ppp233</a></td>
<td><A HREF="tag_msmail.html">msmail</a></td>
<td><A HREF="tag_procmail.html">procmail</a></td>
<!-- ends -->
</tr></table>
</P> <hr> <P>
<!--================================================================-->
<A HREF="./index.html"><IMG SRC="../gx/indexnew.gif"
ALT="[&nbsp;Table&nbsp;Of&nbsp;Contents&nbsp;]"></A>
<A HREF="../index.html"><IMG SRC="../gx/homenew.gif"
ALT="[&nbsp;Front&nbsp;Page&nbsp;]"></A>
<A HREF="lg_bytes29.html"><IMG SRC="../gx/back2.gif"
ALT="[&nbsp;Previous&nbsp;Section&nbsp;]"></A>
<A HREF="./hamilton.html"><IMG SRC="../gx/fwd.gif"
ALT="[&nbsp;Next&nbsp;Section&nbsp;]"></A>
<!--startcut ======================================================= -->
</body>
</html>
<!--endcut ========================================================= -->