mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 08:40:24 +00:00
Add function to remove spam prefix
This commit is contained in:
@@ -3799,4 +3799,19 @@ else {
|
||||
}
|
||||
}
|
||||
|
||||
# remove_spam_subject(&mail)
|
||||
# Removes the [spam] prefix from the subject, if there is one
|
||||
sub remove_spam_subject
|
||||
{
|
||||
my ($mail) = @_;
|
||||
my $rv = 0;
|
||||
foreach my $h (@{$mail->{'headers'}}) {
|
||||
if (lc($h->[0]) eq 'subject' && $h->[1] =~ /^\[spam\]\s*(.*)$/i) {
|
||||
$h->[1] = $1;
|
||||
$rv = 1;
|
||||
}
|
||||
}
|
||||
return $rv;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
Reference in New Issue
Block a user