Checking Mail-adress from incoming mails

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 :slight_smile:

Thanks in advance

Axel Berking

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 :slight_smile:

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