Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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


In reply to Re: Bouncing Email w/ Perl by tachyon
in thread RESLOVED: Bouncing Email w/ Perl by soffen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-18 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found