alter email body

[email protected] (Nod Nod)
Newsgroups perl.qpsmtpd
Message-ID <CAD_piv1xooesA-OgLrg_zdX87xkEShRzAtngePsfgpcbLd91xw@mail.gmail.com>
Hi,
i am looking for an way to add an mulitpart/alternative disclaimer to an
email.
A simple $transaction->body_write($my_mime) did not work.

Here is what i coded so far:

use MIME::Entity;
use MIME::Parser;

sub register {
        my ($self, $qp) = @_;
        $self->register_hook("data_post", "addsig");
}

sub addsig {
        my ($self, $transaction) = @_;

        $transaction->body_resetpos;
        my $ent = MIME::Entity->build('Type' =>
"multipart/alternative",
                                );
        $ent->attach(Path => "/etc/qpsmtpd/sigs/disc.txt");
        $ent->attach(Path => "/etc/qpsmtpd/sigs/disc.html");
        $transaction->body_write($ent->as_string);
        return (DECLINED);
}

As far as i can see, nothing hapened. The email goes through the plugin
without being altered.

Does someone of you have a suggestion?

regards
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.