procmail
[Top] [All Lists]

It should be easy I sed ...

2000-10-05 02:27:02
Thanks for the alternate scripts, my script is
working but I will experiment using alternate
suggestions.  I got out my O'reilly unix book
and and tried to use sed again:

I use this recipe to write the date, sender, and subject of an
email coming into a Gatekeeper email account to a file:

:0 wci:
  * ^Subject:[        ]+\/.*
 | echo "`date` $ORIG -" $MATCH  >>$HOME/mail_log

Here is the entry:

Wed Oct  4 15:43:24 CDT 2000 bozo(_at_)bozo(_dot_)com - MailWeb: final test 
remove
hdr *-bozo(_at_)bozo(_dot_)com

I did $ in the vi editor and it treated this wrapped line as one line.

Now, later on I am going to get a return email with the following subject:

Re: MailWeb: final test remove hdr *-bozo(_at_)bozo(_dot_)com

Since a reply has been sent, I want to delete the line in the file
mail_log so I know the sent/reply sent loop is complete.

I thought sed would be easy for this one - find a match on part of the
previous subject line written to file and delete it:

# remove the original email header from monitor file
:0 wci:
   * ^Subject:[  ]+
   | sed -e '/^Subject: Re: /d'

The line in the file didn't get deleted, but the procmail log says
this script executed

procmail: Assigning "MATCH="
procmail: Matched "MailWeb: final test remove hdr *-bozo(_at_)bozo(_dot_)com"

Is this match for the line * ^Subject:[  ]+, and nothing gets
reported in procmail log for | sed -e '/^Subject: Re: /d' ??
If so, I would expect a "Re: " in the match, right?

I suppose I have done something wrong ...
==============
Is there a shorter version of 'date', rather than the long version
Wed Oct  4 15:43:24 CDT 2000   ???
===================

By the way, for anyone using a unix shell account, I had lines
in my procmailrc file that looked like this:

| formail -cz -I "From: bozo(_at_)bozo(_dot_)com" \(one space character)

The extra space at the end of this line, or of bracketed lines
caused procmail 'skipping line' errors.  About half my email
to club members wasn't going out because of this error!

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • It should be easy I sed ..., tomcat <=