Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 15 of 42
  1. #1
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default Convert Default Addresses to :fail:

    I just posted this to a thread and thought I'd make it available to anyone who wants to run it on their servers. It changes all Default Addresses (i.e. catchall aliases) for all domains on the server to :fail:

    Code:
    #!/usr/bin/perl
    print "Converting all domain Default Accounts to :fail: ...";
    opendir (DIR, "/etc/valiases/") or die;
    while (my $file = readdir (DIR)) {
    	if ($file =~ /^\./) {next}
    	open (IN, "</etc/valiases/$file") or die;
    	my @data = <IN>;
    	close (IN);
    	open (OUT, ">/etc/valiases/$file") or die;
    	foreach my $line (@data) {
    		if ($line =~ /^\*\:/) {
    			print OUT "*: :fail:\n";
    		} else {
    			print OUT $line;
    		}
    	}
    	close (OUT);
    }
    print "Done!\n";
    Use at your own risk. That means, backup /etc/valiases before running it
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  2. #2
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Jun 2003
    Posts
    647

    Default

    Why would you want :fail:? :fail:'s just a bad idea IMO. :blackhole: is the answer.

  3. #3
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Nope, :fail: is definitely the way to go. Here comes my usual answer

    It's been accepted now that since the use of verify = recipient in exim.conf that it is definitely best to use :fail: now.

    The reasons are:

    1. :blackhole: accepts the email and receives it, then sends it to /dev/null. This wastes your bandwidth and actually breaks the SMTP RFC because you're not notifying the sender that the email is undelivered.

    2. :fail: stops the email from being received, because verify = recipient occurs at the RCPT phase of the SMTP exchange before any data has been received. No bounce is sent, the exchange simply termintates with an SMTP error code. This means much less processing resources on your SMTP server, much less bandwidth (you don't actually receive the email) and you maintain RFC compliance by notifying the senders SMTP server that the delivery failed (which spammers ignore and real people appreciate if they've made an addressing mistake).
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  4. #4
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Btw, just to back that up - I did extensive research on the use of :blackhole: and :fail: when I wrote the exim Dictionary Attack ACL over here:
    http://www.webumake.com/free/eximdeny.htm

    I also used to think that :blackhole: was best until it was pointed out to me that several months ago the ACL's were changed to use verify = recipient at the RCPT stage. So cynical me went and checked it out and found it to be perfectly true
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  5. #5
    Member
    Join Date
    Sep 2004
    Posts
    529

    Default

    Heh, chirpy, this seems to come up about once a week... I see why you have your usual answer saved and handy. heh.

  6. #6
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    It does get asked a lot doesn't it?
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  7. #7
    BANNED
    Join Date
    Feb 2004
    Posts
    349

    Default

    Quote Originally Posted by chirpy
    Btw, just to back that up - I did extensive research on the use of :blackhole: and :fail: when I wrote the exim Dictionary Attack ACL over here:
    http://www.webumake.com/free/eximdeny.htm

    I also used to think that :blackhole: was best until it was pointed out to me that several months ago the ACL's were changed to use verify = recipient at the RCPT stage. So cynical me went and checked it out and found it to be perfectly true
    I looked at your dictionary attack rules, that you recommended, for exim.conf, and found it quite flawed. Your script however is another story. It works well to ban the ip however it needs to be used properly in exim.conf.

    I will email you later, off this site and let you know the much better way to use your perl script with exim.conf

  8. #8
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Quote Originally Posted by mr.wonderful
    I looked at your dictionary attack rules, that you recommended, for exim.conf, and found it quite flawed. Your script however is another story. It works well to ban the ip however it needs to be used properly in exim.conf.

    I will email you later, off this site and let you know the much better way to use your perl script with exim.conf
    I wait with baited breath. It works perfectly well for me and all the people I've installed it for and those that have used it themselves. I did do extensive testing with it, using examples provided by the exim developers.

    Since you're so highly critical of it, I do hope you will have the decency to post the problems with the implementation here as a matter of urgency, since it is so "flawed".
    Last edited by chirpy; 10-23-2004 at 04:22 AM.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  9. #9
    Member
    Join Date
    Jun 2004
    Posts
    76

    Default

    FWIW, the dictionary rules are working very well for me. I've noticed that among the bogus recipients there are often some valid ones, so along with reducing load, it's helped ditch a bit of spam.

    Quote Originally Posted by mr.wonderful
    I will email you later, off this site and let you know the much better way to use your perl script with exim.conf
    Why? Chirpy has been generous enough to share his work with everyone here. If you have some addition, then for cryin' out loud, spit it out!

  10. #10
    Member
    Join Date
    Jun 2002
    Posts
    132

    Default

    Quote Originally Posted by chirpy
    Btw, just to back that up - I did extensive research on the use of :blackhole: and :fail: when I wrote the exim Dictionary Attack ACL over here:
    http://www.webumake.com/free/eximdeny.htm
    How do you implement this on a secondary (backup MX) mail server?

    The current version of the ACL doesn't work on such servers, since they don't even have the valias files on them. Help!

  11. #11
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    You cannot implement it for email being queued on a secondary MX server because the email has not reached its final destination. This can only happen on the primary MX server. It's a limitation you have by imposing an additional hop in the mail delivery route by interrupting the direct SMTP delivery from the source.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  12. #12
    Member Roy@ENHOST's Avatar
    Join Date
    Mar 2002
    Location
    Los Angeles California
    Posts
    495

    Default

    I think you have to add extra detection to the script.

    From what I know, this script will also switch the pipings that are required by helpdesk softwares to :fail:
    You have to use pregmatch regex to check that the destination is not a php,cgi or a binary.
    Hope that helps.
    = = = = = = = = = = = = = = = = = =
    Cpanel XP Evolution (Add DOZENS of functions to your Cpanel NOW!!!) - 21 Languages, User Friendly Interface, Feature Enabled, Highly Customizable, Create Popup Once window, Language Aware, Flash Tutorials, Theme Changer,Integration with Modernbill,WHM AutoPilot,ClientExec,LPanel&WHOISCart

  13. #13
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Hi Roy,

    I completely agree. It was just thrown togther for those that wanted to splat all their domains, as someone asked for it. So they got it
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  14. #14
    Member
    Join Date
    Apr 2003
    Location
    New Jersey, USA
    Posts
    414

    Default

    You just take this script, place it in a new file on your server and access it to run the script?
    eMax Hosting, LLC - Providing Reliable Hosting Services for the past 3 years
    ¨€ cPanel, MySQL, 24/7 Support, Money Back Guarantee, *Free Website Builder*,
    ¨€ Shared Hosting, Reseller Hosting, Dedicated Management, Site Monitoring Services, 97% Client Rating
    ¨€ Have a Sales Questions? Call us toll free at 1-800-770-eMax!

  15. #15
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Yes, bascially do this as root on the server:

    pico -w defrep.pl
    (paste in the script from the thread and exit)

    perl defrep.pl

    That should be it.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

Similar Threads & Tags
Similar threads

  1. Replies: 1
    Last Post: 03-30-2008, 09:37 PM
  2. :fail: does not work to stop spoofed returned addresses
    By jackie46 in forum cPanel and WHM Discussions
    Replies: 17
    Last Post: 10-04-2006, 07:14 AM
  3. Mail > Default addresses
    By MacZilla in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-09-2004, 06:21 AM
  4. :fail: by default?
    By ckacerguis in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 03-10-2004, 01:51 PM
  5. Where are default Mail Addresses kept?
    By silentcircuit in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-09-2003, 06:28 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube