procmail
[Top] [All Lists]

Re: More Matching questions - regexp

2000-09-27 09:42:57
Hi,

tomcat(_at_)visi(_dot_)com wrote:
My Procmail script is for the Gatekeeper.
The email is saved and a copy of the email is sent to
a Destination email account, usually a club officer.
Multiple Destination accounts can be chosen.  


What would you think of hiding information in the "From:" field and
"plus addressing"?  e.g., rather than the below...

To: clubofficer(_at_)bozo(_dot_)com
From: Gatekeeper(_at_)bozo(_dot_)com
Subject: Webmail: The user's subject here *- bozo(_at_)bozo(_dot_)com

have the From: field look like

  From: Gatekeeper+uniqueID(_at_)bozo(_dot_)com

and potentially leave subject: alone?

The destination replies to Gatekeeper+uniqueID (this might be a
sequence number or a sanitized date/time string), and your procmail
script can look for 

  :0
  * ^TO_gatekeeper\+\/[0-9]+
  {
     SEQNUM=$MATCH
     # then continue processing using $SEQNUM


I've done the "plus" addressing trick at my home email, and at least
sendmail and qmail handle it just fine -- that is, mail addressed to
xyzzy+collin(_at_)myisp(_dot_)com or xyzzy+wifes_name(_at_)myisp(_dot_)com goes 
to the same
mailbox as xyzzy(_at_)myisp(_dot_)com does.  Once the mail is in the mailbox,
procmail can see if it says "+collin" or "+wifes_name" and put it into 
appropriate mailbox[es] on my local machine accordingly.

...
I can't change any of these fields.  The Destination replies to the 
Gatekeeper

To: Gatekeeper(_at_)bozo(_dot_)com
From: clubofficer(_at_)bozo(_dot_)com
Subject: Re: Webmail: The user's subject here *- bozo(_at_)bozo(_dot_)com

Using the above scheme the reply could look like this:

  To: Gatekeeper+12345(_at_)bozo(_dot_)com
  From:  [[ as above ]]


who in turn sends it back to the Originator - providing there is 
some way to preserve the Originator's email address. 

by indexing off the +12345 field, grep(1)ing thru the log, etc.?

I want a copy of the original and of the reply in the Gatekeeper account, 
because I write the subjects to a log file, and can
tell if the club officers have responded to the Originators
email.  In the logfile I should see pairs:

Webmail: The user's subject here *- bozo(_at_)bozo(_dot_)com
Re: Webmail: The user's subject here *- bozo(_at_)bozo(_dot_)com

You could log the auto-generated serial# with the log of the user's
email.  IOW

  Webmail: The user's subject here !!12345!! *- bozo(_at_)bozo(_dot_)com

then grep for !!$MATCH!! in the log, find the bozo(_at_)bozo(_dot_)com address,
and re-route accordingly....

I absolutely refuse to have folks email the club
and not know if a response from the club got sent.  After
3 days or so, if the club officer did not respond, I respond
or forward the original to someone else to respond to.

Makes sense.


Finally, procmail deals with the reply by looking for "Re: Webmail:"
(of course, I will make the first line in the body of the original
to say don't change the subject line when replying).  Here is
where I need to strip out the email address from the subject line:

To: bozo(_at_)bozo(_dot_)com
From: clubofficer(_at_)bozo(_dot_)com
Subject: Re: Webmail: The user's subject here *- bozo(_at_)bozo(_dot_)com


Stripping email from subject could look like this

    :0fhw
    * ^TO_gatekeeper\+[0-9]+@
    * ^Subject: *re:.*@
    * Any.other.conditions.you.need??
    | sed -e '/^Subject:/s/\*-.*$//'

if you still need to do it.

hth
-- 
Neither I nor my employer will accept any liability for any problems
or consequential loss caused by relying on this information.  Sorry.
Collin Park                         Not a statement of my employer.

_______________________________________________
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>