- 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.
This commit is contained in:
JT Smith 2006-06-14 17:48:38 +00:00
parent 24ed8f3e3f
commit e225c2276a
4 changed files with 26 additions and 15 deletions

View file

@ -50,6 +50,10 @@
- fix: gaant chart not aligning correctly in firefox - fix: gaant chart not aligning correctly in firefox
- fix: fixed obscure bug which was causing dependencies to display incorrectly in certain cases - fix: fixed obscure bug which was causing dependencies to display incorrectly in certain cases
- fix: various time tracking issues - 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 6.99.3
- Someone removed the status from the submission templates. That has been - Someone removed the status from the submission templates. That has been

View file

@ -679,9 +679,6 @@ sub processPropertiesFromFormPost {
} }
$self->getThread->subscribe if ($self->session->form->process("subscribe")); $self->getThread->subscribe if ($self->session->form->process("subscribe"));
delete $self->{_storageLocation}; delete $self->{_storageLocation};
my $storage = $self->getStorageLocation;
my $attachmentLimit = $self->getThread->getParent->get("attachmentsPerPost");
# $storage->addFileFromFormPost("image", $attachmentLimit) if $attachmentLimit;
$self->postProcess; $self->postProcess;
$self->requestCommit; $self->requestCommit;
} }
@ -900,7 +897,10 @@ sub update {
); );
$self->SUPER::update(@_); $self->SUPER::update(@_);
if ($self->get("ownerUserId") ne $before{owner} || $self->get("groupIdEdit") ne $before{edit} || $self->get("groupIdView") ne $before{view}) { 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"));
}
} }
} }

View file

@ -216,14 +216,14 @@ sub create {
} }
} }
} }
my $returnPath = $session->setting->get("mailReturnPath"); my $from = $headers->{from} || $session->setting->get("companyEmail");
$returnPath = "<".$returnPath.">" if $returnPath; my $type = $headers->{contentType} || "multipart/mixed";
my $from = $headers->{from}; my $domain = $from;
$from = $session->setting->get("companyEmail") if ($from eq ""); $domain =~ s/\@(.*)/$1/;
my $type = $headers->{contentType}; my $id = $headers->{messageId} || "WebGUI-".$session->id->generate;
$type = "multipart/mixed" if ($type eq ""); unless ($id =~ m/\@/) {
my $id = $headers->{messageId}; $id .= '@'.$domain;
$id = "WebGUI-".$session->id->generate if ($id eq ""); }
my $message = MIME::Entity->build( my $message = MIME::Entity->build(
Type=>$type, Type=>$type,
From=>$from, From=>$from,
@ -232,12 +232,14 @@ sub create {
Bcc=>$headers->{bcc}, Bcc=>$headers->{bcc},
"Reply-To"=>$headers->{replyTo}, "Reply-To"=>$headers->{replyTo},
"In-Reply-To"=>$headers->{inReplyTo}, "In-Reply-To"=>$headers->{inReplyTo},
"Return-Path"=>$returnPath,
Subject=>$headers->{subject}, Subject=>$headers->{subject},
"Message-Id"=>$id, "Message-Id"=>$id,
Date=>$session->datetime->epochToMail, Date=>$session->datetime->epochToMail,
"X-Mailer"=>"WebGUI" "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")) { if ($session->config->get("emailOverride")) {
my $to = $headers->{to}; my $to = $headers->{to};
$to = "WebGUI Group ".$headers->{toGroup} if ($headers->{toGroup}); $to = "WebGUI Group ".$headers->{toGroup} if ($headers->{toGroup});

View file

@ -100,11 +100,16 @@ sub addPost {
$prefix =~ s/\//\\\//g; $prefix =~ s/\//\\\//g;
my $title = $message->{subject}; my $title = $message->{subject};
$title =~ s/$prefix//; $title =~ s/$prefix//;
if ($title =~ m/re:/i) {
$title =~ s/re://ig;
$title = "Re: ".$title;
$title =~ s/\s+/ /g;
}
my $post = $parent->addChild({ my $post = $parent->addChild({
className=>$class, className=>$class,
title=>$title, title=>$title,
menuTitle =>$title, menuTitle =>$title,
url=>$title, url=>$parent->get("url")."/".$title,
content=>$content, content=>$content,
ownerUserId=>$user->userId, ownerUserId=>$user->userId,
username=>$user->profileField("alias") || $user->username, username=>$user->profileField("alias") || $user->username,
@ -188,7 +193,7 @@ sub execute {
} }
my $post = undef; my $post = undef;
if ($message->{inReplyTo}) { if ($message->{inReplyTo}) {
$message->{inReplyTo} =~ m/cs\-([\w_-]{22})/; $message->{inReplyTo} =~ m/cs\-([\w_-]{22})\@/;
my $id = $1; my $id = $1;
$post = WebGUI::Asset->newByDynamicClass($self->session, $id); $post = WebGUI::Asset->newByDynamicClass($self->session, $id);
} }