Hi Mark0v,
You indicated in the release announcement that using a
Mail::Message->read() will strip (X-)Status fields. This causes a
problem with the way I am using the Mail::Message->read function... :(
I am using Mail::Box to handle mail within our virus/spam scanning
system. When identified as spam, mail can be quarantined into a
Postgresql database which users can then browse through a web interface.
If mail has been incorrectly quarantined a user can select it to be
delivered and a flag is set in the database. A daemon detects the flag
has been set, retrieves the mail from the database and sends it as an
attachment to the intended recipient using the following code:
my $nested = Mail::Message::Body::Nested->new (
nested => Mail::Message->read ($head.$body));
my $msg = Mail::Message->build (
From => $postmaster, To => $h_envelope_to,
Subject => $h_subject, data => $prelude, attach => $nested);
$head and $body are retrieved from the database via DBD::Pg and are the
$msg->head and $msg->body of the mail which was originally scanned...
Users should receive the full headers of the quarantined message but
with the new release some would be removed. This unfortunately includes
those with information as to why the mail was quarantined...
Is there an alternative to using read() in this way? I have been
considering extending Mail::Box itself to handle messages stored in a
Postgresql Database, treating it as just another mailbox format. This
would then allow the web interface to use a Mail::Box style interface
and allow me to hide away more of the datbase... I hope it would also
assist in provding POP/IMAP access to quarantined mail in the future.
Over all would this be the better solution?
Any suggestions appreciated,
Tim
On Thu, 2003-07-10 at 09:37, Mark Overmeer wrote:
> Hi,
>
> Did take some while between releases, mainly due to my trip to
> YAPC::NA, but hereby I present the latest version. The full
> changelog is attached, but the main changes explained:
>
> - Many documentation extensions, which now show the benefits of
> the OODoc transition made. The new documentation index will
> show you how much has been added (Mail::Box-Index)
>
> - Many people with large mailboxes have complained about the
> memory consumption of Mail::Box. Two major improvements:
>
> 1) Todd Richmond has implemented a replacement for IO::Scalar
> [which has a memory leak!!], and this is now included as
> Mail::Box::FastScalar.
>
> 2) A new $msg->destruct(), which flags a message for deletion,
> and immediately releases the memory consumed by header and
> body (not the flags etc). If you use it, do it with care!!
>
> my $folder = $msg->open('InBox', extract => 'LAZY');
> for my $msg ($folder->messages)
> { ...;
> $msg->destruct;
> }
>
> Please test!
>
> - Mail::Message->read() and bounce() will strip (X-)Status fields:
> they are for the user's internal administration and should not be
> accidentally disturbed by received messages.
>
> I expect another release next week, but please test this release and
> give me feed-back.
|