Knowledgebase

block a signle domain to send email from scripts in cpanel

Posted by un!ty, 05-05-2015, 08:54 AM
I tried allot but didn't find any solution. How i can stop a single user on cpanel server to stop sending email from php or other scripts as i already enabled basic features to disable it even i added that domain to /etc/blockdomains/ php.ini disable mail function is a solution but i will have to place php.ini in every folder which is not easy because for other domains global php.ini mail function is working and i need it. Please suggest what to do to avoid such issue. How i can disable entire single domain to stop sending emails, Any sort of email from web interface to php mail. As always you guys know that fighting spam is hassle for all. Waiting for responses and help to resolve the issue.

Posted by asgard, 05-05-2015, 09:18 AM
Suspend the client's whole account and warn him his account will be completely terminated if he keeps sending emails; if he still goes on after the warning, terminate him for real. I know it sounds drastic, but to me what your client is doing is very close to abuse and, if I were an host, I would not tolerate something like that.

Posted by lignitehosting, 05-05-2015, 09:20 AM
There are few ways to limit the users mail sending options. You can limit the no mails that this cpanel user can send, by the edit package or edit this account. or create a separate package, set the no of mails per hour set to 0. this wont stop generating mails from the website or by the user. The only permanent solution is to find the cause or the source of the mail generation. I would suggest you to install the configserver's Mail ConfigServer Mail Queues Use the below commands to install it on the cpanel based server. wget http://download.configserver.com/cmq.tgz tar -xzf cmq.tgz cd cmq sh install.sh Once installed, Open it from Plugins section in the very bottom You will see the no of mails on the queue, Now, click view emails button and analyse the mails sources. Before this. Under >> tweak settings >> make sure you enable this options. 1. Track email origin via X-Source email headers 2. Initial default/catch-all forwarder destination set to >> fail 3. Restrict outgoing SMTP to root, exim, and mailman (FKA SMTP Tweak) >> On 4. Prevent “nobody” from sending mail >> On 5. Add X-PopBeforeSMTP header for mail sent via POP-before-SMTP >> On 6. Track email origin via X-Source email headers >> On Now on >> Exim Configuration Manager Query Apache server status to determine the sender of email sent from processes running as nobody Trust X-PHP-Script headers to determine the sender of email sent from processes running as nobody this above 2 options are >> On Update me the result, whether it helped.

Posted by un!ty, 05-05-2015, 03:37 PM
Thanks for the detailed reply, I am a bit confused about 0 value. I think it will make package to unlimited. About ConfigServer Mail Queues installed it successfully and hope so will help to resolve the issue. Thanks again.

Posted by un!ty, 05-05-2015, 03:39 PM
You are right but client want to disable mail feature on his account as he don't want to use it and nor he is spamming he just host website then what should be solution. As you know wordpress, joomla and such scripts are hassle for us and hard to secure from such activates.

Posted by acm_whr, 05-06-2015, 04:00 PM
Setting mails per hour to 0 for the concerned account won't stop the ability to send mail, you can still send mails from the accounts. In WHM there is an option to mention the domains to be blcoked. Create a file on the server say /etc/blockeddomains and add the domain name to be blocked. Go to WHM >> Exim Configuration Editor >> Advanced Editor, put the below codes on the top. domainlist blocked_domains = lsearch;/etc/blockeddomains Under the Router configuration section add the below lines. reject_domains: driver = redirect domains = blocked_domains allow_fail data = :fail: Connection rejected: SPAM source $domain is manually blacklisted. Restart exim and check if mails are delivering or not.

Posted by un!ty, 05-06-2015, 04:07 PM
Thanks, As i already explained in my first post that i did it. It will not stop mail sending from the php scripts. It will only work on webmail interface and will give you an error that you are not allowed to send email but php script still able to send emails.



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
DNS Cluster (Views: 612)
ptxl.net down. (Views: 577)
100TB server is down (Views: 681)


Language:

Client Login

Email

Password

Remember Me

Search