Patch: Optimize recipients for Notifications Mails

Hello,

we found, that if we have ScripActions that notify more than one watcher
group (e.g. “Notify AdminCC and Cc as Comment”), people get more than one
message for the same notification, if they have more than one role for the
ticket (e.g. beeing AdminCc and Cc).

This is not necessary at all but only annoying, so I propose following
general patch for Action/SendEmail.pm which removes unnecessary recipient
entries: It removes every Cc already in To and every Bcc if already in To
or Cc.

The patch is tested here and behaves like expected. Will this make it into
the core?

http://page.mi.fu-berlin.de/~pape/rt3/patches/rt/optimize_recipients.patch

Regards, Dirk.
Dr. Dirk Pape (eAS - Projektleitung Campus Management)
Freie Universitaet Berlin
Grunewaldstr. 34a, 12165 Berlin
Tel. +49 (0)30 838 75143, Fax. +49 (0)30 838 54654

good patch, vote for applyingOn 6/15/07, Dirk Pape pape-rt@inf.fu-berlin.de wrote:

Hello,

we found, that if we have ScripActions that notify more than one watcher
group (e.g. “Notify AdminCC and Cc as Comment”), people get more than one
message for the same notification, if they have more than one role for the
ticket (e.g. beeing AdminCc and Cc).

This is not necessary at all but only annoying, so I propose following
general patch for Action/SendEmail.pm which removes unnecessary recipient
entries: It removes every Cc already in To and every Bcc if already in To
or Cc.

The patch is tested here and behaves like expected. Will this make it into
the core?

http://page.mi.fu-berlin.de/~pape/rt3/patches/rt/optimize_recipients.patch

Regards, Dirk.

Dr. Dirk Pape (eAS - Projektleitung Campus Management)
Freie Universitaet Berlin
Grunewaldstr. 34a, 12165 Berlin
Tel. +49 (0)30 838 75143, Fax. +49 (0)30 838 54654


List info: The rt-devel Archives

Best regards, Ruslan.

good patch, vote for applying

Ok. Let’s aim for 3.6.5?

PGP.sig (186 Bytes)

ok.On 6/15/07, Jesse Vincent jesse@bestpractical.com wrote:

On Jun 15, 2007, at 4:20 AM, Ruslan Zakirov wrote:

good patch, vote for applying

Ok. Let’s aim for 3.6.5?

On 6/15/07, Dirk Pape pape-rt@inf.fu-berlin.de wrote:

Hello,

we found, that if we have ScripActions that notify more than one
watcher
group (e.g. “Notify AdminCC and Cc as Comment”), people get more
than one
message for the same notification, if they have more than one role
for the
ticket (e.g. beeing AdminCc and Cc).

This is not necessary at all but only annoying, so I propose
following
general patch for Action/SendEmail.pm which removes unnecessary
recipient
entries: It removes every Cc already in To and every Bcc if
already in To
or Cc.

The patch is tested here and behaves like expected. Will this make
it into
the core?

<http://page.mi.fu-berlin.de/~pape/rt3/patches/rt/
optimize_recipients.patch>

Regards, Dirk.

Dr. Dirk Pape (eAS - Projektleitung Campus Management)
Freie Universitaet Berlin
Grunewaldstr. 34a, 12165 Berlin
Tel. +49 (0)30 838 75143, Fax. +49 (0)30 838 54654


List info: lists.bestpractical.com Mailing Lists
rt-devel


Best regards, Ruslan.


List info: lists.bestpractical.com Mailing Lists
rt-devel

Best regards, Ruslan.

Hello,

Thanks, but I see that it does not help with the issue I had (more than one
notification scrip is fireing for the same person being AdminCc, Owner and
OtherRecipient).

The optimization I did with this patch is already done by the MTA, which
apparently does not send a message twice to one person within the same
session.

Nevertheless the patch (or a slightly better version of it, that also
removes duplicates in one Header field - I will send later) is useful,
because cleaning the recipient header will help in a better “preview” on
the Ticket/Update.html who will receive a message, and in the “recorded
email” transactions.

For my original intention I have to cleanup my scrip logic.

Thanks, Dirk.

–Am 15. Juni 2007 16:52:26 +0400 schrieb Ruslan Zakirov
ruz@bestpractical.com:

ok.

good patch, vote for applying

Ok. Let’s aim for 3.6.5?

Hello,

we found, that if we have ScripActions that notify more than one
watcher
group (e.g. “Notify AdminCC and Cc as Comment”), people get more
than one
message for the same notification, if they have more than one role
for the
ticket (e.g. beeing AdminCc and Cc).

This is not necessary at all but only annoying, so I propose
following
general patch for Action/SendEmail.pm which removes unnecessary
recipient
entries: It removes every Cc already in To and every Bcc if
already in To
or Cc.

The patch is tested here and behaves like expected. Will this make
it into
the core?

<http://page.mi.fu-berlin.de/~pape/rt3/patches/rt/
optimize_recipients.patch>

Regards, Dirk.

Dr. Dirk Pape (eAS - Projektleitung Campus Management)
Freie Universitaet Berlin
Grunewaldstr. 34a, 12165 Berlin
Tel. +49 (0)30 838 75143, Fax. +49 (0)30 838 54654


List info: lists.bestpractical.com Mailing Lists
rt-devel


Best regards, Ruslan.


List info: lists.bestpractical.com Mailing Lists
rt-devel

Dr. Dirk Pape (eAS - Projektleitung Campus Management)
Freie Universitaet Berlin
Grunewaldstr. 34a, 12165 Berlin
Tel. +49 (30) 838 75143, Fax. +49 (30) 838 54654

Hi, Dirk. Have applied equivalent of the patch, it came into the repo
as the rev #8186. Please, check that it does the same thing as yours.On 6/16/07, Dirk Pape pape-rt@inf.fu-berlin.de wrote:

Hello,

Thanks, but I see that it does not help with the issue I had (more than one
notification scrip is fireing for the same person being AdminCc, Owner and
OtherRecipient).

The optimization I did with this patch is already done by the MTA, which
apparently does not send a message twice to one person within the same
session.

Nevertheless the patch (or a slightly better version of it, that also
removes duplicates in one Header field - I will send later) is useful,
because cleaning the recipient header will help in a better “preview” on
the Ticket/Update.html who will receive a message, and in the “recorded
email” transactions.

For my original intention I have to cleanup my scrip logic.

Thanks, Dirk.

–Am 15. Juni 2007 16:52:26 +0400 schrieb Ruslan Zakirov
ruz@bestpractical.com:

ok.

On 6/15/07, Jesse Vincent jesse@bestpractical.com wrote:

On Jun 15, 2007, at 4:20 AM, Ruslan Zakirov wrote:

good patch, vote for applying

Ok. Let’s aim for 3.6.5?

On 6/15/07, Dirk Pape pape-rt@inf.fu-berlin.de wrote:

Hello,

we found, that if we have ScripActions that notify more than one
watcher
group (e.g. “Notify AdminCC and Cc as Comment”), people get more
than one
message for the same notification, if they have more than one role
for the
ticket (e.g. beeing AdminCc and Cc).

This is not necessary at all but only annoying, so I propose
following
general patch for Action/SendEmail.pm which removes unnecessary
recipient
entries: It removes every Cc already in To and every Bcc if
already in To
or Cc.

The patch is tested here and behaves like expected. Will this make
it into
the core?

<http://page.mi.fu-berlin.de/~pape/rt3/patches/rt/
optimize_recipients.patch>

Regards, Dirk.

Dr. Dirk Pape (eAS - Projektleitung Campus Management)
Freie Universitaet Berlin
Grunewaldstr. 34a, 12165 Berlin
Tel. +49 (0)30 838 75143, Fax. +49 (0)30 838 54654


List info: lists.bestpractical.com Mailing Lists
rt-devel


Best regards, Ruslan.


List info: lists.bestpractical.com Mailing Lists
rt-devel


Dr. Dirk Pape (eAS - Projektleitung Campus Management)
Freie Universitaet Berlin
Grunewaldstr. 34a, 12165 Berlin
Tel. +49 (30) 838 75143, Fax. +49 (30) 838 54654

Best regards, Ruslan.

Hello Ruslan,

–Am 17. Juli 2007 21:00:41 +0400 schrieb Ruslan Zakirov
ruz@bestpractical.com:

Hi, Dirk. Have applied equivalent of the patch, it came into the repo
as the rev #8186. Please, check that it does the same thing as yours.

your patch looks shorter and trickier then my second version, which is
under
http://page.mi.fu-berlin.de/pape/rt3/patches/rt/3.6.4/optimize_recipients.patch.
My limited perl knowlegde tells me that it has the same semantics. We
should not discuss about worst case computing complexity (which seems to be
nlog(n) with my path and nn with yours, where n is number of
email-adresses :slight_smile:

Because in general n is not high enough I would not mind to migrate to your
fix.

Dirk.

Dr. Dirk Pape (eAS - Projektleitung Campus Management)
Freie Universitaet Berlin
Grunewaldstr. 34a, 12165 Berlin
Tel. +49 (0)30 838 75143, Fax. +49 (0)30 838 54654

Hello Ruslan,

–Am 17. Juli 2007 21:00:41 +0400 schrieb Ruslan Zakirov
ruz@bestpractical.com:

Hi, Dirk. Have applied equivalent of the patch, it came into the repo
as the rev #8186. Please, check that it does the same thing as yours.

your patch looks shorter and trickier then my second version, which is
that trick is quite popular in perl world.

under
http://page.mi.fu-berlin.de/pape/rt3/patches/rt/3.6.4/optimize_recipients.patch.
My limited perl knowlegde tells me that it has the same semantics. We
should not discuss about worst case computing complexity (which seems to be
nlog(n) with my path and nn with yours, where n is number of
email-adresses :slight_smile:
I disagree with your math, but let’s leave it alone for this little beats :slight_smile:

Because in general n is not high enough I would not mind to migrate to your
fix.

Dirk.


Dr. Dirk Pape (eAS - Projektleitung Campus Management)
Freie Universitaet Berlin
Grunewaldstr. 34a, 12165 Berlin
Tel. +49 (0)30 838 75143, Fax. +49 (0)30 838 54654

Best regards, Ruslan.

Hello,

–Am 18. Juli 2007 18:18:29 +0400 schrieb Ruslan Zakirov
ruz@bestpractical.com:

I disagree with your math

I was sure you would :wink:

but let’s leave it alone for this little beats
:slight_smile:

ack.

Dirk.

Dr. Dirk Pape (eAS - Projektleitung Campus Management)
Freie Universitaet Berlin
Grunewaldstr. 34a, 12165 Berlin
Tel. +49 (0)30 838 75143, Fax. +49 (0)30 838 54654