Mailing List Archive

Exim,Perl, strange Configuration Wish :-)
Hello

I am currently trying to extend our mailserver (exim 3.35). The
problem is the following:

Everytime one email comes in, a special program has to start, that makes
several things in the system. (Work with the header lines, write something
into an mysql db and finally decode the mail for later purposes). This
can't be done in user filters, because every email has to be inspected
und a system filter would inspect the email at the wrong places/times.

Therefore I decided to add a perl "lookup" in my appendfile-transport, that
would examine the special email and gives back the place where to
store this email (generall /var/spool/virtual/mail/<user_id). All Emails
are handled as user "mail" and group "mail".

I need to use the message_body in this perl-script in its original format.
$message_body does not help, because it is limited (of course I set
$message_body_visible to a very high value) and all newlines are missing.

My Question is now: How can I get the whole message or message_body in
this case. And if there is now variable for this purpose, is it possible
to add this variable to newer versions of exim?

Tilo
Re: Exim,Perl, strange Configuration Wish :-) [ In reply to ]
On Fri, 24 May 2002, Tilo Buschmann wrote:

> Therefore I decided to add a perl "lookup" in my appendfile-transport, that
> would examine the special email and gives back the place where to
> store this email (generall /var/spool/virtual/mail/<user_id). All Emails
> are handled as user "mail" and group "mail".
>
> I need to use the message_body in this perl-script in its original format.
> $message_body does not help, because it is limited (of course I set
> $message_body_visible to a very high value) and all newlines are missing.
>
> My Question is now: How can I get the whole message or message_body in
> this case. And if there is now variable for this purpose, is it possible
> to add this variable to newer versions of exim?

No. The values of variables are strings held in memory. Consider the
disaster that might happen if Exim tried to hold a 500 MB (or larger)
message as one string in memory...

One thing you can do is to pass the message ID to your program, and then
read the -D file off the spool disc. This is a hack, but it might work.
Of course, you'll somehow have to figure a way of permitting the file to
be read.



--
Philip Hazel University of Cambridge Computing Service,
ph10@cus.cam.ac.uk Cambridge, England. Phone: +44 1223 334714.