0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00

Merge pull request #167 from csware/recipient_delimiter

vacation: Correctly process mails with recipient_delimiter
This commit is contained in:
David Goodwin 2018-07-27 15:19:32 +01:00 committed by GitHub
commit c3d3898eb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,6 +51,8 @@ our $db_name = 'postfix';
our $vacation_domain = 'autoreply.example.org';
our $recipient_delimiter = '+';
# smtp server used to send vacation e-mails
our $smtp_server = 'localhost';
# port to connect to; defaults to 25 for non-SSL, 465 for 'ssl', 587 for 'starttls'
@ -611,6 +613,9 @@ if($smtp_recipient =~ /\@$vacation_domain/) {
my $tmp = $smtp_recipient;
$tmp =~ s/\@$vacation_domain//;
$tmp =~ s/#/\@/;
if ($recipient_delimiter) {
$tmp =~ s/[\Q$recipient_delimiter\E].+$//;
}
$logger->debug("Converted autoreply mailbox back to normal style - from $smtp_recipient to $tmp");
$smtp_recipient = $tmp;
undef $tmp;