Philip Guenther | 2 Apr 1997 02:05
Picon

Re: procmail and **Bounced**

process <at> qz.little-neck.ny.us (Eli the Bearded) writes:
>Recently I tried a scoring recipe using a slight variation
>on the script in the manpage to process an existing mailbox.
>I changed the source mailbox used and the command executed
>by formail from "procmail" to "procmail -m new-rc".
>
>The recipe I used was:
>  :0B
>  * $ `$MAILDIR/jmdigest -`^0
>  $MAILDIR/score=$=
>
>Where jmdigest is a perl script which scores stuff and then
>prints the integer score on stdout. If you want to examine
>the script, I keep it in my FTP space:
>	<URL:ftp://ftp.netusa.net/users/eli/jmdigest>
>(jmdigest returns zero unless it is given no files to process.)
>
>Why did that recipe give me log entries like this for all the zero
>scoring stuff? I can find nothing about this in the manpages.

When you use the '-m' flag to procmail, it assumes that all messages
will be explicitly handled: it's a filter, not a delivery agent.  To
this end it unsets the DEFAULT and ORGMAIL variables.  This causes it
to bounce messages that aren't 'delivered' before the end of the rc
file.

The solution depends on what you what it to do.  If you just want to
run procmail with a different rc file, then just put the filename on
the command line and run, ala:

(Continue reading)

Gerben Wierda | 2 Apr 1997 10:29
Picon

Why doesn't this work? (setting variables)

I am running procmail 3.10 and have the following problem: I want to pipe  
something to procmail which then uses a specific RC file. This rc file  
includes another RC file. That included RC file sets various variables.

This setting of the variables works when procmail does its usual job  
(installed as local mailer in sendmail.cf).  But when I run procmail from  
the command line it seems that the system variables like $PATH and such  
(which are set in a setenv file) are not set.

When I paste by hand, I get:

command:
	paste | procmail /usr/local/nocem-e/rc/rc.ok

output:
	process_ncm: process_ncm: cannot open
	/Users/gerben//backup: Not a directory.

Which means that PATH and other variables seem not to be set. But they  
*are* set when procmail is run from sendmail as local mailer.

Can someone help we with this? I include the relevant rc files below.

My .procmailrc looks like this:
===================================================================
INCLUDERC=/usr/local/nocem-e/procmailrc
===================================================================

And /usr/local/nocem-e/procmailrc looks like:
===================================================================
(Continue reading)

Gerben Wierda | 2 Apr 1997 12:58
Picon

INCLUDERC error?

Gerben Wierda wrote (Wed,  2 Apr 97):
> I am running procmail 3.10 and have the following problem: I want to pipe  
> something to procmail which then uses a specific RC file. This rc file
> includes another RC file. That included RC file sets various variables.

I have narrowed my problem down to the fact that it seems that INCLUDERC  
statements are not executed when procmail is called from the commandline  
with an rc file argument, whereas the same INCLUDERC statement *does* work  
when procmail is called by sendmail and it startes reading .procmailrc.

--
Gerben Wierda,

Stafmedewerker Adviesraad voor het Wetenschaps- en Technologiebeleid.
Staff member Advisory Council for Science and Technology Policy
Javastraat 42, 2585 AP, 's-Gravenhage, The Hague, The Netherlands
Tel (+31) 70 3639922	Fax (+31) 70 3608992
http://www.AWT.nl/

"One foolish wise man can state more
	than a thousand wise fools can question."
"Doubters need to understand believes.
	Believers need not understand doubt."

Gerben Wierda | 2 Apr 1997 13:44
Picon

'Solution': INCLUDERC error is formail problem

I have mentioned problems with INCLUDERC. It turns out that in the  
following stanza:

================================================================
INCLUDERC=/usr/local/nocem-e/setenv

:0
| formail -I "Subject:  <at>  <at> NCM" | procmail -p $PMDIR/rc.nocem-e
================================================================

the environment is *not* preserved! procmail may try to preserve the  
environment, but it seems formail kills it. The solution then is to add the  
INCLUDERC statement to rc.nocem-e.

--
Gerben Wierda,

Stafmedewerker Adviesraad voor het Wetenschaps- en Technologiebeleid.
Staff member Advisory Council for Science and Technology Policy
Javastraat 42, 2585 AP, 's-Gravenhage, The Hague, The Netherlands
Tel (+31) 70 3639922	Fax (+31) 70 3608992
http://www.AWT.nl/

"One foolish wise man can state more
	than a thousand wise fools can question."
"Doubters need to understand believes.
	Believers need not understand doubt."

Manuel Mollar Villanueva | 2 Apr 1997 17:31
Picon

Problem with arguments

I have problems using the arguments passed to procmail by the caller.

I need to store in a unique mailbox all the mail that arrives for one domain,
and later, filter the mailbox using the destination address.

Using a rewriting rule of the form (sendmail.cf):

R$*< <at> domain.com.>$*	$:mailbox

is not adequate for my case because lot of mails (for example those that come
from a mailing list) does not contain a "To:" field, so the mailbox cannot be
re-filtered based on the destination address.

Also, I cannot use the sendmail option:

O NoRecipientAction=add-to

because if there are several destination addresses all of them are included,
inhibiting further filtering.

I have decided to use the procmail mailer as defined in the procmail man pages:

	R$*< <at> domain.com.>$*	$#procmail $ <at> /etc/procmailrcs/domain $:$1 <at> domain.com.procmail$2
	R$*< <at> $*.procmail>$*	$1< <at> $2>$3	Already filtered, map back

with the mailer defined as (without the m Flag, of course):

	Mprocmail,	P=/usr/bin/procmail, F=cDFMShu,  S=11, R=21,
			A=procmail -m $h $f $u

(Continue reading)

Timothy Driscoll | 2 Apr 1997 18:10
Picon
Favicon

Re: Program failure (255)


Thank you Philip,   procmail is working just fine now.

...back to filtering.....

-tim driscoll

On Mon, 31 Mar 1997, Philip Guenther wrote:

> Date: Mon, 31 Mar 1997 21:38:37 -0600
> From: Philip Guenther <guenther <at> gac.edu>
> To: Timothy Driscoll <tdriscol <at> BayNetworks.COM>
> Cc: procmail <at> Informatik.RWTH-Aachen.DE
> Subject: Re: Program failure (255) 
> Resent-Date: Tue, 1 Apr 1997 06:16:42 +0200 (MET DST)
> Resent-From: procmail <at> Informatik.RWTH-Aachen.DE
> 
> Timothy Driscoll <tdriscol <at> BayNetworks.COM> writes:
> >I am receiving an error "Program failure (255)" while trying to run any
> >command (like formail) in my .procmailrc.  Procmail works well when I
> >use it to filter email, but attempting to run 'formail' (or any program)
> >produces that error.
> 
> The first guess in a case like this is that something is wrong with
> $SHELL.  Try putting
> 	SHELL = /bin/sh
> 
> at the top of your .procmailrc.
> 
> Philip Guenther
(Continue reading)

Eli the Bearded | 2 Apr 1997 19:22
Picon

Re: procmail and **Bounced**

Philip Guenther <guenther <at> gac.edu> replied to me:
> >Why did that recipe give me log entries like this for all the zero
> >scoring stuff? I can find nothing about this in the manpages.
> 
> When you use the '-m' flag to procmail, it assumes that all messages
> will be explicitly handled: it's a filter, not a delivery agent.  To
> this end it unsets the DEFAULT and ORGMAIL variables.  This causes it
> to bounce messages that aren't 'delivered' before the end of the rc
> file.

Yes, I gathered that. But I still fail to see why the recipe
would fail to deliver mail which scored zero.

> 	# Find the score by feeding the body into "jmdigest", capturing
> 	# stdout in the SCORE variable.
> 	# (if the entire message should be fed, remove the 'b' flag.)
> 	:0bc
> 	SCORE=|$MAILDIR/jmdigest -

Yup, entire message should be fed. jmdigest could probably be
implemented entirely in procmail, but I feel more comfortable in
perl and I am aiming for a general solution here which will
not rely upon procmail. (Even Johnbob's original jmdigest was
not general enough for me, so I have been fixing it.)

Elijah
------
please do not CC me when replying to the list

(Continue reading)

Philip Guenther | 2 Apr 1997 20:48
Picon

Re: procmail and **Bounced**

process <at> qz.little-neck.ny.us (Eli the Bearded) writes:
>Philip Guenther <guenther <at> gac.edu> replied to me:
>> >Why did that recipe give me log entries like this for all the zero
>> >scoring stuff? I can find nothing about this in the manpages.
>> 
>> When you use the '-m' flag to procmail, it assumes that all messages
>> will be explicitly handled: it's a filter, not a delivery agent.  To
>> this end it unsets the DEFAULT and ORGMAIL variables.  This causes it
>> to bounce messages that aren't 'delivered' before the end of the rc
>> file.
>
>Yes, I gathered that. But I still fail to see why the recipe
>would fail to deliver mail which scored zero.

Um, because zero isn't positive? To quote the procmailsc(5) manpage:

     When  weighted  scoring  is used in a recipe, then the final
     score for that recipe must be positive for it to match.

The score was zero, it didn't match, so the action wasn't done.

Philip Guenther

Philip Guenther | 2 Apr 1997 20:44
Picon

Re: Problem with arguments

Manuel Mollar Villanueva <mollar <at> moon.inf.uji.es> writes:
>I have problems using the arguments passed to procmail by the caller.
>
>I need to store in a unique mailbox all the mail that arrives for one domain,
>and later, filter the mailbox using the destination address.
>
>Using a rewriting rule of the form (sendmail.cf):
>
>R$*< <at> domain.com.>$*	$:mailbox
>
>is not adequate for my case because lot of mails (for example those that come
>from a mailing list) does not contain a "To:" field, so the mailbox cannot be
>re-filtered based on the destination address.

This is correct.  You've lost the envelope destination address(es) when
you do that.

>I have decided to use the procmail mailer as defined in the procmail man pages:
>
>	R$*< <at> domain.com.>$*	$#procmail $ <at> /etc/procmailrcs/domain $:$1 <at> domai
n.com.procmail$2
>	R$*< <at> $*.procmail>$*	$1< <at> $2>$3	Already filtered, map back

If you're using a recent sendmail (and you should be), then you should
just use the mailertable, as you then don't need to hack the
sendmail.cf everytime you change the affected domains.  More
information on the mailertable can be found in the cf/README file in
the sendmail source tree.

>with the mailer defined as (without the m Flag, of course):
(Continue reading)

David W. Tamkin | 2 Apr 1997 21:16
Picon

rcfile paths and `c' on captures

Philip Guenther suggested to process <at> qz.little-neck.ny.us:

| When you use the '-m' flag to procmail, it assumes that all messages
| will be explicitly handled: it's a filter, not a delivery agent.  To
| this end it unsets the DEFAULT and ORGMAIL variables.  This causes it
| to bounce messages that aren't 'delivered' before the end of the rc
| file.
|
| The solution depends on what you what it to do.  If you just want to
| run procmail with a different rc file, then just put the filename on
| the command line and run, ala:
|
| 	formail -s procmail new-rc

I'd like to point out that without the -m option, procmail assumes that
any relative paths to rcfiles named on the command line are from $HOME,
unless the path begins with "./".  (With -m, all relative paths to rcfiles
are assumed to begin from the current directory, and MAILDIR defaults to
the current directory rather than defaulting to $HOME.)  So dropping the
-m may require specifying the path to new-rc if you aren't working in your
$HOME.

| Otherwise you can explicitly set DEFAULT at the top of the rc file.

Yes, or perhaps you could set ORGMAIL, or both.

| However, I wonder if the following recipes better show you goal:
|
| 	# Find the score by feeding the body into "jmdigest", capturing
| 	# stdout in the SCORE variable.
(Continue reading)


Gmane