Multiple email addresses for one user

Hello,
Is there anyone who’s dealt with consolidating mutliple email addresses
that a single user has into one account? This would require modifying the
system to hold multiple emails for one user, and sending correspondence out
the first email listed, no? We’d like to accurately track individuals, not
all 10 email addresses they happen to have. I can probably do the mods
myself but didn’t want to reinvent the wheel…
Thanks,

-=| Ben

Is there anyone who’s dealt with consolidating mutliple email
addresses that a single user has into one account? This would require
modifying the system to hold multiple emails for one user, and sending
correspondence out the first email listed, no? We’d like to
accurately track individuals, not all 10 email addresses they happen
to have. I can probably do the mods myself but didn’t want to
reinvent the wheel…

There is a function (RT2: CanonicalizaAddress in etc/config.pm; RT3:
CanonicalizeEmailAddress, in lib/RT/User_Overlay.pm) that lets you map
multiple email addresses to one address; you could begin your search
there.

This is a slightly different approach than the one you’re suggesting, it
basically figures out which addresses are all the same before new ones
are added.

(darren)

You can’t wake a person who is pretending to be asleep.
– Navajo Proverb

At 05:16 AM 3/21/2003, you wrote:

Is there anyone who’s dealt with consolidating mutliple email
addresses that a single user has into one account? This would require
modifying the system to hold multiple emails for one user, and sending
correspondence out the first email listed, no? We’d like to
accurately track individuals, not all 10 email addresses they happen
to have. I can probably do the mods myself but didn’t want to
reinvent the wheel…

There is a function (RT2: CanonicalizaAddress in etc/config.pm; RT3:
CanonicalizeEmailAddress, in lib/RT/User_Overlay.pm) that lets you map
multiple email addresses to one address; you could begin your search
there.

I believe that function only works right if you know the standard format of
the emails people will use. For example if i have john@example.com and
j_g@sample.org and jhq@why.com how would you use the
CanonicalizeEmailAddress function to associate those with the same user,
even if they had the same domain unless you could look up the emails in an
LDAP directory which stored all the emails as well as the username used in
LDAP and RT.

That make sense to anyone else besides me?

John

<>< Proverbs 3:5-6 “Trust in the Lord with all your heart and lean not on
your own understanding;
in all your ways acknowledge him, and he
will make your paths straight.”

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

  • John Gedeon [2003-03-21 11:53]:

I believe that function only works right if you know the standard
format of the emails people will use. For example if i have
john@example.com and j_g@sample.org and jhq@why.com how would you use
the CanonicalizeEmailAddress function to associate those with the same
user, even if they had the same domain unless you could look up the
emails in an LDAP directory which stored all the emails as well as the
username used in LDAP and RT.

That make sense to anyone else besides me?

Yes, that is exactly correct. But, I’m assuming that there is some way
of automatically mapping usernames that come in via email to a canonical
username. This might be /etc/aliases, a NIS map, an LDAP query, or
possibly something even more baroque, but there has to be some sort of
automated way to map email addresses to usernames.

In the example you use above, what you need is effectively:

%address_to_user = (
# Email address => RT Username
’john@example.com’ => ‘john’,
‘j_g@sample.org’ => ‘john’,
‘jhq@why.com’ => ‘john’,

);

sub CanonicalizeAddress {
my $address = shift;
return $address_to_user{$address};
}

Though (hopefully!) %address_to_user come from a lookup to an existing
system.

(darren)


The awful thing about getting it right the first time is that nobody
realizes how hard it was.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (SunOS)

iD8DBQE+e0YbzsinjrVhZaoRAtKAAJ9Wz+tJlvPWT+ImZqWI7l2q8TO5ewCgljMJ
9OwOktmmEtKB5hQN/Di7leg=
=C0GB
-----END PGP SIGNATURE-----

Yes, that is exactly correct. But, I’m assuming that there is some way
of automatically mapping usernames that come in via email to a canonical
username. This might be /etc/aliases, a NIS map, an LDAP query, or
possibly something even more baroque, but there has to be some sort of
automated way to map email addresses to usernames.

In the example you use above, what you need is effectively:

%address_to_user = (
# Email address => RT Username
’john@example.com’ => ‘john’,
‘j_g@sample.org’ => ‘john’,
‘jhq@why.com’ => ‘john’,

);

sub CanonicalizeAddress {
my $address = shift;
return $address_to_user{$address};
}

Though (hopefully!) %address_to_user come from a lookup to an existing
system.

I agree an that is (for the most part) what I did to solve that problem at
our site. Here people can have up to 5 aliases so we could have johng or
jgedeon etc so I use an ldap look up to find all the email aliases for a
user and pick the one that is their unix user account to store and use in
rt. It seems to be working for us so Ben you may look at doing something
similar.

John

<>< Proverbs 3:5-6 “Trust in the Lord with all your heart and lean not on
your own understanding;
in all your ways acknowledge him, and he
will make your paths straight.”

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

A while back I wrote Mail::ExpandAliases[*] to do precisely this for our RT
install. Mail::ExpandAliases returns the username (or final alias) for
an email address, so you can do:

use Mail::ExpandAliases;
my $expander = Mail::ExpandAliases->new("/etc/aliases");

sub CanonicalizeAddress {
my $address = shift;
my @aliases = $expander->expand($address);

  return $aliases[0];

}

(darren)


Although I can accept talking scarecrows, lions, and great
wizards of emerald cities, I find it hard to believe there
is no paperwork involved when your house lands on a witch.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (SunOS)

iD8DBQE+e0rjzsinjrVhZaoRAiUpAJ9cIof1ZElXBRzeg1QeOM6xxGmdOgCfXmev
FYfKTYumg+Mn3Y2cj9bKmHw=
=SaJP
-----END PGP SIGNATURE-----