Robert M. Riches Jr. | 13 Jun 06:13 2000

two questions wrt. distribution recipes

I am attempting to set up a procmailrc file, and there are two
problems I have not been able to resolve.  I am using procmail as
a mail delivery agent called by fetchmail.  The purpose is to
fetch mail over POP3 from a single ISP mail account, then deliver
it to one or more accounts on my local Linux machine based on the
To: and Subject: lines.

The first problem is I have not found a way to set up a list of
recipes such that each recipe has an independent chance to
deliver mail to its related account, yet have one final recipe
that gets run only if _none_ of the earlier ones was successful.
If procmail sees several names in the To: or Subject: lines, I
want the message to be delivered to everyone whose names are
found.  However, if it can't deliver to anybody, I want it to
deliver it to me.

The second problem is procmail insists on modifying the 'From '
line, no matter what command line switches I have tried.  All
'From ' lines say the message came from the account that ran
fetchmail and procmail.  I'd like to have the 'From ' lines be
left alone, or at most update the timestamp.

Any suggestions?

(I'm not sure I'm going to be successful in getting subscribed to
this list, so I would humbly request you reply directory to me as
well as to the list.)

Thanks.

(Continue reading)

Matthew G. Saroff | 13 Jun 07:53 2000
Picon

Re: Spambouncer not filtering

	As an FYI for the list.  My copy of Spambouncer had stopped
filtering.  The problem was that the file for legitlists was empty, so
that it passed everything as a legitimate list.  I added an email address
and made sure that there were no blank lines, and the problem was fixed.

--

-- 
Matthew Saroff
Matthew G. Saroff | 13 Jun 06:29 2000
Picon

Spambouncer not filtering

Hi,
	About a week ago, spambouncer stopped working.  Nothing is being
filtered to the pam folder.  Other filters seem to work fine.
My .procmailrc is:
#!/bin/sh
VERBOSE=ON
ADMINFOLDER=$HOME/incoming/bounce
BACKDIR=$HOME/incoming
BACKGFILE=fallback
BADSPAM=$HOME/Procmail/badspam
BLOCKFOLDER=spam
BLOCKREPLY=SILENT
BULKFOLDER=$HOME/incoming/bounce
BYPASSWD=givematthewgsaroffacookie
CHINESE=NO
DATE=date
DEFAULT=/var/spool/mail/msaroff
DULCHECK=YES
FORMAIL=/usr/bin/formail
FREEMAIL=INTERNAL
GARBLEDCHARSET=YES
GOLIST=$HOME/Procmail/approved
JAPANESE=NO
KOREAN=NO
LEAN=yes
LEGITLISTS=$HOME/Procmail/legitlists
LINEBUF=96000
LOCKFILE=$HOME/.lockmail
LOGFILE=$HOME/.maillog
MAILDIR=$HOME/mail
(Continue reading)

SoloCDM | 13 Jun 18:45 2000
Picon

Malfunction with SED

Everything works except the sed recipe, and that's a return after
"<img" as it is in the body, so where is the problem in sed?  3D and
<agent> are dummies to omit the link.

# Recipes:

:0
* B ?? ^\/<img($.*)?src.*blankpixel.*">
{ MCHECK=$MATCH }

:0
{ LOG=$MCHECK }

:0 fb
| sed 's/$MCHECK//'

# Output from LOG:

<img
src="3Dhttp://www.<agent>.com/images/blankpixel.gif/Key=3095.LZmR.V8Eyd">

Note: Detailed Document(s) and Sample(s) are more than welcome.
      When you reply to this message, please include
      the mailing list and my address.

*********************************************************************
Signed,
SoloCDM
Collin Park | 13 Jun 19:00 2000
Picon

Re: two questions wrt. distribution recipes

Hi,

> If procmail sees several names in the To: or Subject: lines, I
> want the message to be delivered to everyone whose names are
> found.  However, if it can't deliver to anybody, I want it to
> deliver it to me.

My first idea was to do something like this:

     FILED=no

    :0 c
    * (^(TO|Subject):.*(fred|fredrika))
    { 
      FILED=yes

      :0
      ! fred
    }

    [[ etc. ]]

    :0
    * FILED ?? no
    ! me

But then a simpler idea came to mind:

    LASTFOLDER=NotDeliveredToAnybody

(Continue reading)

Matt Dunford | 13 Jun 20:02 2000

Re: Malfunction with SED

I may be wrong, but I think you need to do the regex substitution completely in
sed.

$MCHECK has '/'s in it so, when procmail expands it, sed freaks out. Too many slashes.

s/$MCHECK// actually turns out to be

s/<img src="3Dhttp://www.<agent>.com/images/blankpixel.gif/Key=3095.LZmR.V8Eyd">//

notice the problem with the slashes.

Doing something like this should work (not tested):

:0 fb
| sed 's/<img[^>]*src=[^>]*blankpixel[^>]*>//g'

On Tue, 13 Jun 2000, SoloCDM wrote:

>Everything works except the sed recipe, and that's a return after
>"<img" as it is in the body, so where is the problem in sed?  3D and
><agent> are dummies to omit the link.
>
># Recipes:
>
>:0
>* B ?? ^\/<img($.*)?src.*blankpixel.*">
>{ MCHECK=$MATCH }
>
>:0
>{ LOG=$MCHECK }
(Continue reading)

Robert M. Riches Jr. | 13 Jun 21:06 2000

Re: two questions wrt. distribution recipes

> From incomail  Tue Jun 13 10:02:57 2000
>
> > If procmail sees several names in the To: or Subject: lines, I
> > want the message to be delivered to everyone whose names are
> > found.  However, if it can't deliver to anybody, I want it to
> > deliver it to me.
>
> ...
>
> But then a simpler idea came to mind:
>
>
>     LASTFOLDER=NotDeliveredToAnybody
>
>     :0 c
>     * (^(TO|Subject):.*(fred|fredrika))
>     ! fred
>     
>     [[ etc. ]]
>
>     # If any of the above succeeded, then LASTFOLDER will be modified
>     # (doesn't seem to work though if you use if the above deliveries
>     #  are blocks like:
>     #   :0c
>     #   * ^TO_fred
>     #   {  
>     #      LOG="message for fred"
>     #      :0
>     #      ! fred
>     #   }
(Continue reading)

Collin Park | 13 Jun 21:48 2000
Picon

Re: two questions wrt. distribution recipes

Hi,

> Thanks.  The LASTFOLDER idea appears to have worked.
> 
Great!

> Unfortunately, the -f idea for keeping the "From " line intact
> did not work.

I was afraid of that.  You did say that you tried flags...
How about this, inside .procmailrc:

    :0 fhw
    | formail -I'From ' -a'From '

This will nuke the bogus "From " line, and rebuild "From " based on
From:, Return-Path:, Sender:, etc.

hth
collin
--
Neither I nor my employer will accept any liability for any problems
or consequential loss caused by relying on this information.

Collin Park                         Not a statement of my employer.
Emil Isberg | 13 Jun 23:54 2000
Picon
Picon

Re: two questions wrt. distribution recipes

(second try to see if I recall what adress to use)

On Tue, 13 Jun 2000, Robert M. Riches Jr. wrote:
>>:0 c
>>* (^(TO|Subject):.*(fred|fredrika))
>>! fred

Remember that last line. Procmail calls sendmail to send the mail to fred.

>>>The second problem is procmail insists on modifying the 'From '
>>>line, no matter what command line switches I have tried.  All
>>>'From ' lines say the message came from the account that ran
>>>fetchmail and procmail.  I'd like to have the 'From ' lines be
>>>left alone, or at most update the timestamp.
>>          mda "/usr/bin/procmail -f -"
>>would work... not?  I've only ever used procmail from sendmail so I
>>don't grok its behavior when invoked directly from fetchmail...

Actually procmail is not the mda in this case. It's just the mailfilter
before it is passed to sendmail that deliver it to the mda.

>Unfortunately, the -f idea for keeping the "From " line intact
>did not work.

Okej, you have fetchmail that gets your mail and procmail that goes
through the mail and choosing where to send it...

 fetchmail -> procmail -> sendmail -> MDA
                           ^
                           | Here is your From_ line added.
(Continue reading)

David W. Tamkin | 14 Jun 08:02 2000
Picon

Re: two questions wrt. distribution recipes

Collin's answer to use $LASTFOLDER solves Robert's first problem (though
Robert's code could use some other tweaking), so I'll address the second
one:

| The second problem is procmail insists on modifying the 'From '
| line, no matter what command line switches I have tried.  All
| 'From ' lines say the message came from the account that ran
| fetchmail and procmail.  I'd like to have the 'From ' lines be
| left alone, or at most update the timestamp.
| 
| Any suggestions?

Yes.  Stop liking that.  It would be a bad thing.

The From_ line should point to the site that readdressed the message, not
back to the original sender.  However, it is all right to preserve the old
From_ line in another header field (or in *a* header field, since technically
the From_ line is not a header).  For example,

  :0fhW
  | formail -R 'From ' 'X-Old-Postmark:'

Then after you fetch the message, you can still see the old From_ line's
contents in the X-Old-Postmark: header if you'd like to know them, but the
From_ line itself will correctly point back to the account that redirected
the message.

Gmane