procmail
[Top] [All Lists]

Re: Getting info from the envelope How ?

1997-05-20 09:29:00
Tim Simpson <tsimpson(_at_)dundeecity(_dot_)gov(_dot_)uk> writes:
is there anyway I can use procmail to extract things that are
in the envelope of an email

By convention, the envelope is "out of band" data: it does not normally
appear in the text of a message in transit, and therefore cannot be
'extracted'.  The solution is usually to pass the information to
procmail via the command line, i.e., leave it out-of-band.


I have a perl script which gateways internet mail into a propietary X400
email system.

the script is called from a procmailrc file and gets all its info
from the headers but I have come across a couple of mailing lists
where I cannot find who the recipient is from the headers and must presume
it is in the envelope details.

I'm after two things 

1. can some suggest a method to capture the envelope to prove th
at this indeed is the case

Well, I'll confirm this is problem, so we can skip directly to solving it.
The solution will then serve as the proof that this was the problem.  :-)


2. if the above is true a method to extract info from the envelope
  so that I can call my script with a param of the recipient

I am currently running sendmail 8.6.12 and procmail 3.10


In order to capture the envelope, you'll need to pass the envelope to
procmail.  You describe above what happens to the message ouce it gets
into procmail.  Now you need to describe how sendmail invokes
procmail.  Do you have a mailertable entry?  A virtuser table entry?
A pile of aliases?  Or did you hand hack the .cf to route mail to procmail?  
The first one
is easy, as sendmail is already passing the envelope addresses to
procmail, the second one is tricky, and depends on how procmail is
finally invoked, the third is horrible and should be replaced, and
the last is requires the rules to munged slightly.

Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>