procmail
[Top] [All Lists]

Re: Problem recipes

1996-03-03 15:47:24
Jonathon Blake <grafolog(_at_)netcom(_dot_)com> writes:
   :0: h
   * !^From +YOUR_USERNAME
   * !^Subject:.*Re:
   * !^FROM_DAEMON
   * ^Subject:.*hwafaq
   | (formail -r ; ~ftp/pub/gr/graphology/hwa.faq ) | $SENDMAIL -oi -t
...
      This recipe returns a blank message, not the file it is 
      supposed to.


The action line of the recipe is simply a shell command.  When you say

    | (formail -r ; ~ftp/pub/gr/graphology/hwa.faq ) | $SENDMAIL -oi -t

the shell runs the command "formail -r", then runs the command
"~ftp/pub/gr/graphology/hwa.faq".  Oh, you mean that's not a command at
all, but rather the actual text of the FAQ?  Then you have to use the
command that sends files to stdout, namely "cat"

    | (formail -r ; cat ~ftp/pub/gr/graphology/hwa.faq ) | $SENDMAIL -oi -t
                    ^^^


#**********
#      To get rid of error messages that tell me mail wasn't delivered
#      
      LOG=dupNull$NL
      :13W:
      ^From:Mailer-daemon(_at_)aol(_dot_)com
      ^From(_dot_)Mailer-daemon(_at_)aol(_dot_)com
      ^From(_dot_)POSTMASTER(_at_)compuserve(_dot_)com
      ^From:POSTMASTER(_at_)compuserve(_dot_)com
       ^From(_dot_)Mailer-daemon(_at_)aol(_dot_)com
      ^From(_dot_)MAILER-DAEMON(_at_)prodigy(_dot_)com 
      ^Subject:Returned Mail: Undeliverable
      ^Subject:Returned Mail: undeliverable message 
       ^Subject:Returned mail: User unknown
      ^Subject:inactive user
      ^Subject:Returned Mail: Cannot send message for 5 days
      ^Subject:Returned Mail: Cannot send message for 3 days
      ^Subject:Undeliverable message
      | GARBAGE
...
      GARBAGE is defined as /dev/nul earlier in .procmailrc

      These messages get past this recipe.  :-(


1) You probably mean to set GARBAGE to be "/dev/null" (with two ell's).

2) If you want to refer to what a variable holds, you need to prefix it
        with a dollar sign.

3) You don't want to execute /dev/null (i.e., $GARBAGE), but rather
        write the mail into /dev/null.  You should therefore leave out
        the '|'.

4) You don't need to lock /dev/null (you don't have write permissions
        on /dev anyway), and though procmail catches this case for you,
        you should probably go ahead and remove the second colon from
        the first line of the recipe.  However, if you might change
        this to refile to a folder, you may want to leave it on so you
        don't have to remember to put it back when you change from
        /dev/null to the folder.

5) procmail condition lines are and'ed, *not* or'ed.  That means your
        recipe only matches messages which have a header line matching
        "From:Mailer-daemon(_at_)aol(_dot_)com" *and* which have a header line
        matching "From:POSTMASTER(_at_)compuserve(_dot_)com" *and* which have a
        header line matching...  Since no message will match all of
        them, the recipe never matches.  If you want to 'or' the
        conditions you have to either put them in one regexp, or use
        the weighted condition stuff as described on the procmailsc(5)
        manpage.  As is, half your conditions would be redundant if you
        were to use a disjunction rather than the conjunction that is
        being used now.

Finally, as a postmaster myself, I respectfully submit that error
message have a *reason* for being sent.  If you're sending lots of
undeliverable messages, maybe you should ask yourself why.  If they're
being generated by a mailing list you run, you should probably just
unsubscribe them (this depends on the nature of the list).  Some list
software will do this for you (among them, Smartlist!).  If the problem
messages are the auto-replies sent by the first recipe, then you should
consider adding a new header to the outgoing auto-reply, greping for
that header in the *body* of bounce messages, and then auto-discarding
only those bounce messages.


Philip Guenther

----------------------------------------------------------------
Philip Guenther                 UNIX Systems and Network Administrator
Internet: guenther(_at_)gac(_dot_)edu   Phonenet: (507) 933-7596
Gustavus Adolphus College       St. Peter, MN 56082-1498
Source code never lies (it just misleads).  (Programming by Purloined Letter?)

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