mirror of
https://github.com/MailScanner/v5.git
synced 2024-11-10 09:13:31 +08:00
Remove and add back recipients (#298)
This commit is contained in:
parent
d80fa6490d
commit
840eb57b76
1 changed files with 32 additions and 5 deletions
|
@ -832,16 +832,43 @@ sub new {
|
|||
return 0;
|
||||
}
|
||||
|
||||
# Unused in MSMail
|
||||
# Delete the original recipients from the message. We'll add some
|
||||
# using AddRecipients later.
|
||||
sub DeleteRecipients {
|
||||
return;
|
||||
my $this = shift;
|
||||
my($message) = @_;
|
||||
|
||||
my($linenum);
|
||||
for ($linenum=0; $linenum<@{$message->{metadata}}; $linenum++) {
|
||||
next unless $message->{metadata}[$linenum] =~ /^O/;
|
||||
# Have found the right line
|
||||
splice(@{$message->{metadata}}, $linenum, 1);
|
||||
$linenum--; # Study the same line again
|
||||
}
|
||||
}
|
||||
|
||||
# Unused in MSMail
|
||||
# Add the recipient records back to the metadata
|
||||
sub AddRecipients {
|
||||
return;
|
||||
my $this = shift;
|
||||
my($message, @recips) = @_;
|
||||
|
||||
# Remove all the duplicates @recips
|
||||
my %uniqueto;
|
||||
foreach (@recips) {
|
||||
$uniqueto{$_} = 1;
|
||||
}
|
||||
@recips = keys %uniqueto;
|
||||
|
||||
#my $totallines = @{$message->{metadata}};
|
||||
|
||||
foreach (@recips) {
|
||||
s/^/O/;
|
||||
}
|
||||
|
||||
splice @{$message->{metadata}}, 0, 0, @recips;
|
||||
|
||||
}
|
||||
|
||||
|
||||
sub KickMessage {
|
||||
my($queue2ids, $sendmail2) = @_;
|
||||
my($queue);
|
||||
|
|
Loading…
Reference in a new issue