[rt-users] Stripping off subdomains in $email

Ashley Gould agould at aslab.com
Fri Sep 28 15:47:46 EDT 2001


What I am imagining is an if-then in the mail gate code:

if $email does not authenticate and domain name is more than two levels
{
        strip off a domain level and retry it;
}

Any pointers on where to start?

ddashley
ashlye


On Thu, Sep 27, 2001 at 01:49:58AM +0000, Darrin Walton wrote:
>   |+ Do I have any other options?  My perl is juvinile but improving.
> 
> Can't you just use RT's CanonicalizeAddress feature? 
> 
> # CanonicalizeAddress converts email addresses into canonical form.
> # it takes one email address in and returns the proper canonical
> # form. You can dump whatever your proper local config is in here
> 
> sub CanonicalizeAddress {
>     my $email = shift;
>     # Example: the following rule would treat all email
>     # coming from a subdomain as coming from second level domain
>     # foo.com
>     #$email =~ s/\@(.*).foo.com/\@foo.com/;
>     return ($email)
> }
> 
> -darrin




More information about the rt-users mailing list