procmail
[Top] [All Lists]

Re:

1996-12-17 10:16:24
There's been a lot of these spews lately.

BugLess, where art thou?

Larry Vaden, founder and CEO
Internet Texoma, Inc.
bringing the real Internet to rural Texomaland

---30---

At 03:14 AM 12/17/96, you wrote:
etc.

-- 
Rhamm Groohm! Auuurgh! Ogouuun. Ooorgh! Ooorgh! 
alex(_at_)zool(_dot_)unizh(_dot_)ch(_dot_)

------------------------------

Date: Mon, 16 Dec 1996 10:53:21 -0500 (EST)
From: D Mathew Repasky 
<drepasky(_at_)magnus(_dot_)acs(_dot_)ohio-state(_dot_)edu>
To:    
Subject: Unsubscription request
Message-Id: 
<199612161553(_dot_)KAA06270(_at_)bottom(_dot_)magnus(_dot_)acs(_dot_)ohio-state(_dot_)edu>
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

unsubscribe drepasky(_at_)magnus(_dot_)acs(_dot_)ohio-state(_dot_)edu

This account will be removed on the 1st of the new year...no more procmail
for me. :(

Matt

------------------------------

Date: Mon, 16 Dec 1996 10:05:36 -0500
From: "Blaies, Thomas" <tblaies(_at_)cols(_dot_)disa(_dot_)mil>
To: "'procmail'" <procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE>
Subject: Question
Message-ID:
<c=US%a=_%p=DOD%l=DMCNT7-961216150536Z-10540(_at_)dmcnt7(_dot_)cols(_dot_)disa(_dot_)mil>

Hello,
I am having trouble formulating a .procmailrc file to:

1.     append a copy of the email to a file
2.     send a copy to another user
              and
3.     finally run the email thru a script .

I have been able to do # 1 and 3 but not   # 2 
Could you please send me an example of this ?


Thank You.
tblaies(_at_)cols(_dot_)disa(_dot_)mil

------------------------------

Date: Mon, 16 Dec 1996 16:56:03 +0100
From: qdtrini(_at_)toedts1(_dot_)toedt(_dot_)ericsson(_dot_)se (Rickard 
Nilsson)
To: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Subject: Deleting mailfile!
Message-Id: 
<199612161556(_dot_)QAA03964(_at_)toedts1c52(_dot_)edt(_dot_)ericsson(_dot_)se>

Hi Stephen,

I make a try and see if this address is still valid.

I just fetched procmail, version 3.11pre4 from 95-10-29.  After reading
all info a couple of times, and utilizing try-and-error, I managed to do
what I wanted, but...

Background:

I support an Ericsson product which is an RPC application for UNIX (NT/
Win95) to the IBM mainframe. What I want to do is to establish a new
way to report errors, Trouble Reports, on this product. 

Therefore I made a form which can be filled in from our home-page. Since
I'm not familiar with cgi-programming, I just used the standard form,
which uses mail to send the form (I don't have access to the cgi-library
anyway). Fine! I get the form nicelly and easy. My next thought was to auto-
matically generate the posted form an errand number, and to move it to a
special TRbox. My thoughts went to procmail, which I heard someone else
used in order to get a 'popping' sound each time a mail came.

My question/bug-report is a follows:

The mailbox which is used has permission 666, i.e. everyone is autho-
rized to read and delete mails. Then one funny thing happened when I
started to use procmail. The mailbox disappeared! and a new, empty, one
was created with permission 600. After a few tests, I came to the con-
clusion that if the mailbox has permission 600, it works as expected, BUT
if it on the other hand has permission 666, it removes the old mailfile,
creates a new empty one, and processes the incoming (new) mail. Not very
nice since I now cannot answer the ones who sent the old Trouble Report's
(good we have backup's on tape).

Is there a newer version which fixes this? Or is there a way to circum-
vent it?

Regards,
/Richard Nilsson at qdtrini(_at_)toedts1(_dot_)ericsson(_dot_)se

------------------------------

Date: Mon, 16 Dec 1996 10:46:07 -0600
From: Philip Guenther <guenther(_at_)gac(_dot_)edu>
To: Stan Ryckman <stanr(_at_)sunspot(_dot_)tiac(_dot_)net>
cc: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE (procmail)
Subject: Re: [Q] mail to me AND the list to BOTH places.. 
Message-Id: <199612161646(_dot_)KAA21777(_at_)solen(_dot_)gac(_dot_)edu>

Stan Ryckman <stanr(_at_)sunspot(_dot_)tiac(_dot_)net> writes:
Rick Troxel wrote:

On Wed, 11 Dec 1996, Philip Guenther wrote:

guenther> I have found that when sorting out mail from mailing lists
guenther> into separate folders/mailboxes/whatever, the *best* (opinion
guenther> alert!) thing to 'sort' on is the Return-Path: header.  Any
guenther> mailing list set up this decade will send out messages with an
guenther> envelope sender of something like: 
guenther> 
guenther>   procmail-request(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
guenther> 
guenther> Most (?) MTAs, and sendmail in particular, will put the
guenther> envelope sender in the Return-Path: header, where it can be
guenther> matched on. 

I find that very few of the lists to which I subscribe have this header. 
I've had to develop my personal criteria on a per list basis. 

Even *THIS* (procmail) list arrives here without a "Return-Path:"
header (you meant "header field" I know).  Was it set up in this
decade?  BTW, they use sendmail here I'm 99% sure.

I never said that modern lists insert a Return-Path: header; rather,
I said they changed the envelope sender to an 'administrative' address.
This list does do that.  Whether or not a "Return-Path:" header is present
is dependent on the MTA that does final delivery, i.e., _yours_!


...
I've found that if you have access to "From ", it's the most consistent
for *ALL* types of lists.  If you can count on "Return-Path:", that
may work for you -- but it's probably bad advice to give, since it seems
to be common not to supply it (I have three accounts, none of which
supply that header field except when it's a *local* return path).


The address you see in the "From " header should always be the same as
what appears in the Return-Path: header (when present).  They're both
coming from the envelope sender, see rfc1123 section 5.2.8 for
details.  One is (hopefully) inserted by sendmail, the other is
inserted by the MDA which is passed it by sendmail via a '-f' (or maybe
a '-r') command line argument.


The key advice I was trying to give is that sorting/refiling based on
the envelope sender is a Good Thing.  I should have mentioned that it
is an "implementation detail" whether you do this by matching on the
"From " pseudo-header or on the Return-Path: header, but, well, I'm not
perfect.  I'll agree that the Return-Path: header is optional according
to the rfcs.  However, it is quite common from the people I've talked
to, and sendmail version 8 configs, as shipped, put it in on local
delivery, so I'm sorta surprised that you haven't see it more.  I'll
note that putting it in _only_ when it's local makes no sense to me, so
I'll just express mild skepticism with regards to this.



I'll argue against using "Return-Path:" unless you want to depend on
information supplied (or not) at the last stage of transport, rather
than by the mailing list itself.  Thus, I agree with Rick and
disagree with Philip (from whom I've learned lots though).

You *always* are depending on both, period.  Or do you think the
"From " header was inserted by the mailing list?

(Thanks for the compliment though.)

Philip Guenther

------------------------------

Date: Mon, 16 Dec 1996 10:39:25 -0800
From: "Alan K. Stebbens" <aks(_at_)anywhere(_dot_)engr(_dot_)sgi(_dot_)com>
To: "Blaies, Thomas" <tblaies(_at_)cols(_dot_)disa(_dot_)mil>
Cc: "'procmail'" <procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE>
Subject: Re: Question 
Message-Id: 
<199612161839(_dot_)KAA10505(_at_)anywhere(_dot_)engr(_dot_)sgi(_dot_)com>

   > I am having trouble formulating a .procmailrc file to:
   > 
   > 1.       append a copy of the email to a file
   > 2.       send a copy to another user
   >          and
   > 3.       finally run the email thru a script .
   >  
   > I have been able to do # 1 and 3 but not   # 2 
   > Could you please send me an example of this ?

1.
      :0c:    # append mail to "mailfolder"
      mailfolder

2.
      :0c     # send copy of the mail to "auser"
      ! auser

3.
      :0      # run the mail through "ascript"
      | ascript

Please read the man page for "procmailrc" and especially pay attention
to the "c" flag, and the "!" and "| actions.

G'luck

___________________________________________________________
Alan Stebbens <aks(_at_)sgi(_dot_)com>      http://reality.sgi.com/aks

------------------------------

Date: Mon, 16 Dec 1996 13:16:16 -0600
From: Philip Guenther <guenther(_at_)gac(_dot_)edu>
To: Alex Schroeder <alex(_at_)zool(_dot_)unizh(_dot_)ch>
cc: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE (Procmail mailing list)
Subject: Re: procmail: SYSPATH 
Message-Id: <199612161916(_dot_)NAA06375(_at_)solen(_dot_)gac(_dot_)edu>

Alex Schroeder <alex(_at_)zool(_dot_)unizh(_dot_)ch> writes:
Everything seems to work with procmail, except for this strange
message in my log file. I have no idea what SYSPATH could mean.

SYSPATH: Undefined variable.
SYSPATH: Undefined variable.
From wschaly(_at_)platinum(_dot_)com Tue Nov 19 14:34:44 1996
Subject: Mojn Alex
 Folder: /usr/spool/mail/alex                                        1705
SYSPATH: Undefined variable.
SYSPATH: Undefined variable.
From u2458(_at_)bwl(_dot_)uni-kiel(_dot_)de Tue Nov 19 17:11:33 1996
Subject: atlantis befehle
 Folder:  formail -r -k -b -A "Precedence: junk"\                    1609
SYSPATH: Undefined variable.
SYSPATH: Undefined variable.
From GuWolf(_at_)aol(_dot_)com Tue Nov 19 17:50:48 1996
Subject: Re: Bitter erklaehr mir mal...
 Folder: /usr/spool/mail/alex                                                
1839


This is most likely related to starting up a shell from your .procmailrc,
either via an action or via a backquote expansion.  If your shell is of
the C-shell variety (csh or tcsh), then it will give this error if one
of the shell's startup scripts contains a reference to $SYSPATH without
it being defined, perhaps with the expectation that SYSPATH would be
passed in from login.

Solution:  Put the following at the top of your .procmailrc:

SHELL = /bin/sh


By using the Bourne shell, which is much more suitable for scripting,
you'll avoid both this a other possible brokennesses.

Philip Guenther

------------------------------

Date: Mon, 16 Dec 1996 13:18:09 -0600
From: Philip Guenther <guenther(_at_)gac(_dot_)edu>
To: "Blaies, Thomas" <tblaies(_at_)cols(_dot_)disa(_dot_)mil>
cc: "'procmail'" <procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE>
Subject: Re: Question 
Message-Id: <199612161918(_dot_)NAA06532(_at_)solen(_dot_)gac(_dot_)edu>

"Blaies, Thomas" <tblaies(_at_)cols(_dot_)disa(_dot_)mil> writes:
Hello,
I am having trouble formulating a .procmailrc file to:

1.    append a copy of the email to a file
2.    send a copy to another user
             and
3.    finally run the email thru a script .

I have been able to do # 1 and 3 but not   # 2 
Could you please send me an example of this ?

We could probably help you more directly if you had included an example
of what you had tried.  Lacking that, the general form is:


# The 'c' flag tells procmail to send a copy and keep going
:0 c
* whatever conditions on the sending
! whomever(_at_)wher(_dot_)ever


Philip Guenther

------------------------------

Date: Mon, 16 Dec 1996 16:12:56 -0500
From: "Scott A. McIntyre" <scott(_at_)whoi(_dot_)edu>
To: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Subject: Formail and re-writing headers
Message-ID: <32B5BB58(_dot_)1E71(_at_)whoi(_dot_)edu>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

I'm having a devil of a time getting Formail/Smartlist and the Netscape
Mail server to play nicely on the creation of the "From:" header.

Specifically, my problem is this...if I don't put in my rc.local.s20 a
-R From: Reply-To: line, then all mail comes to the list as if it is
from the list, with no obvious trace of who actually sent the message.

If you expand the headers, there is often a clue, but it's not
obvious....putting the original senders address as a Reply-To seemed
like the best way to make sure people could always see who the original
sender was (not all email clients generate a Reply-To header on their
own).

The problem now is that The "Sender" is listed as the email address of
the list, rather than a nicer version such as "Unix Mailing List" -- so
what I'd like to know is how can I force formail to do BOTH of the
above...to insert a Reply-To: which is equal to the original sender of
the message and then insert a new From: line so that mail clients see
that the message is from "Unix Mailing List <unix(_at_)domain(_dot_)edu>"...

Sorry that this message is not entirely clear, I've spent all afternoon
trying to do this with different options and have sent over 300 test
messages...

Scott

------------------------------

Date: Mon, 16 Dec 1996 14:11:26 -0800
From: kendall shaw <kshaw(_at_)plight(_dot_)lbin(_dot_)com>
To: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Subject: procmail notifications
Message-Id: <199612162211(_dot_)OAA04117(_at_)plight(_dot_)lbin(_dot_)com>
Content-Type: text/plain; charset=US-ASCII

Hello,

I've read a bit about setting up filtering in procmail, but I still
don't see how to resolve my situation.  If I were to setup procmail,
how would I know where mail has gone?  After a weekend I typically
will have about 1000 messages waiting to be included (I use MH). I've
seen references to mailstat, but this would be pretty difficult for
me to use:

1. Run mailstat through less.
2. Visually scan for messages I wish to read, or which my filters missed.
3. Scan the corresponding folder with mh to find the message
4. Operate on the file
5. go to step 2

Are there any other options for me? I usually use MH through mh-e. 

------------------------------

Date: Mon, 16 Dec 1996 20:36:07 -0200 
From: Adriano Nagelschmidt Rodrigues <anr(_at_)ime(_dot_)usp(_dot_)br>
To: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE (Procmail mailing list)
Subject: Procmail + NFS
Message-ID: 
<19961216223608(_dot_)10089(_dot_)qmail(_at_)catatau(_dot_)ime(_dot_)usp(_dot_)br>

Hello,

Some time ago I changed my MTA from sendmail to qmail. qmail delivers mail
directly in my NFS mounted home directory. I recompiled procmail to change
the
default mailbox, and it works ok most of the time.

My problems begin when the host that serves my home dir goes down. When it's
up again, procmail seems to have some weird locking problems I can only solve
by changing the folder inode number. From the log file:

procmail: Forcing lock on "/home/specmac/anr/Mailbox.lock"
procmail: No match on "^To: linux-security(_at_)redhat(_dot_)com"
[SNIP]
procmail: No match on "^Sender: owner-msql-list(_at_)bunyip(_dot_)com"
procmail: Locking "/home/specmac/anr/Mailbox.lock"
procmail: [4124] Sun Nov 17 23:27:37 1996
procmail: Locking "/home/specmac/anr/Mailbox.lock"
procmail: [4124] Sun Nov 17 23:27:45 1996
procmail: Locking "/home/specmac/anr/Mailbox.lock"
procmail: [4124] Sun Nov 17 23:27:53 1996

And it goes on ad nauseam. Disabling procmail, killing process 4124 and
removing the lock file doesn't solve the problem. I have to do

mv Mailbox Mailbox.old; cp Mailbox.old Mailbox

also. Any ideas?

BTW, I'm using procmail v3.10 running in SunOS 4.1.3.

Thanks,

Adriano

------------------------------

Date: Mon, 16 Dec 1996 18:19:53 -0600
From: Philip Guenther <guenther(_at_)gac(_dot_)edu>
To: kshaw(_at_)plight(_dot_)lbin(_dot_)com
cc: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Subject: Re: procmail notifications 
Message-Id: <199612170019(_dot_)SAA06408(_at_)solen(_dot_)gac(_dot_)edu>

kendall shaw <kshaw(_at_)plight(_dot_)lbin(_dot_)com> writes:
I've read a bit about setting up filtering in procmail, but I still
don't see how to resolve my situation.  If I were to setup procmail,
how would I know where mail has gone?  After a weekend I typically
will have about 1000 messages waiting to be included (I use MH). I've
seen references to mailstat, but this would be pretty difficult for
me to use:

1. Run mailstat through less.
2. Visually scan for messages I wish to read, or which my filters missed.
3. Scan the corresponding folder with mh to find the message
4. Operate on the file
5. go to step 2

Are there any other options for me? I usually use MH through mh-e. 

I also use MH, and to avoid having mail refiled into some place I'll
forget about it, I decided that:

1) Mail directly refiled into MH folders will only go under one
      particular 'branch' of my folder tree, namely +Lists.  For
      example, all mail from this list is refiled in +Lists/procmail

2) Everything else will be left in $DEFAULT from which I'll 'inc' it
      into my inbox.


Since I keep the folders underneath +Lists empty or almost empty
(+Lists/procmail has 10 messages in it right now, yours being the
10th), I can easily see when new mail has arrived from a list by just
saying "folders +Lists".  By requiring a conscious action on my part to
put mail in +inbox, I make sure that I have at least that chance to see
what's come in.  Furthermore, I use the "unseen" sequence, as created
by 'inc' to keep track of what I haven't read yet.  Ta da, no
(accidentally) lost mail.

Philip Guenther

------------------------------

Date: Mon, 16 Dec 96 18:59:39 -0500
From: Timothy J Luoma <luomat(_at_)nerc(_dot_)com>
To: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Subject: grabbing the third line of the body
Message-Id: <199612162359(_dot_)SAA10651(_at_)nerc(_dot_)com>
Content-Type: text/plain

procmail is really getting to be fun.  However, I'm realizing that  
I don't know an awful lot about it, and I seem to be wanting to do  
things that the man pages don't seem to make reference to.

I have sent off for the "best of procmail" list and expect it soon.

Anyway, my current conundrum is this.

I get a certain mail message every day with the same subject from  
the same person.  The subject itself it _not_ very helpful.  What I  
would like is if I could get the third line of his email message,  
dump his useless subject, and replace the subject with the third  
line from the body.

It sounds easy enough, and I could do a 'head -3 | tail -1' to get  
it, but I'm not sure how to get that and replace the subject without  
destroying the rest of the message.

Thanks

TjL

--
Tj Luoma (luomat(_at_)peak(_dot_)org) / http://www.next.peak.org/~luomat
      
      *** I will be out of town from Dec 19th - Dec 31st ***

------------------------------

Date: Mon, 16 Dec 96 18:06:42 -0500
From: Timothy J Luoma <luomat(_at_)nerc(_dot_)com>
To: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Subject: cutting off the ends of messages by matching a certain line
Message-Id: <199612162306(_dot_)SAA09846(_at_)nerc(_dot_)com>
Content-Type: text/plain

I am on several lists which insist on giving me a very long blurb  
(sometimes longer than the message itself) at the end of each  
message sent to the list.

The "real" part of the message always ends the same way, so I would  
like to use that as a "trigger" and have procmail dump the rest of  
the message.  Is this possible?  Is it advisable?  Clues?

Thanks
TjL

--
Tj Luoma (luomat(_at_)peak(_dot_)org) / http://www.next.peak.org/~luomat
      
      *** I will be out of town from Dec 19th - Dec 31st ***

------------------------------

Date: Mon, 16 Dec 96 18:04:29 -0500
From: Timothy J Luoma <luomat(_at_)nerc(_dot_)com>
To: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Subject: calling 'procmail' recursively
Message-Id: <199612162304(_dot_)SAA09824(_at_)nerc(_dot_)com>
Content-Type: text/plain

I don't know if I am getting into dangerous ground here or not, but  
I couldn't find much about this in the man pages, so I just have to  
ask.

Anyway, I have this recipe here:

:0
* ^Subject: next-\/(announce|\
                  bugs|\
                  hardware|\
                  marketplace|\
                  misc|\
                  software|\
                  sysadmin)
{

      NEWSGROUP=comp.sys.next.$MATCH

      :0: proc-filter.lock
      |formail +1 -des \
       procmail -m /usr/local/bin/proc-filter $NEWSGROUP

}


that sends certain messages (Digests of the NeXT usenet groups) to  
a program called "proc-filter" which splits the digests into  
individual messages, checks for duplicates, and [currently] dumps  
the message to the $DEFAULT.

What I would _like_ to do, is have the messages be sent to  
"proc-filter", and when proc-filter is done with what it has to do,  
I would like it to send the individual messages that came from the  
digest _back_ to the top of the procmailrc, so processing can begin  
all over again (I can check for spammers, certain Subject lines I  
want to dump, etc).

I read through the man pages, but the closest I came to anything  
was the last sentence of 'man procmailrc' which reads:

    For really complicated processing you can even consider
    calling procmail recursively.

but gives no advice on doing so.

Is this a major no-no?  Am I about to rush in where angels fear to  
tread?  I don't see (in this example) where anything could cause an  
infinite loop, etc (although I see that as a possibility for some  
cases.)

What's the scoop?

Is it as easy as making the last part of "proc-filter"

:0: procmail-recusive-call.lock
|procmail

Nah, can't be that easy.

Thanks
TjL

--
Tj Luoma (luomat(_at_)peak(_dot_)org) / http://www.next.peak.org/~luomat
      
      *** I will be out of town from Dec 19th - Dec 31st ***

------------------------------

Date: Tue, 17 Dec 1996 02:27:42 -0500 (EST)
From: Ray Bagley <ray(_at_)innerx(_dot_)net>
To: Procmail Mailing List List 
<procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE>
Subject: Re: Procmail doesn't react to incoming mail 
Message-ID: 
<Pine(_dot_)LNX(_dot_)3(_dot_)93(_dot_)961217014634(_dot_)555D-100000(_at_)hewy(_dot_)fog(_dot_)net>
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Mon, 16 Dec 1996, Tony Nugent wrote:


On Fri Dec 13 1996, I wrote:

On Thu Dec 12 1996, "Alan K. Stebbens" wrote:

When you fetch mail from your ISP with "popclient", procmail doesn't
get
involved at all.  It can't.  Your ISP's mailer system is receiving the
mail, via SMTP, and probably with Sendmail, but even that isn't a sure
thing.

[...stuff about pop'ed email not locally delivering via SMTP...]

The solution is to use `fetchmail', which *can* be configured to
deliver pop'ed email locally via smtp (or even deliver it to another
host with smtp).


I wanted to try fetchmail but I'm not sure that what I downloaded was the
real thing. It's a perl script and when I attempt to run it, it spits out
errors about the syntax every 2 to 5 lines of script. I need a good
location to ftp the real mccoy from. Popclient seems to be a bit buggy and
I'm not happy with the way it handles things. I'm having other problems
with procmail but I would rather get a reliable retrieval system going
first before I worry too much with filtering.


[Disclaimer: I've never used either program... I'm just going by what
I've seen in other mailing lists and usenet.]

[...lsm about fetchmail-2.2...]

I retract this disclaimer and can now say categorically that fetchmail
does indeed deliver email locally via smtp.  It works just GREAT!


Good! I will be intouch for help _if_ you don't mind and if I need help.
Or better yet, is there a mailing list for fetchmail?


[  snip...  ]


At one time (around a year ago) I tried using `popclient', but did not
use it as the message headers (the `From ' line in particular) would
get totally mangled with the name of my local host substituted from
what was in there originally!  It did not deliver locally via smtp but
directly into a local file, my $MAIL file by default (unless I missed
something fundamental in the docs for it).  Absolutely no good at all
for my purposes.


It's doing a little number on the From lines with me too. I always have an
empty message at the top of the list that is caused by the way popclient
handles them.


After reading the man page that Tony was kind enough to post I can see
that fetchmail is what I need. So all I need is to know where I can get
it. 




Ray

ps; Thanks to those who responded earlier with help on getting started
with procmail. I got exactly what I needed from your posts.

------------------------------

Date: Tue, 17 Dec 1996 17:53:34 +1000
From: Tony Nugent <tony(_at_)trishul(_dot_)sci(_dot_)gu(_dot_)edu(_dot_)au>
To: luomat(_at_)peak(_dot_)org
cc: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Subject: Re: cutting off the ends of messages by matching a certain line 
Message-Id: 
<199612170753(_dot_)RAA14785(_at_)sctnugen(_dot_)ppp(_dot_)gu(_dot_)edu(_dot_)au>
Content-Type: text/plain; charset="us-ascii"
Content-ID: 
<14781(_dot_)850809213(_dot_)1(_at_)sctnugen(_dot_)ppp(_dot_)gu(_dot_)edu(_dot_)au>

On Mon Dec 16 1996, Timothy J Luoma wrote:

I am on several lists which insist on giving me a very long blurb  
(sometimes longer than the message itself) at the end of each  
message sent to the list.

The "real" part of the message always ends the same way, so I would  
like to use that as a "trigger" and have procmail dump the rest of  
the message.  Is this possible?  Is it advisable?  Clues?

Filter the message through sed.  As an example, this is what I use on
every message I get delivered (and it works _really_ well :)

# strip out ALL trailing spaces and ugly PGP garbage
#
:0fBW
* (BEGIN|END) PGP (SIG(NATURE|NED MESSAGE)|PUBLIC KEY BLOCK)
| sed -e 's+ *$++' \
      -e 's/^- //' \
      -e '/BEGIN PGP SIGNED MESSAGE/d' \
      -e '/BEGIN PGP SIGNATURE/,/END PGP SIGNATURE/d' \
      -e '/BEGIN PGP PUBLIC KEY BLOCK/,/END PGP PUBLIC KEY BLOCK/d'

As long as the start/end strings that you look for at the same, then
the sed command '/start/,/end/d' will munch out the garbage that you
want to get rid of.  Easy, no?  :)

Cheers                               .
Tony                             _--_|\ 
   tony(_at_)trishul(_dot_)sci(_dot_)gu(_dot_)edu(_dot_)au  /     *\ 
T(_dot_)Nugent(_at_)sct(_dot_)gu(_dot_)edu(_dot_)au
   
ae(_dot_)nugent(_at_)student(_dot_)qut(_dot_)edu(_dot_)au\_(_dot_)--(_dot_)_/ 
 tnugent(_at_)cit(_dot_)gu(_dot_)edu(_dot_)au
   tony(_at_)sctnugen(_dot_)ppp(_dot_)gu(_dot_)edu(_dot_)au       v  Brisbane 
Qld Australia
  -=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-

------------------------------

Date: Tue, 17 Dec 1996 18:08:08 +1000
From: Tony Nugent <tony(_at_)trishul(_dot_)sci(_dot_)gu(_dot_)edu(_dot_)au>
To: luomat(_at_)peak(_dot_)org
cc: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Subject: Re: grabbing the third line of the body 
Message-Id: 
<199612170808(_dot_)SAA14822(_at_)sctnugen(_dot_)ppp(_dot_)gu(_dot_)edu(_dot_)au>
Content-Type: text/plain; charset="us-ascii"
Content-ID: 
<14818(_dot_)850810087(_dot_)1(_at_)sctnugen(_dot_)ppp(_dot_)gu(_dot_)edu(_dot_)au>

On Mon Dec 16 1996, Timothy J Luoma wrote:

procmail is really getting to be fun.  However, I'm realizing that  
I don't know an awful lot about it, and I seem to be wanting to do  
things that the man pages don't seem to make reference to.

:-)

I have sent off for the "best of procmail" list and expect it soon.

Oohaah!  Mention of this has gone by me... where/how can I get my
hands on this?

Anyway, my current conundrum is this.

I get a certain mail message every day with the same subject from  
the same person.  The subject itself it _not_ very helpful.  What I  
would like is if I could get the third line of his email message,  
dump his useless subject, and replace the subject with the third  
line from the body.

It sounds easy enough, and I could do a 'head -3 | tail -1' to get  
it, but I'm not sure how to get that and replace the subject without  
destroying the rest of the message.

sed to the rescue.  This will grab the third line (and only the third
line) from any file:

sed -n 3p

So create a recipe that:
- looks for this message,
- filters a copy of the body of the message through sed and put the
 result into an environment variable, something like (untested):
   LINE3=|sed -n 3p
- send the message through formail to replace the current subject
 line with what you have obtained from line 3, eg:
   | formail -i"Subject: $LINE3" 
- deliver the message.

Hope this helps.

Cheers
Tony

--------------------------------
End of procmail-d Digest V96 Issue #186
***************************************



<Prev in Thread] Current Thread [Next in Thread>
  • Re:, Larry Vaden <=