Web Host Chat
Bringing Hosts & Customers together since 2001
Home QLinks Members Your Profile Register FAQ's Hosts Only Area SMS Alerts Advertising
User Information
»REGISTER NOW!

Go Back   Web Host Chat > News, Reviews and useful guides > Web Hosting Articles and Guides
Reply
 
LinkBack Thread Tools
Old 1st September 2007   #1 (permalink)
Registered User (33)
Private Office...
Join Date: Aug 2007
Posts: 33
RadixHosting is on a distinguished road
Restrict Trial User Access to Exim Mail Servers

This is an article I wrote once for my blog. I figured it might be useful for a lot of hosts, so here it is.

As owner of a hosting provider company, I face the problem of abusive users almost every day. More than 90% of all abuse on my server comes from free trial accounts. I offer free trial access to my servers for people who want to try things out before they purchase a hosting package, but off course this attracts spammers. To prevent trial users from using my server for spamming purposes, I modified my exim.pl file to prevent trial users from accessing the Exim mail server.

Please note that this tutorial has been written for cPanel servers.

First you’ll need to download, compile and install my cpgetpack.c application. Here’s how:

Code:
gcc cpgetpack.c -o cpgetpack
mv cpgetpack /usr/bin/
chown cpanel:cpanel /usr/bin/cpgetpack
chmod +s /usr/bin/cpgetpack
Now open the /etc/exim.pl file in your favorite text editor (make a backup first) and look for the following inside the checkuserpass subroutine:

Code:
$trueowner =~ s////g;
$trueowner =~ s/..//g;
if (isdemo(${trueowner})) {
   return('no');
}
Below, paste the following code:

Code:
my $name = getpwuid($uid);
open(UP, "cpgetpack $name|");
my $userplan = ;
close(UP);chop($userplan);
if ($userplan eq "radix_FreeTrial") {
   return "no";
}
You will have to replace the radix_FreeTrial string with the package you assign to your trial users. This will prevent trial users from authenticating which prevents them from sending mail remotely. However, they are still able to send mail locally (for example using the PHP mail() function), so here’s what to do next: find the checkdemo subroutine in the exim.pl file and replace the complete subroutine with:

Code:
sub democheck {
   my $uid = Exim::expand_string('$originator_uid');
   if (isdemo($uid)) { return 'yes'; }       

   my $name = getpwuid($uid);
   open(UP, "cpgetpack $name|");
   my $userplan = ;
   close(UP);       

   chop($userplan);       

   if ($userplan eq "radix_FreeTrial") {
       return 'yes';
   }       

   return 'no';
}
Now just restart Exim:

Code:
service exim restart
It might be a good idea to create a trial account and see if it’s working. Enjoy!
__________________
Registered User
RadixHosting is offline   Reply With Quote
Old 5th May 2008   #2 (permalink)
Registered User (12)
Welcome aboard!
Join Date: May 2008
Posts: 10
sambates is on a distinguished road
THIS USER HAS BEEN GAGGED BY THE FORUM HOSTS FOR SPAM OR BREAKING THE RULES...
User will be ungaged in around 182 hours from this post.

__________________
Registered User
sambates is offline   Reply With Quote
Old 5th May 2008   #3 (permalink)
Join Date: Mar 2008
Location: Gloucester
Age: 23
Posts: 606
BionicInternet is on a distinguished road
Will you please stop bumping old threads..Grrr
BionicInternet is offline   Reply With Quote
Old 5th May 2008   #4 (permalink)
I am Staff at
UK Webhosting Ltd
About My Company!

Certified Host
Join Date: Feb 2008
Posts: 90
JamesC is on a distinguished road
He did bump an old thread, but I missed this thread (long time reader and all that) - it does seem a very useful thread, so this is one case of where his spamming has helped me. I don't offer free trials, but this can be applied if we were ever to start doing so.
__________________
James Creese - UK Webhosting Ltd. - 0800 024 2931
http://www.tsohost.co.uk - affordable UK based shared web hosting since 2003
Company reg: 04977925 VAT reg: GB 833 9677 84
__________________
Web Host - Certified Member
JamesC is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Second user Rackmount Servers ligaya Request for products or services 0 28th August 2006 10:27 PM
2 mail servers 1 domain! kingabs Business and Technical Advice 2 27th May 2006 11:31 AM


Some great companies!


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0