procmail
[Top] [All Lists]

Re: Recipie works only for recipient alias

1997-02-19 00:47:15
On Tue, 18 Feb 1997 13:46:44 -0500 (EST),
Kyle Ferrio <kbf(_at_)phy(_dot_)duke(_dot_)edu> wrote:
But then why not try it and see how far it can take you.
Everything else looks fine to me (excep't I'd probably use only
one echo -e and use backslash escapes for newlines etc). (Oh, and
sendmail -oi -t is used in all the example recipes ;-) (There was
I didn't mean to set this up as a particularly good example. I did
discover, however, that the sendmail 8.52 my sysadmin has installed will 
not work with the -oi option.  Strange, but true.  I have no idea how it 
was configured.  It's old.

This reply grew a bit long. Most of it is just verbatim output from
programs which doesn't take too long to examine. I'm not sure if this
can help you any but at least I've tried ;-)
  This still has nothing to do with Sendmail acting strangely. But if
your Sendmail is strange in other respects, as you write, then maybe
that's the root of the problem?

On Tue, 18 Feb 1997, era eriksson wrote:
Don't see how this could help against the problems you describe. Also
the VERBOSE log should have revealed all these problems. 
The quoting style is taken from others' known-working examples and 
doesn't affect processing.  The verbose log has no errors of any kind in 
any event.  But thanks.

Not errors, just curious messages. Here's a trial run -- interesting
parts are underlined with ---------:

 $ cat scratch/.procmailrc
 VERBOSE="yes please!"
 DEFAULT=$HOME/scratch/output

 PROCBIN=$HOME/bin
 AUTOFROM="Kyle's Mail Troll <kbf(_at_)phy(_dot_)duke(_dot_)edu>
 XLOOP="X-Loop: kbf(_at_)phy(_dot_)duke(_dot_)edu"

 :0
 * ^Subject:.*gimmie
 * ! ^Subject:.*Re:
 * $ ! ^$XLOOP
 | ($PROCBIN/formail -r -I"$AUTOFROM" -I"$XLOOP" ; \
     /usr/bin/echo "It worked." ; \
     /usr/bin/echo '' ) #\
 # | /usr/lib/sendmail -t

 $ cat scratch/test.msg
 From: era eriksson <reriksso(_at_)cc(_dot_)helsinki(_dot_)fi>
 Subject: gimmie! gimmie! gimmie!
 Date: today

 Gimme gimme gimme a maaaan after midnight

 $ procmail scratch/.procmailrc < scratch/test.msg
 procmail: [21001] Wed Feb 19 09:14:00 1997
 procmail: Assigning "DEFAULT=/h/3/ykiel/reriksso/scratch/output"
 procmail: Assigning "PROCBIN=/h/3/ykiel/reriksso/bin"
 procmail: Assigning "AUTOFROM=Kyle's Mail Troll 
<kbf(_at_)phy(_dot_)duke(_dot_)edu>
-------------------------------------------------------------------^ 
 XLOOP=X-Loop:"
--------------- (AUTOFROM is now a two-line string ending with "X-Loop:")
 procmail: Skipped "kbf"
------------------------ (Spurious output, should alert you)
 procmail: Skipped "@phy.duke.edu""
-----------------------------------
 procmail: Match on "^Subject:.*gimmie"
 procmail: Match on ! "^Subject:.*Re:"
 procmail: No match on ! "^"
---------------------------- (Ooops, $XLOOP is of course not defined)
 procmail: Locking "/h/3/ykiel/reriksso/scratch/output.lock"
 procmail: Assigning "LASTFOLDER=/h/3/ykiel/reriksso/scratch/output"
 procmail: Opening "/h/3/ykiel/reriksso/scratch/output"
 procmail: Acquiring kernel-lock
 procmail: Unlocking "/h/3/ykiel/reriksso/scratch/output.lock"
  Subject: gimmie! gimmie! gimmie!
   Folder: /h/3/ykiel/reriksso/scratch/output                               134

The .procmailrc used here is cut directly out of the message you
posted. Of course, if there were typos in the .procmailrc you gave,
but not in the original (like you typed it in in your mail editor
instead of including the .procmailrc file directly), all of this is
moot.

The missing "From: " is not to do with quoting, but I suspect it might
do funny things to what Procmail et al. thinks is the boundary between
the header of the message and the body. A valid header should always
have a colon in it, which this one doesn't have. 

Here's an example with the quoting fixed but the From: still missing: 

 $ procmail scratch/.procmailrc.corrected <scratch/test.msg
 procmail: [14960] Wed Feb 19 09:19:10 1997
 procmail: Assigning "DEFAULT=/h/3/ykiel/reriksso/scratch/output"
 procmail: Assigning "PROCBIN=/h/3/ykiel/reriksso/bin"
 procmail: Assigning "AUTOFROM=Kyle's Mail Troll 
<kbf(_at_)phy(_dot_)duke(_dot_)edu>"
 procmail: Assigning "XLOOP=X-Loop: kbf(_at_)phy(_dot_)duke(_dot_)edu"
 procmail: Match on "^Subject:.*gimmie"
 procmail: Match on ! "^Subject:.*Re:"
 procmail: Match on ! "^X-Loop: kbf(_at_)phy(_dot_)duke(_dot_)edu"
 procmail: Assigning "LASTFOLDER= ($PROCBIN/formail -r -I"$AUTOFROM" -I"$XLOOP" 
; \
     /usr/bin/echo "It worked." ; \
     /usr/bin/echo '' ) #\
 # | /usr/lib/sendmail -t"
  Subject: gimmie! gimmie! gimmie!
   Folder:  ($PROCBIN/formail -r -I"$AUTOFROM" -I"$XLOOP" ; \     /usr/b        
    134
 procmail: Executing " ($PROCBIN/formail -r -I"$AUTOFROM" -I"$XLOOP" ; \
     /usr/bin/echo "It worked." ; \
     /usr/bin/echo '' ) #\
 # | /usr/lib/sendmail -t"
 formail: Invalid field-name: "Kyle's Mail Troll 
<kbf(_at_)phy(_dot_)duke(_dot_)edu>"
-------------------------------------------------------------------- (Ooops)
 Usage: formail [-bczfrktqY] [-D nnn idcache] [-p prefix] [-l folder]
         [-xXaAiIuU field] [-R ofield nfield]
    Or: formail [+nnn] [-nnn] [-bczfrktnedqBY] [-D nnn idcache] [-p prefix]
         [-m nnn] [-l folder] [-xXaAiIuU field] [-R ofield nfield]
         -s [prg [arg ...]]

But like I said, you should be seeing this in your own VERBOSE log if
this is actually the problem. Are those errors actually in the
.procmailrc you're using? What does the log look like? 

Finally, here's what I suppose it ought to look like: 

 $ procmail scratch/.procmailrc.corrected< scratch/test.msg
 procmail: [18983] Wed Feb 19 09:26:25 1997
 procmail: Assigning "DEFAULT=/h/3/ykiel/reriksso/scratch/output"
 procmail: Assigning "PROCBIN=/h/3/ykiel/reriksso/bin"
 procmail: Assigning "AUTOFROM=From: Kyle's Mail Troll 
<kbf(_at_)phy(_dot_)duke(_dot_)edu>"
 procmail: Assigning "XLOOP=X-Loop: kbf(_at_)phy(_dot_)duke(_dot_)edu"
 procmail: Match on "^Subject:.*gimmie"
 procmail: Match on ! "^Subject:.*Re:"
 procmail: Match on ! "^X-Loop: kbf(_at_)phy(_dot_)duke(_dot_)edu"
 procmail: Assigning "LASTFOLDER= ($PROCBIN/formail -r -I"$AUTOFROM" -I"$XLOOP" 
; \
     /usr/bin/echo "It worked." ; \
     /usr/bin/echo '' ) >$HOME/scratch/somefile"
  Subject: gimmie! gimmie! gimmie!
   Folder:  ($PROCBIN/formail -r -I"$AUTOFROM" -I"$XLOOP" ; \     /usr/b        
    134
 procmail: Executing " ($PROCBIN/formail -r -I"$AUTOFROM" -I"$XLOOP" ; \
     /usr/bin/echo "It worked." ; \
     /usr/bin/echo '' ) >$HOME/scratch/somefile"

 $ cat scratch/somefile
 To: reriksso(_at_)cc(_dot_)helsinki(_dot_)fi
 Subject: Re: gimmie! gimmie! gimmie!
 From: Kyle's Mail Troll <kbf(_at_)phy(_dot_)duke(_dot_)edu>
 X-Loop: kbf(_at_)phy(_dot_)duke(_dot_)edu

 It worked.

Pardon the verbosity. I assume you +have+ done tests like this already
but if you haven't, now is the time. 

Hope this helps,

/* era */

-- 
Defin-i-t-e-ly. Sep-a-r-a-te. Gram-m-a-r.  <http://www.iki.fi/~era/>
 * Enjoy receiving spam? Register at <http://www.iki.fi/~era/spam.html>