]>
git.proxmox.com Git - pmg-api.git/blob - PMG/RuleDB/Attach.pm
1 package PMG
::RuleDB
::Attach
;
10 use PMG
::RuleDB
::Object
;
13 use base
qw(PMG::RuleDB::Object);
40 my ($type, $ogroup) = @_;
42 my $class = ref($type) || $type;
44 my $self = $class->SUPER::new
($class->otype(), $ogroup);
50 my ($type, $ruledb, $id, $ogroup, $value) = @_;
52 my $class = ref($type) || $type;
54 my $obj = $class->new ($ogroup);
57 $obj->{digest
} = Digest
::SHA
::sha1_hex
($id, $ogroup);
63 my ($self, $ruledb) = @_;
65 defined($self->{ogroup
}) || die "undefined object attribute: ERROR";
67 if (defined ($self->{id
})) {
72 my $sth = $ruledb->{dbh
}->prepare(
73 "INSERT INTO Object (Objectgroup_ID, ObjectType) VALUES (?, ?);");
75 $sth->execute($self->ogroup, $self->otype);
77 $self->{id
} = PMG
::Utils
::lastid
($ruledb->{dbh
}, 'object_id_seq');
84 my ($self, $queue, $ruledb, $mod_group, $targets,
85 $msginfo, $vars, $marks) = @_;
87 my $subgroups = $mod_group->subgroups($targets);
89 foreach my $ta (@$subgroups) {
90 my ($tg, $entity) = (@$ta[0], @$ta[1]);
92 my $spooldir = $PMG::MailQueue
::spooldir
;
93 my $path = "$spooldir/active/$queue->{uid}";
96 Filename
=> "original_message.eml",
97 Disposition
=> "attachment",
98 Type
=> "message/rfc822");
105 return "attach original mail";
113 =head1 PMG::RuleDB::Attach
115 Attach original mail.