diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 134cdb2fb..1d5b81753 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -50,6 +50,10 @@ - fix: gaant chart not aligning correctly in firefox - fix: fixed obscure bug which was causing dependencies to display incorrectly in certain cases - fix: various time tracking issues + - fix: cs mail posts - no url prepending + - Multiple "Re:"'s on CS Mail posts are now a thing of the past. + - Made mail message ids follow convention. + 6.99.3 - Someone removed the status from the submission templates. That has been diff --git a/lib/WebGUI/Asset/Post.pm b/lib/WebGUI/Asset/Post.pm index bb870174d..775fe1090 100644 --- a/lib/WebGUI/Asset/Post.pm +++ b/lib/WebGUI/Asset/Post.pm @@ -679,9 +679,6 @@ sub processPropertiesFromFormPost { } $self->getThread->subscribe if ($self->session->form->process("subscribe")); delete $self->{_storageLocation}; - my $storage = $self->getStorageLocation; - my $attachmentLimit = $self->getThread->getParent->get("attachmentsPerPost"); -# $storage->addFileFromFormPost("image", $attachmentLimit) if $attachmentLimit; $self->postProcess; $self->requestCommit; } @@ -900,7 +897,10 @@ sub update { ); $self->SUPER::update(@_); if ($self->get("ownerUserId") ne $before{owner} || $self->get("groupIdEdit") ne $before{edit} || $self->get("groupIdView") ne $before{view}) { - $self->getStorageLocation->setPrivileges($self->get("ownerUserId"),$self->get("groupIdView"),$self->get("groupIdEdit")); + my $storage = $self->getStorageLocation; + if (-d $storage->getPath) { + $storage->setPrivileges($self->get("ownerUserId"),$self->get("groupIdView"),$self->get("groupIdEdit")); + } } } diff --git a/lib/WebGUI/Mail/Send.pm b/lib/WebGUI/Mail/Send.pm index 74f8bdacd..4b24e09cd 100644 --- a/lib/WebGUI/Mail/Send.pm +++ b/lib/WebGUI/Mail/Send.pm @@ -216,14 +216,14 @@ sub create { } } } - my $returnPath = $session->setting->get("mailReturnPath"); - $returnPath = "<".$returnPath.">" if $returnPath; - my $from = $headers->{from}; - $from = $session->setting->get("companyEmail") if ($from eq ""); - my $type = $headers->{contentType}; - $type = "multipart/mixed" if ($type eq ""); - my $id = $headers->{messageId}; - $id = "WebGUI-".$session->id->generate if ($id eq ""); + my $from = $headers->{from} || $session->setting->get("companyEmail"); + my $type = $headers->{contentType} || "multipart/mixed"; + my $domain = $from; + $domain =~ s/\@(.*)/$1/; + my $id = $headers->{messageId} || "WebGUI-".$session->id->generate; + unless ($id =~ m/\@/) { + $id .= '@'.$domain; + } my $message = MIME::Entity->build( Type=>$type, From=>$from, @@ -232,12 +232,14 @@ sub create { Bcc=>$headers->{bcc}, "Reply-To"=>$headers->{replyTo}, "In-Reply-To"=>$headers->{inReplyTo}, - "Return-Path"=>$returnPath, Subject=>$headers->{subject}, "Message-Id"=>$id, Date=>$session->datetime->epochToMail, "X-Mailer"=>"WebGUI" ); + $message->head->delete("Return-Path"); + $message->head->add("Return-Path", "<". ($session->setting->get("mailReturnPath") || $from) . ">"); + my $type = $headers->{contentType}; if ($session->config->get("emailOverride")) { my $to = $headers->{to}; $to = "WebGUI Group ".$headers->{toGroup} if ($headers->{toGroup}); diff --git a/lib/WebGUI/Workflow/Activity/GetCsMail.pm b/lib/WebGUI/Workflow/Activity/GetCsMail.pm index 403368277..c0ce46300 100644 --- a/lib/WebGUI/Workflow/Activity/GetCsMail.pm +++ b/lib/WebGUI/Workflow/Activity/GetCsMail.pm @@ -100,11 +100,16 @@ sub addPost { $prefix =~ s/\//\\\//g; my $title = $message->{subject}; $title =~ s/$prefix//; + if ($title =~ m/re:/i) { + $title =~ s/re://ig; + $title = "Re: ".$title; + $title =~ s/\s+/ /g; + } my $post = $parent->addChild({ className=>$class, title=>$title, menuTitle =>$title, - url=>$title, + url=>$parent->get("url")."/".$title, content=>$content, ownerUserId=>$user->userId, username=>$user->profileField("alias") || $user->username, @@ -188,7 +193,7 @@ sub execute { } my $post = undef; if ($message->{inReplyTo}) { - $message->{inReplyTo} =~ m/cs\-([\w_-]{22})/; + $message->{inReplyTo} =~ m/cs\-([\w_-]{22})\@/; my $id = $1; $post = WebGUI::Asset->newByDynamicClass($self->session, $id); }