RE: alter email body

[email protected] ("Sydney Bogaert")
Newsgroups perl.qpsmtpd
Message-ID <20DA2BF2FB30E644AB655C0DD7F658B1AA584C@exchange.interne.igretec.be>
Hi,

You will have to code it in the queue hook.
This is how I dit it a long time ago...

Sydney

-----Message d'origine-----
De : Nod Nod [mailto:[email protected]] 
Envoyé : mercredi 22 février 2012 10:08
À : [email protected]
Objet : alter email body

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.