After installing custombuild 2 unable to send mail

tleg

Verified User
Joined
Nov 24, 2014
Messages
31
First i updated Directadmin to the latest version than reinstalled Custombuild 2.0 using this tutorial and installed the Custombuild Directadmin plugin:
https://forum.directadmin.com/showthread.php?t=44743. I can send and receive direct mail.

Only one problem remains, the websites are not notifying by mail:
Zend_Mail_Transport_Exception: Email to [email protected] failed: Unable to send mail. - library/Zend/Mail/Transport/Sendmail.php:137. Here is my options.config:


Code:
Executing /usr/local/directadmin/plugins/custombuild/admin/build options...
Apache: 2.4.20
mod_ruid2: 0.9.8
ModSecurity: no
Dovecot: 2.2.22
Dovecot configuration: yes
AWstats: no
Exim: 4.87
exim.conf update: no
BlockCracking: no
Easy Spam Fighter no
SpamAssassin: no
ClamAV: no
MySQL: no
MySQL backup: yes
MySQL backup directory: /usr/local/directadmin/custombuild/mysql_backups
PHP (default): 5.5 as mod_php
phpMyAdmin: 4.6.0-all-languages
ProFTPD: no
Pure-FTPd: 1.0.42
RoundCube webmail: 1.1.4
Replace "php.ini" with '/usr/local/directadmin/custombuild/build all' and '/usr/local/directadmin/custombuild/build php_ini': no
Auto updates/notifications: no
Run "clean" every time: yes
Run "clean_old_webapps" every time: yes
Run "clean_old_tarballs" every time: yes
Show texts in bold: yes
SquirrelMail: 1.4.23-20150507_0200
Zend Guard Loader: no
ionCube loader: no
Suhosin: no
Apache: 2.4.20
mod_ruid2: 0.9.8
ModSecurity: no
Dovecot: 2.2.22
Dovecot configuration: yes
AWstats: no
Exim: 4.87
exim.conf update: no
BlockCracking: no
Easy Spam Fighter no
SpamAssassin: no
ClamAV: no
MySQL: no
MySQL backup: yes
MySQL backup directory: /usr/local/directadmin/custombuild/mysql_backups
PHP (default): 5.5 as mod_php
phpMyAdmin: 4.6.0-all-languages
ProFTPD: no
Pure-FTPd: 1.0.42
RoundCube webmail: 1.1.4
Replace "php.ini" with '/usr/local/directadmin/custombuild/build all' and '/usr/local/directadmin/custombuild/build php_ini': no
Auto updates/notifications: no
Run "clean" every time: yes
Run "clean_old_webapps" every time: yes
Run "clean_old_tarballs" every time: yes
Show texts in bold: yes
SquirrelMail: 1.4.23-20150507_0200
Zend Guard Loader: no
ionCube loader: no
Suhosin: no
Done!

I have tried to install sendmail :

Code:
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.mirror.triple-it.nl
 * epel: mirror.nl.leaseweb.net
 * extras: centos.mirror.triple-it.nl
 * updates: centos.mirror.triple-it.nl
 * webtatic: uk.repo.webtatic.com
No package sendmail available.
Error: Nothing to do

Tried SMTP: "Send mail to many users"

Code:
Zend_Mail_Protocol_Exception: Email to [email protected] failed: User account [email protected] has sent too many emails - library/Zend/Mail/Protocol/Abstract.php:431

According to Xenforo This is a generic error, a typical cause of which is due to having no message transfer agent (MTA) installed, which is the default configuration for most servers. Installing Postfix or Sendmail (root access required) with no specific configuration should be enough to resolve it.

I don't want to use SMTP but how i always did without a problem. Any advice how to get this fixed?
 
I think Toml rather means this one:
http://help.directadmin.com/item.php?id=354
Did you install all those?

You normally don't need to install sendmail. When installing cronie, also postfix will be installed. This should not be running because as TomL says, Exim is being used as MTA on Directadmin.
I was a little too enthousiastic and said to install sendmail, but normally that is not necessary. You can leave it but you can also do "yum remove sendmail" again to remove the package.

If you did install cronie as needed, postfix is installed as well so you should be fine anyway.

Can you give the output of this please?
chkconfig --list
 
I think Toml rather means this one:
http://help.directadmin.com/item.php?id=354
Did you install all those?

This one?
Code:
yum install wget gcc gcc-c++ flex bison make bind bind-libs bind-utils openssl openssl-devel perl quota libaio \
libcom_err-devel libcurl-devel gd zlib-devel zip unzip libcap-devel cronie bzip2 cyrus-sasl-devel perl-ExtUtils-Embed \
autoconf automake libtool which patch mailx bzip2-devel lsof db4-devel

Code:
atd             0:off   1:off   2:on    3:on    4:on    5:on    6:off
auditd          0:off   1:off   2:on    3:on    4:on    5:on    6:off
cgconfig        0:off   1:off   2:off   3:off   4:off   5:off   6:off
cgred           0:off   1:off   2:off   3:off   4:off   5:off   6:off
crond           0:off   1:off   2:on    3:on    4:on    5:on    6:off
da-popb4smtp    0:off   1:off   2:on    3:on    4:on    5:on    6:off
directadmin     0:off   1:off   2:on    3:on    4:on    5:on    6:off
dovecot         0:off   1:off   2:on    3:on    4:on    5:on    6:off
exim            0:off   1:off   2:on    3:on    4:on    5:on    6:off
httpd           0:off   1:off   2:on    3:on    4:on    5:on    6:off
ip6tables       0:off   1:off   2:on    3:on    4:on    5:on    6:off
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off
mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off
n2txd           0:off   1:off   2:on    3:on    4:on    5:on    6:off
named           0:off   1:off   2:off   3:off   4:off   5:off   6:off
netconsole      0:off   1:off   2:off   3:off   4:off   5:off   6:off
netfs           0:off   1:off   2:off   3:on    4:on    5:on    6:off
network         0:off   1:off   2:on    3:on    4:on    5:on    6:off
ntpd            0:off   1:off   2:on    3:on    4:on    5:on    6:off
ntpdate         0:off   1:off   2:off   3:off   4:off   5:off   6:off
portreserve     0:off   1:off   2:on    3:on    4:on    5:on    6:off
proftpd         0:off   1:off   2:off   3:off   4:off   5:off   6:off
pure-ftpd       0:off   1:off   2:on    3:on    4:on    5:on    6:off
quota_nld       0:off   1:off   2:off   3:off   4:off   5:off   6:off
rdisc           0:off   1:off   2:off   3:off   4:off   5:off   6:off
restorecond     0:off   1:off   2:off   3:off   4:off   5:off   6:off
rsyslog         0:off   1:off   2:on    3:on    4:on    5:on    6:off
saslauthd       0:off   1:off   2:off   3:off   4:off   5:off   6:off
sshd            0:off   1:off   2:on    3:on    4:on    5:on    6:off
startips        0:off   1:off   2:on    3:on    4:on    5:on    6:off
sysstat         0:off   1:on    2:on    3:on    4:on    5:on    6:off
udev-post       0:off   1:on    2:on    3:on    4:on    5:on    6:off
yum-cron        0:off   1:off   2:off   3:off   4:off   5:off   6:off
 
Last edited:
This one?
Yes that one, but I presume you already did that probably.
You asked about cronie... check that line:
zip unzip libcap-devel cronie bzip2 cyrus-sasl-devel
;)

Code:
portreserve     0:off   1:off   2:on    3:on    4:on    5:on    6:off
Has nothing to do with this issue, but I would set this off to prevent strange mysql issues.
Code:
/etc/rc.d/init.d/portreserve stop
chkconfig portreserve off

I see iptables is running, maybe that is blocking things?
Can you give me the output of:
iptables -L

Next to that, is this problem only when you are sending to many users? Or also when sending to a few user (less then 1000)?
 
Code:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

I have this problem even when I send a test mail to one person.
 
Oke firewall is allowing everything, thats for later concern.

I might just have found something better on the internet:
Create a file called testmail.php with the following content and put it somewhere in your public_html or subdirectory like admincp (maybe better):
Code:
    <?php 
        ini_set( 'display_errors', 1 );
        error_reporting( E_ALL );
        $from = "emailtest@YOURDOMAIN";
        $to = "YOUREMAILADDRESS";
        $subject = "PHP Mail Test script";
        $message = "This is a test to check the PHP Mail functionality";
        $headers = "From:" . $from;
        mail($to,$subject,$message, $headers);
        echo "Test email sent";
    ?>
Change the from and to addresses, use for example your private email address as the "to" address.

Now call it like this:
http://www.yourdomain.com/admincp/testmail.php

Or login to ssh as your account username and use it like this (first cd to where you have put the script):
Code:
php testmail.php

Now test if your mail got delivered. If yes, there is something wrong in either Xenforo or your settings in Xenforo.
If your mail does not get delivered, there should be errors visible in the logfiles like:
/var/log/httpd/domains/yourdomain.nl.error.log and
/home/username/.php/php-mail.log (watch the dot before php).

We might be able to tackle the issue this way a lot faster.
 
My mail gets delivered. Xenforo has always worked but stop working correctly after the server update.
 
Since your mail gets delivered, there is nothing wrong with the php mail() function.

Did you call the script via the url or via ssh as account user (not as root!!)?

Edit, it says too many emails send... check this too:
/etc/virtual/limit_username where username is the account your running xenforo on.
Is there a limit setup?
Als check your directadmin configuration if a limit is set. It looks more like that might be the issue. There is a limit set in the new directadmin by default, which was not done before.
 
Last edited:
Since your mail gets delivered, there is nothing wrong with the php mail() function.

Did you call the script via the url or via ssh as account user (not as root!!)?

Edit, it says too many emails send... check this too:
/etc/virtual/limit_username where username is the account your running xenforo on.
Is there a limit setup?
Als check your directadmin configuration if a limit is set. It looks more like that might be the issue. There is a limit set in the new directadmin by default, which was not done before.


[root@vps1 ~]# /etc/virtual/limit_lionsgroun
Code:
-bash: /etc/virtual/limit_lionsgroun: No such file or directory
 
directadmin.conf

Code:
SSL=0
add_userdb_quota=1
addip=/usr/local/directadmin/scripts/addip
admin_helper=admin.site-helper.com
admindir=./data/admin
apache_public_html=0
apache_ver=2.0
apachecert=/etc/httpd/conf/ssl.crt/server.crt
apacheconf=/etc/httpd/conf/extra/directadmin-vhosts.conf
apacheips=/etc/httpd/conf/ips.conf
apachekey=/etc/httpd/conf/ssl.key/server.key
apachelogdir=/var/log/httpd/domains
apachemimetypes=/etc/mime.types
brute_force_log_scanner=0
brute_force_time_limit=120
brutecount=5
bruteforce=1
cacert=/usr/local/directadmin/conf/cacert.pem
cakey=/usr/local/directadmin/conf/cakey.pem
check_partitions=2
check_subdomain_owner=1
clear_blacklist_ip_time=0
clear_brute_log_entry_time=14
clear_brute_log_time=48
cloud_cache=0
demodocsroot=./data/skins/enhanced
docsroot=./data/skins/enhanced
dovecot=1
emailspoolvirtual=/var/spool/virtual
emailvirtual=/etc/virtual
enforce_difficult_passwords=0
ethernet_dev=eth0
exempt_local_block=1
frontpage_on=0
ftpconfig=/etc/proftpd.conf
ftppasswd=/etc/proftpd.passwd
ftpvhosts=/etc/proftpd.vhosts.conf
ip_brutecount=3
license=/usr/local/directadmin/conf/license.key
litespeed=0
log_rotate_size=5
logdir=/var/log/directadmin
logger=/usr/local/directadmin/logger
loghostname=0
login_history=10
logs_to_keep=5
lost_password=0
max_username_length=10
maxfilesize=10485760
mysqlconf=/usr/local/directadmin/conf/mysql.conf
namedconfig=/etc/named.conf
nameddir=/var/named
nginx=0
nginx_proxy=0
ns1=ns1.cloudvps.com
ns2=ns2.cloudvps.com
numservers=5
owsadm=/usr/local/frontpage/version5.0/bin/owsadm.exe
partition_usage_threshold=95
port=2222
pureftp=1
purge_spam_days=0
quota_partition=/
removeip=/usr/local/directadmin/scripts/removeip
reseller_helper=reseller.site-helper.com
secure_access_group=access
servername=vps1.lionsground.com
serverpath=/usr/local/directadmin
session_minutes=60
skinsdir=./data/skins
sshdconfig=/etc/ssh/sshd_config
ssl_cipher=HIGH:!aNULL:!MD5
taskqueue=/usr/local/directadmin/data/task.queue
templates=/usr/local/directadmin/data/templates
ticketsdir=/usr/local/directadmin/data/tickets
timeout=600
tmpdir=../../../home/tmp
unified_ftp_password_file=1
user_brutecount=3
user_helper=www.site-helper.com
userdata=./data/users
 
Please check the files I mentioned for entry's.

I'm sorry, I did not mean directadmin.conf but if you login to directadmin.
http://hostname.yourdomain.nl:2222/CMD_ADMIN_SETTINGS
and then the section "Email". Probably it's a limit there.
Change to:
0
0
yes
-1 (or 0)

In that order. :) And 0=zero, not capital o.
Then click save, you might need to restart DA, not sure about that.
 
Please check the files I mentioned for entry's.

I'm sorry, I did not mean directadmin.conf but if you login to directadmin.
http://hostname.yourdomain.nl:2222/CMD_ADMIN_SETTINGS
and then the section "Email". Probably it's a limit there.
Change to:
0
0
yes
-1 (or 0)

In that order. :) And 0=zero, not capital o.
Then click save, you might need to restart DA, not sure about that.

Bammm!!! You did it!
 
Great that we found it. :)
Just watch things a little, because now there is unlimited traffic from php mail. If a script get's hacked you will have no php email limits at the moment.

Yep, I talked about a firewall.
Have look at configserver firewall. In fact you can also disabel both iptables and ip6tables:
chkconfig iptables off
chkconfig ip6tables off
because both aren't doing anything at the moment anyway.

Configserver has a DA plugin, which lets you also configure most part of your firewall through the DA control panel.
http://download.configserver.com/csf/install.txt
It might be wise to open a new thread for that.
Also you can probably better use ./install_directadmin.sh instead of ./install.sh as told in install.txt.

It sets up your firewall totally, opens needed ports for directadmin etc. and starts the firewall based on iptables itself. In testmode at first so if you locked yourself out (probably not going to happen first time) after 5 minutes it will disable itself and you can change things if needed.
There are also some services which you can put in an ignore file.
But I can help you with that in a seperate thread, otherwise it's going off-topic here probably.
 
Back
Top