Ending multiple RT accounts per user created by email tickets

Greetings,

I have a bit of a problem with my (inherited) RT installation, and I don’t
think even upgrading it to 3.2.2 from 3.0.10 will help it, from the look
of the various modules that control email ticket creation.

If I have a user whose uid is “foo”, they have 3 legal company email
addresses: the main one, the corporate subdomain, and the one at our
parent company, like so:

uid=foo
email-1=foo@bar.com
email-2=foo@corp.bar.com
email-3=foo@baz.com

Email RT tickets can be spawned from any one of the three email addresses,
depending on what mail client/mailbox they’re in at the moment, plus the
user can have a web account with RT as well.

What ends up happening with this is that some users have 4 separate RT
accounts: “foo”, "foo@bar.com", "foo@corp.bar.com", and "foo@baz.com"

I want them to have the one “foo” account as the requester instead,
regardless of where the ticket is launched from.

I have tried configuring the “CanonicalizeEmailAddress” parameters
(…Match=corp.bar.com|baz.com, …Replace=bar.com), and that had no
effect.

I have found no other configuration parameters that affect this. We do
have LDAP running on our network, so the application could look up the
user name to see if they were real, and then assign the LDAP canonical
email address, but that wouldn’t cross reference the other addresses, only
the user name portion.

Is there any tidy way to tell the thing to:
a) whack off the stuff after the “@”,
b) use the remaining username as the account requester, and
c) assign that requester the address listed in LDAP?
Any accounts that did not exist already would be created using just the
username and the LDAP email. Thus one person, lots of email addresses,
one RT account.

I could go digging into the modules and hacking them up until I had a
heavily customized, and not upgradable, version, but that is not my
preferred route. It’s bad enough that I may have to hand abuse the
database to get rid of the cruft accounts. Is there a simple, clean way
to get around this? Or even a known hack that has been tested elsewhere?

ljl

It’s been awhile, so your problem might have been solved, but I didn’t
see any replies on rt-users.

I have tried configuring the “CanonicalizeEmailAddress” parameters
(…Match=corp.bar.com|baz.com, …Replace=bar.com), and that had no
effect.

If your canonicalization is this regular, than yes, you should be able
to set those variables in the site config. You’ll have to restart RT
to see the changes, and it will not merge the old user accounts. If
you have a more complex canonicalization, you can overlay the actual
function that does this.

Is there any tidy way to tell the thing to:
a) whack off the stuff after the “@”,
b) use the remaining username as the account requester, and

use the variables you already found.

c) assign that requester the address listed in LDAP?
Any accounts that did not exist already would be created using just the
username and the LDAP email. Thus one person, lots of email addresses,
one RT account.

overlay the subroutine to include an ldap lookup.

I’m not sure why it failed for you, did you restart apache? Were you
hoping it would also merge users?

seph

It’s been awhile, so your problem might have been solved, but I didn’t
see any replies on rt-users.

I have tried configuring the “CanonicalizeEmailAddress” parameters
(…Match=corp.bar.com|baz.com, …Replace=bar.com), and that had no
effect.

If your canonicalization is this regular, than yes, you should be able
to set those variables in the site config. You’ll have to restart RT to
see the changes, and it will not merge the old user accounts. If you
have a more complex canonicalization, you can overlay the actual
function that does this.

When I first changed it, and restarted apache, it wasn’t working.

Is there any tidy way to tell the thing to:
a) whack off the stuff after the “@”,
b) use the remaining username as the account requester, and

use the variables you already found.

OK.

c) assign that requester the address listed in LDAP?
Any accounts that did not exist already would be created using just the
username and the LDAP email. Thus one person, lots of email addresses,
one RT account.

overlay the subroutine to include an ldap lookup.

Ah. Okay.

I’m not sure why it failed for you, did you restart apache? Were you
hoping it would also merge users?

I didn’t expect it to merge users, I’ll be doing that manually. I
restarted apache (with “restart”) after I did it, and it didn’t work. I
restarted apache again today, with “stop” then “start”, and now it works.
Apparently the “restart” routine in the version of apache I have is not a
true stop and start. Weird.

Thank you, BTW. I was thinking that I had lost my mind when the
canonicalization thing didn’t work. Apparently it was apache being weird…

ljl