Greylisting default disable
I think there was some discussion of this on the Edge list, but that thread got really long really fast.
Has there been any thought behind going from a "default enabled" with greylisting to a "default disabled"? Meaning that greylisting can be enabled server-wide by the server administrator, but individual web hosting accounts have to explicitly enable it in their cPanel for it to take affect for their account.
I would kind of like that set up better. But, I may be in the minority. I'm just wondering if there's been any thought put into this as a process.
-
Hello :) It's opt-out instead of opt-in with the idea that administrators want to prevent as much SPAM as possible. However, here is the script referenced on our Edge-Users list that will disable greylisting for all users if that's your preference: #!/usr/local/cpanel/3rdparty/bin/perl # cpanel - turn-off-greylisting.pl Copyright(c) 2014 cPanel, Inc. # All rights Reserved. # copyright@cpanel.net http://cpanel.net # This code is subject to the cPanel license. # Unauthorized copying is prohibited. use strict; use warnings; use LWP::UserAgent (); use HTTP::Cookies (); use JSON (); my $accesshash; open my $accesshash_fh, '<', '/root/.accesshash' or die "Unable to open /root/.accesshash: $!"; while (<$accesshash_fh>) { chomp; $accesshash .= $_; } my $useragent = LWP::UserAgent->new( cookie_jar => HTTP::Cookies->new, ssl_opts => { verify_hostname => 0, SSL_verify_mode => 0x00 }, ); $useragent->default_header( 'Authorization' => "WHM root:$accesshash" ); my $listaccts = $useragent->get( 'https://127.0.0.1:2087/json-api/listaccts?api.version=1' ); my $content = eval { JSON::decode_json( $listaccts->decoded_content ) }; my @usernames; foreach my $acct ( @{ $content->{'data'}{'acct'} } ) { push @usernames, $acct->{'user'}; } print "Disabling Greylisting for " . scalar @usernames . " accounts:"; foreach my $acct (@usernames) { my $success = $useragent->get( join( q{}, "https://127.0.0.1:2087/json-api/", "cpanel", "?cpanel_jsonapi_apiversion=3", "&cpanel_jsonapi_user=$acct", "&cpanel_jsonapi_module=cPGreyList", "&cpanel_jsonapi_func=disable_all_domains", ) ); print $success->decoded_content; }
You will need to run the "/usr/local/cpanel/bin/mkaccesshash" command if you don't already have an access hash in /root/.mkaccesshash. Thank you.0 -
You would have to run this periodically, wouldn't you? After I started this thread, I pondered if I could just write a post wwwacct hook to disable greylisting for that account. That might would seem to be a better solution. I just didn't know if cPanel had any aims to default disable this, or offer a Tweak Setting that would "Enable greylisting by default OR Disable greylisting by default" Like I said, I may be in the minority with this and if I am I don't expect a lot of traction on this. I may look into doing the post wwwacct hook thing, if it's just me. I have kind of mixed feelings on greylisting in general. 0 -
I just didn't know if cPanel had any aims to default disable this, or offer a Tweak Setting that would "Enable greylisting by default OR Disable greylisting by default"
Hello :) There are currently no plans for this, but feel free to submit a feature request via: Submit A Feature Request In the meantime, the plugin referenced by InfoPro is an alternative to implementing the script I posted into a post account creation hook. Thank you.0
Please sign in to leave a comment.
Comments
4 comments