Hi Folks,

Fedora 2
qpsmtpd-0.32

I working on a plugin and am having trouble with $transaction->notes() and
$transaction->header->add().  Here is my pared down code.

sub hook_rcpt {
        my ($self, $transaction, $recipient) = @_;
        $transaction->notes('note-test', 'Hello World');
        return DECLINED;
}

sub hook_data {
        my ($self, $transaction) = @_;
        my $note = $transaction->notes('note-test');
        $transaction->header->add('X-TEST-Header', $note) if $note;
        return DECLINED;
}

The transaction notes don't always stick around from the RCPT stage until
the DATA stage.  When they do stick around I get this error message when
trying to add a header:

2006-05-30 12:00:36.957405500 30016 FATAL PLUGIN ERROR:  Can't call method
"add" on an undefined value at ./plugins/note_test line 11, <STDIN> line 4.

As an experiment I also tried adding this header and still got the same
error message:

        $transaction->header->add('X-TEST-Header', 'Testing');

Any ideas why I'm having these two problems?

Also can anyone tell me the difference between $transaction->notes() and
$self->qp->connection->notes()?

Thanks in advance for any help!

Nedry

Reply via email to