Facing issue in sending/receiving mails in a cPanel server ?
As always, first place is to check for
If you spot something like this :
2014-04-30 17:07:34 H=(xxxx-122-106-xx-xx-co.in) [xx.xx.xx.xx]:55278 F= temporarily rejected RCPT : require_files: error for /home/account/etc/domain.com: Permission denied
It looks like the permission/ownership has been altered for the path
given in the logs ( the mailbox location )
Fix this issue by running the following :
— mailperm script is provided by cPanel to automatically fix the permission and ownership of mailboxes with the user account provided.
— Check chkservd logs (
/var/log/chkservd.log ) and see if we can find something
like this in-relation to exim
>> AUTH PLAIN AF9fsdsdxcxcxcX19pspdivxc1k1MGJYek44eXpOMVliWkdOdF
<< 421 host.xxxx.com Service not available - closing connection
exim: ** [421 host.xxxx.com: Service not available - closing connection != 2]
-- This shows that the check daemon failed to authenticate
with the temporal auth key (exim ) and therefore check is getting
-- As a result of this, we can find lots of SMTP authentication failures
in exim_mainlog ( both from valid and invalid IP's )
-- To fix this issue with exim-auth key, we need to generate them.
-- # cd /var/cpanel/serviceauth/
# rm -rf exim
# service cpanel restart
# service exim restart
Monitor chkservd logs (
/var/log/chkservd.log ) and make sure things are fine !
SMTP restrictions prevent users from bypassing your mail server to send mail.
This feature allows you to configure your server so that the mail
transport agent (MTA), Mailman mailing list software, and root user
are the only accounts able to connect to remote SMTP servers.
Enable from WHM as :
Home >> Security Center >> SMTP Restrictions
When doing so, do you face this error ?
An error occurred attempting to update this setting.
The SMTP restriction is disabled.
When trying to do it from backend,
# /scripts/smtpmailgidonly on
SMTP Mail protection has been disabled. All users may make smtp connections.
There was a problem setting up iptables. You either have an older kernel or a
broken iptables install, or ipt_owner could not be loaded.
In Most cases, the required iptables module, ‘ipt_owner’ would be disabled.
You can confirm it by running
If your’s is a VPS, ask the provider to enable it for you, or if
you manage your server, enable it using the command :
# modprobe ipt_owner
Facing an issue with exim, that it doesn’t send any mails to certain SMTP server’s like gmail etc?
First place to check is the
/var/log/exim_mainlog and see if you can spot something like this
-bash-3.2# grep 1W6OuM-0005cl-J8 /var/log/exim_mainlog
2014-01-23 19:21:42 1W6OuM-0005cl-J8 <= email@example.com
xxx. U=root P=local S=350 T=”test mail” for firstname.lastname@example.org
2014-01-23 19:21:42 cwd=/var/spool/exim 4 args: /usr/sbin/exim -v -Mc 1W6OuM-0005cl-J8
2014-01-23 19:21:43 1W6OuM-0005cl-J8 Completed
You can see that exim is trying to send outgoing emails via IPv6 . It happens if the recipient server supports it, ( gmail supports it ) as a result mail delivery gets affected or the mails reach junk/spam folder.
If IPv6 delivery is not intended and DNS records for the same are not configured, then the recipient SMTP server would not be able to obtain a reverse DNS entry of the sending IP ( IP in IPv6 ) and as a result it affects the mail delivery.
To get around this, either configure your IPv6 DNS entries or just force exim to send mails only via IPv4 by adding the below line to the exim config file (
disable_ipv6 = true
Finally restart exim.
To configure autoreponder for some address with postfix.
Edit the postfix virtual configuration:
email_address recepient_lists, email@example.com
eg: firstname.lastname@example.org email@example.com, firstname.lastname@example.org@autoreply.example.com
Edit the transport configuration:
eg: autoreply.example.com autoreply:
Create pipe for the transponder in master.cf
autoreply unix – n n – – pipe
flags= user=nobody argv=/usr/local/bin/autoreply $sender $recipient
Created autoreply script at /usr/local/bin/autoreply
/usr/sbin/sendmail -oi -t << EOF
Subject: Auto Response from example.com
Content-Type: text/plain; charset=utf-8
This is an autoreponder email.
There is other better way to do it with procmail and other tools, depends on your mail server setup
It is good to have spf implemented to make the recepient mail servers trust your entity.
Use the spf wizard http://old.openspf.org/wizard.html to generate the record and add it in your dns zone file.
It will work usually with
$ cd /usr/lib/mailman
$ bin/discard /var/lib/mailman/data/heldmsg--*
If the list is too long
$ cd /var/lib/mailman
$ find data -name heldmsg--* -print | xargs /usr/bin/discard