procmail
[Top] [All Lists]

Re: Recipe bug or what ?

1998-12-01 03:38:13
On Mon, 30 Nov 1998 19:11:28 -0800, Shiloh Costa <costa(_at_)mdi(_dot_)ca> 
wrote:
Something strange is happening. A recipe I am successfully using on other
user accounts for some reason isn't working on a particular setup and I
have no idea why...

The first suggestion is always to make sure SHELL=/bin/sh is near the
top of your .procmailrc. 

:0 c:thelock
* ^TOinfo
*!^FROM_DAEMON
*!^X-Loop: info(_at_)thesoftware(_dot_)com
|(formail -r -A "Precedence: junk" \
-I"From: info(_at_)thesoftware(_dot_)com (TheSoftware)" \
-A "X-Loop: info(_at_)thesoftware(_dot_)com";\
cat $FILEDIR/info.txt)|$SENDMAIL -t

(The lock file here is unnecessary unless you really know what you are
doing.)

If setting the shell doesn't help, you could modify the recipe so it
saves a copy of the outgoing message somewhere where you can examine
it, and try sending it from the command line. Perhaps your Sendmail is
broken, or whatever. For good measure, you could also dump out a copy
of the environment.

    ### Debug version of same recipe
    # Dump out copy of environment. Make sure FILEDIR and SENDMAIL
    # are set to what you think they should be in the dump
    dummy=`env >/tmp/thesoftware.latest; echo '***' >>/tmp/thesoftware.latest`

    :0c #:thelock # no lock unless you +know+ you need it for something
    *   ^TOinfo
    * ! ^FROM_DAEMON
    * ! ^X-Loop: info(_at_)thesoftware\(_dot_)com
    | ( formail -rt -A "Precedence: junk" \
            -I "From: info(_at_)thesoftware(_dot_)com (TheSoftware)" \
            -A "X-Loop: info(_at_)thesoftware(_dot_)com" ; \
        cat $FILEDIR/info.txt ) | tee -a /tmp/thesoftware.latest \
      | $SENDMAIL $SENDMAILFLAGS -t

After this runs, you should find in /tmp/thesoftware.latest a copy of
the environment Procmail (and thus its children) sees, and a copy of
the message that was fed to Sendmail. You can try sending that from
the command line and see if you get any errors, or perhaps just look
at it and see what's wrong.

BTW, you should be using ^TO_info if your Procmail is new enough to
handle that (and perhaps upgrade to one which is if not ;^)

Gratuitous improvements: Prefer formail -rt over -r, backslash the dot
on the X-Loop condition, observe $SENDMAILFLAGS.

Hope this helps,

/* era */

-- 
.obBotBait: It shouldn't even matter whether    <http://www.iki.fi/~era/>
I am a resident of the state of Washington. <http://members.xoom.com/procmail/>

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