[rt-users] Checking Mail-adress from incoming mails

Andy Harrison aharrison at gmail.com
Fri Jan 14 15:54:59 EST 2005


On Fri, 14 Jan 2005 16:36:55 +0100 (CET), Axel Berking <berking at web.de> wrote:
> Hello,
> 
> i've got a little problem and i did not find a right answer to this.
> 
> I want to do the following:
> 
> If an email arrives the scrip reads out the mail adress and checks if one
> user has the this email adress in rt. If this is true the rest of the
> scrip starts.
> 
> -> incoming mail -> read mail adress from incoming mail -> check if the
> mail adress has a valid user -> execute the rest of the scrip
> 
> Has anyone a little snipplet for me how to do this :-)

Should be fairly easy.  I'm just winging this, you'll have to test it yourself.

Something along the lines of:


$UserToCheck = RT::User->new( $RT::SystemUser );
$UserToCheck->LoadByEmail( ...  the email address ... );
return undef unless ( $UserToCheck->Id );
    ... the rest of the scrip ...



-- 
Andy Harrison



More information about the rt-users mailing list