[rt-users] no outgoing mail from external correspondence

Niels Bakker niels=rt at bakker.net
Sat Jul 2 17:03:25 EDT 2005


* subs-rt.users.bestpractical.com at rz.xs4all.nl (Rejo Zenger) [Mon 27 Jun 2005, 18:16 CEST]:
>If an external e-mail is received from $someone and it is attached to an
>existing ticket, than the $requestor will receive a copy of the mail of
>that $someone (unless $requestor and $someone are one and the same
>user). Right?
>
>I want to change this behaviour in our setup. We would like to have
>mail RT if one of the priviliged users is using the Reply link from
>within the RT webinterface, but we don't want incoming e-mail to be
>forwarded to anyone by e-mail. It should be attached to the ticket and,
>if needed, the status should be updated from $whatever to "open".

We do most of our correspondence by e-mail too.  Here's how to avoid
mails get sent to requestors if the correspondence got added via mail.

On Correspond Notify Requestors and Ccs with global template Correspondence:
change "On correspond" to "User defined" with this code:
---
if ($self->TransactionObj->Type eq "Correspond') {
    #$RT::Logger->debug("XXX Scrip 5: correspondence: from " .
     #   $self->TransactionObj->CreatorObj->Name . "\n");

    my $msg = $self->TransactionObj->Attachments->First;
    # The next line is just my paranoia speaking:
    return 0 unless $msg;

    if ($msg->GetHeader('From') and ($msg->GetHeader('To') or $msg->GetHeader('Cc'))) {
        $RT::Logger->debug("XXX Scrip 5: Seems to be an email comment");
        return 0;
    } else {
        $RT::Logger->debug("XXX Scrip 5: Decided to Notify Requestors and Ccs");
        return 1;
    }
}

return 0;
---

Based on work other people posted here before.


	-- Niels.

-- 
                              The idle mind is the devil's playground



More information about the rt-users mailing list