Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Bouncing Email w/ Perl

by tachyon (Chancellor)
on Feb 14, 2004 at 20:54 UTC ( [id://329027]=note: print w/replies, xml ) Need Help??


in reply to RESLOVED: Bouncing Email w/ Perl

You bounce an email by sending a message back to the server that sent it. There are a number of possible messages but user unknown at this domain is what you want. See Mail::Message::Construct::Bounce for a very simple interface to bounce messages in perl. Note this link fails to work properly. Go to search.cpan.org and search for 'MAIL::Bounce' and it will bring it up OK

However what you really want to do is not have a catch all email address. Typically this will be (for sendmail) set up in the virtusertable like this:

[root@www root]# cat /etc/mail/virtusertable @domain.com username ...
This directs any mail sent to domain.com to usernames mail box. All you need to do provided you have root access of course is
cd /etc/mail/ vi virtusertable Now replace the @domain.com with address@domain.com username corporate@domain.com username bitbucket@domain.com username etc@domain.com username spam@domain.com spam Finally run make to recompile the .db file

Now any mail to domain.com that does not match one of the listed addresses will bounce. Note multiple 'fake' addresses go to the one username mail box.

It is easier to let the MTA bounce messages for you. Otherwise you will have to parse you mail box using the Mail::Box and friends. Note Mail::Box is the biggest pain in the ass to install as it has *lots* of dependencies, and I do mean lots. Each of these has more. Suggest use CPAN to put it on for you.

cheers

tachyon

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://329027]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-25 15:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found