Difference between revisions of "How to enable SMTP tweak"
Docs admin (talk | contribs) |
Docs admin (talk | contribs) m (Text replacement - "WHM (Web Host Manager)" to "WHM") |
||
(5 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
SMTP tweak is very easy to implement. | SMTP tweak is very easy to implement. | ||
− | [1] Login to your WHM | + | [1] Login to your WHM as root. |
[2] Go to Security Center. The link is located on the left under the security section. | [2] Go to Security Center. The link is located on the left under the security section. | ||
Line 17: | Line 17: | ||
To do so, open the init file with your favorite text editor: | To do so, open the init file with your favorite text editor: | ||
− | <pre> | + | <pre>/etc/init.d/apf</pre> |
Replace the entire contents of the file with this: | Replace the entire contents of the file with this: | ||
Line 29: | Line 29: | ||
# source function library | # source function library | ||
− | + | . /etc/rc.d/init.d/functions | |
− | + | # import variables | |
− | + | . /etc/apf/conf.apf | |
− | + | . /etc/apf/internals/internals.conf | |
− | + | ipt="/sbin/iptables" | |
− | + | inspath="/etc/apf" | |
− | + | prog="apf" | |
− | + | case "$1" in | |
− | + | start) | |
− | + | echo -n "Starting APF:" | |
− | + | /usr/local/sbin/apf --start >> /dev/null 2> and 1 | |
− | + | echo_success | |
− | + | echo | |
− | + | echo -n "Enabling SMTP Tweak:" | |
− | + | /scripts/smtpmailgidonly on >> /dev/null 2> and 1 | |
− | + | echo_success | |
− | + | echo | |
− | + | ;; | |
− | + | stop) | |
− | + | echo -n "Stopping APF:" | |
− | + | /usr/local/sbin/apf --stop >> /dev/null 2> and 1 | |
− | + | echo_success | |
− | + | echo | |
− | + | ;; | |
− | + | restart) | |
− | + | $0 stop | |
− | + | $0 start | |
− | + | ;; | |
− | + | *) | |
− | + | echo "usage: $0 [start|stop|restart]" | |
+ | esac | ||
+ | exit 0 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Save the file, and exit. This will ensure that APF does not conflict with SMTP Tweak. | Save the file, and exit. This will ensure that APF does not conflict with SMTP Tweak. | ||
− | [[Category:WHM | + | [[Category:WHM]] |
Latest revision as of 15:14, 22 July 2015
In this guide, we will go over how to enable SMTP tweak. The SMTP tweak option will prevent users from bypassing the mail server to send mail (this is a common practice used by spammers). It will only allow the MTA (mail transport agent), mailman, and root to connect to remote SMTP servers.
Basically, SMTP tweak prevents emails being sent through means other than the cPanel mail service, exim.
SMTP tweak is very easy to implement.
[1] Login to your WHM as root.
[2] Go to Security Center. The link is located on the left under the security section.
[3] Scroll down and click on SMTP Tweak. This page will let you enable or disable SMTP tweak.
SMTP Tweak and APF
If you use APF (Advanced Policy Firewall) you need to change certain settings to make sure they both function together properly.
To do so, open the init file with your favorite text editor:
/etc/init.d/apf
Replace the entire contents of the file with this:
#!/bin/bash
##
# chkconfig: 345 55 25
# description: Advanced Policy Firewall
#
# source function library
. /etc/rc.d/init.d/functions
# import variables
. /etc/apf/conf.apf
. /etc/apf/internals/internals.conf
ipt="/sbin/iptables"
inspath="/etc/apf"
prog="apf"
case "$1" in
start)
echo -n "Starting APF:"
/usr/local/sbin/apf --start >> /dev/null 2> and 1
echo_success
echo
echo -n "Enabling SMTP Tweak:"
/scripts/smtpmailgidonly on >> /dev/null 2> and 1
echo_success
echo
;;
stop)
echo -n "Stopping APF:"
/usr/local/sbin/apf --stop >> /dev/null 2> and 1
echo_success
echo
;;
restart)
$0 stop
$0 start
;;
*)
echo "usage: $0 [start|stop|restart]"
esac
exit 0
Save the file, and exit. This will ensure that APF does not conflict with SMTP Tweak.