Disallow a site from sending out emails

Posted by HappyPike, 05-04-2007, 12:51 AM
Hi, Is there a way to disallow a certain site from sending out emails, while allowing other sites on the same server? My server uses Cpanel. Also, is there a way to only tar files of a certain type, such as PHP, recursively from a directory? Thanks.

Posted by ThinkSupportAdmin, 05-04-2007, 03:01 AM
You can remove the domain entry from the file /etc/localdomains This will disallow emails for that domain.. Yes you can tar particluar files -- you may want to use additional commands -- cp *.php xyzfolder tar -xzvf new.tar.gz xyzfolder/

Posted by HappyPike, 05-04-2007, 03:11 AM
Thanks for the help, ThinkSupportAdmin!

Posted by ThinkSupportAdmin, 05-04-2007, 03:37 AM
Cheers HappyPike

Posted by HappyPike, 05-04-2007, 03:48 AM
BTW, is there anything wrong with this htaccess file? I added my IP to the deny list and it doesn't seem to work.

Posted by Linuxsurgeon, 05-04-2007, 06:38 AM
when you are looking at putting a block for an IP you can do it using following rules.

Posted by brianoz, 05-04-2007, 06:58 AM
Another way of preventing a site from sending out email is to put a line like in the file /var/cpanel/maxemails. Not sure if this would be more effective than the localdomains idea.

Posted by senne, 05-04-2007, 06:32 PM
recursively find . -name "*.php"|xargs tar cvf php.tar

Posted by HappyPike, 05-04-2007, 07:58 PM
Thank you all for the quick replies. I will give those commands a try soon. For the htaccess problem, I removed those tags and this works: Fortunately I don't need to deny a site from sending emails now. For the past few days my server were sending out tons of spam emails. I checked the apache log and found that the spammer was injecting an insecured PHP file with a text file containing PHP mailer codes located on a free hosting site. I fixed the page and banned the spammer's IPs. Last edited by HappyPike; 05-04-2007 at 08:05 PM.

Posted by HappyPike, 05-04-2007, 08:11 PM
Thanks, senne! I just tried the command and it worked very well! It retains the directory structure too!!

Posted by brianoz, 05-05-2007, 12:48 AM
That's a really bad idea - it won't work, but will look like it did! It will work well provided you don't have more than a very few files, but will invisibly lose some of the files if you have more than a very few, as xargs will run tar once for the first batch and once for the second. What you want is: That may only work on some linux/unix versions of tar, so you may instead be able to use the inferior: The problem with this second method is that it also won't work for large numbers of files, although you'll get an error message.

Cette réponse était-elle pertinente?

 Imprimer cet article

Consultez aussi

Where can I find a working PHP SMS text script?

Posted by lexington, 01-13-2011, 04:56 AMI found this site which works in sending text messages...

Transparent Reselling . . . ?

Posted by Piano, 08-23-2002, 01:53 PMHow much annoniminity can a reseller have? And what things...

DNS/Proxy Cache

Posted by linux2man, 07-15-2007, 10:57 AMHello; I made changes in httpd.conf to redirect website...

Extension issue

Posted by imad77, 04-20-2009, 10:39 AMHi, I run a Perl/CGI script from a Web page to download...

date --utc on VPS ?

Posted by enz0, 06-17-2008, 03:07 PMHi all, I just created a VPS with Empire VPS. I'm...