Merging users?

Is there a (handy) way for merging users?

Lets assume Hank Helpdesker, (with userid hank who can also be assigned
as the owner of some tickets) usually mails ticket requests from the
e-mail address defined in his RT account, hank@helpdeskers.com.
Sometimes he happens to e-mail from hank.helpdesker@helpdeskers.com and
as a result, these tickets do not show as tickets requested by him.

Is there a way for merging the auto-created user
hank.helpdesker@helpdeskers.com with the ‘real’ hank?

Lynoure Rajamaki
lynoure@otaverkko.com

Is there a way for merging the auto-created user
hank.helpdesker@helpdeskers.com with the ‘real’ hank?

Maybe the address canonicalization (in the config file) does the trick?

Sebastian

Sebastian Flothow
sebastian@flothow.de
#include <stddisclaimer.h>

Gruß
Sebastian

Sebastian Flothow
sebastian@flothow.de
#include <stddisclaimer.h>

Is there a way for merging the auto-created user
hank.helpdesker@helpdeskers.com with the ‘real’ hank?

Maybe the address canonicalization (in the config file) does the trick?

I guess hank was a bad example. The typical pair of addresses used is
nickname@domain and firstname.lastname@domain, so if I understood right,
canonicalization would do the trick only if I’d know which addresses
will and should be used and hardcode those into config.pm. I can think
of no regular expression that would do the job and anyway,
canonicalization probably doesn’t help at the point where you have
multiple users of one person already.

Lynoure Rajamäki
lynoure@otaverkko.fi

Is there a way for merging the auto-created user
hank.helpdesker@helpdeskers.com with the ‘real’ hank?

Maybe the address canonicalization (in the config file) does the
trick?

I guess hank was a bad example. The typical pair of addresses used is
nickname@domain and firstname.lastname@domain, so if I understood
right, canonicalization would do the trick only if I’d know which
addresses will and should be used and hardcode those into config.pm.

If you control the domain, and maintain the aliases file (assuming your
MTA uses an aliases file), you can use my Mail::ExpandAliases module (on
CPAN) in CanonicalizeAddress:

use Mail::ExpandAliases;
use Mail::Address;
my $ma = Mail::ExpandAliases->new(“/etc/aliases”);

sub CanonicalizeAddress {
my $email = shift;
my ($address, $username, @aliases);

  $address = Mail::Address->new($email);
  $username = $address->user();

  @aliases = $ma->expand($username);

  return $aliases[0];

}

So nickname@domain will turn into firstname.lastname. You can modify
the return line to be:

return join "@", $aliases[0], $address->host();

if you are using “firstname.lastname@domain”-style usernames in RT.

I can think of no regular expression that would do the job and anyway,
canonicalization probably doesn’t help at the point where you have
multiple users of one person already.

Yes, this is true, although you can (hopefully) prevent any new aliases
for a user from coming into being.

(darren)

Man is condemned to be free; because once thrown into the world, he is
for everything he does.
– Jean-Paul Sartre

Hi,

Would there be a solution if the user’s actual email address changes
(e.g. if they work for a different company)?

I would still want all his ‘old’ tickets to be associated with him.

Rehan van der Merwe

Is there a way for merging the auto-created user
hank.helpdesker@helpdeskers.com with the ‘real’ hank?

Maybe the address canonicalization (in the config file) does the trick?

Sebastian

Sebastian Flothow
sebastian@flothow.de
#include <stddisclaimer.h>

Lynoure Rajamäki lynoure@otaverkko.fi writes:

Is there a way for merging the auto-created user
hank.helpdesker@helpdeskers.com with the ‘real’ hank?
Maybe the address canonicalization (in the config file) does the
trick?
I guess hank was a bad example. The typical pair of addresses used
is nickname@domain and firstname.lastname@domain, so if I understood
right, canonicalization would do the trick only if I’d know which
addresses will and should be used and hardcode those into
config.pm. I can think of no regular expression that would do the
job

I have a situation (sort of) like this. All users here have
username@domain as their canonical mail address, where username
usually equals firstname - but a few have a different username. They
can also use firstname.lastname@domain. What I do:

I wrote a short script to parse the passwd file into a hash mapping
firstname.lastname => username and firstname => username. Address
canonicalization is then a simple matter of

$email =~ /^(.)@(.)$/;
$email = $userhash{$1} . ‘@’ . $2;

(It’s actually a bit more complicated, in order to fail gracefully if
the hash lookup fails).

and anyway, canonicalization probably doesn’t help at the point
where you have multiple users of one person already.

AFAIK, there is no way to merge users - but you don’t have to, you can
just reset the requestor (and owner) to be the canonical user.

Espen Wiborg espenhw+rt-users@empolis.no
The longest string of consecutive vowels in the English language
occurs in the word “queueing”.