2002-07-03 15:10:44 +02:00
|
|
|
package Qpsmtpd::Transaction;
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
sub new { start(@_) }
|
|
|
|
|
|
|
|
sub start {
|
|
|
|
my $proto = shift;
|
|
|
|
my $class = ref($proto) || $proto;
|
|
|
|
my %args = @_;
|
2002-07-04 03:45:19 +02:00
|
|
|
my $self = { _rcpt => [], started => time };
|
2002-07-03 15:10:44 +02:00
|
|
|
bless ($self, $class);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub add_recipient {
|
|
|
|
my $self = shift;
|
2002-07-04 03:45:19 +02:00
|
|
|
@_ and push @{$self->{_recipients}}, shift;
|
|
|
|
}
|
2002-07-03 15:10:44 +02:00
|
|
|
|
2002-07-04 03:45:19 +02:00
|
|
|
sub recipients {
|
|
|
|
my $self = shift;
|
|
|
|
($self->{_recipients} ? @{$self->{_recipients}} : ());
|
2002-07-03 15:10:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
sub sender {
|
|
|
|
my $self = shift;
|
|
|
|
@_ and $self->{_sender} = shift;
|
|
|
|
$self->{_sender};
|
2002-07-06 04:09:01 +02:00
|
|
|
}
|
2002-07-03 15:10:44 +02:00
|
|
|
|
2002-07-06 04:09:01 +02:00
|
|
|
sub header {
|
|
|
|
my $self = shift;
|
|
|
|
@_ and $self->{_header} = shift;
|
|
|
|
$self->{_header};
|
2002-07-03 15:10:44 +02:00
|
|
|
}
|
|
|
|
|
2002-07-06 04:09:01 +02:00
|
|
|
sub body {
|
|
|
|
my $self = shift;
|
|
|
|
@_ and $self->{_body} = shift;
|
|
|
|
$self->{_body};
|
|
|
|
}
|
2002-07-04 03:45:19 +02:00
|
|
|
|
2002-07-06 04:09:01 +02:00
|
|
|
sub blocked {
|
|
|
|
my $self = shift;
|
|
|
|
@_ and $self->{_blocked} = shift;
|
|
|
|
$self->{_blocked};
|
2002-07-04 03:45:19 +02:00
|
|
|
}
|
|
|
|
|
2002-07-08 04:30:11 +02:00
|
|
|
sub notes {
|
|
|
|
my $self = shift;
|
|
|
|
my $key = shift;
|
|
|
|
@_ and $self->{_notes}->{$key} = shift;
|
|
|
|
$self->{_notes}->{$key};
|
|
|
|
}
|
2002-07-04 03:45:19 +02:00
|
|
|
|
2002-07-06 04:09:01 +02:00
|
|
|
#sub add_header_line {
|
|
|
|
#}
|
|
|
|
|
|
|
|
#sub add_body_line {
|
|
|
|
#}
|
2002-07-04 03:45:19 +02:00
|
|
|
|
2002-07-03 15:10:44 +02:00
|
|
|
1;
|