Fix bad angle bracket handling in messageIds in Main/Send.pm
Extend Mail/Send.t to test messageId generation.
This commit is contained in:
parent
4f5a010faa
commit
70845fd9e8
4 changed files with 134 additions and 24 deletions
|
|
@ -294,11 +294,13 @@ sub create {
|
|||
my $id = $headers->{messageId} || "WebGUI-" . $session->id->generate;
|
||||
if ($id !~ m/\@/) {
|
||||
my $domain = $from;
|
||||
$domain =~ s/.*\@//msx;
|
||||
$domain =~ s/^.*\@//msx;
|
||||
$domain =~ s/>$//msx;
|
||||
$id .= '@' . $domain;
|
||||
}
|
||||
if ($id !~ m/[<>]/msx) {
|
||||
$id = "<$id>";
|
||||
if ($id !~ m/^<.+?>$/msx) {
|
||||
$id =~ s/(^<)|(>$)//msxg;
|
||||
$id = "<".$id.">";
|
||||
}
|
||||
my $message = MIME::Entity->build(
|
||||
Type=>$type,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue