0

Ajenti V Mail - 550 relay not permitted

neet_jn 4 years ago • updated by CreativeWolf 4 years ago 5
Hello all! So, here I am with a clean server running CentOS 7, and the first thing that came to mind was installing Ajenti. After successfully installing Ajenti and Ajenti V, properly setting up my client's website, I made way to creating a mailbox. Now, I've encountered many problems past this point, so I'll include my DIY fixes after my main question.

My current issue, is that I cannot send or receive any emails from/into my mailbox. I have exim running, but no luck. I can log into the email server using IMAP and successfully connect to SMTP, but when attempting to do either of these actions I receive the error message -- relay not permitted. I can also check my inbox via IMAP, but that's the extent of my prowess. I'm not sure what else to do, I've been at this for hours. Any suggestions would be duly appreciated!

Courier Fix For Ajenti-V-Mail Install - CentOS

> This is for those having trouble installing Ajenti-V-Mail on CentOS

1. If you're coming from a clean install of CentOS, and haven't already installed the epel repo, do so by following these instructions - http://www.rackspace.com/knowledge_center/article/install-epel-and-additional-repositories-on-centos-and-red-hat.
2. Download the latest version of Courier here, http://www.courier-mta.org/download.html. As of yet there aren't any reliable repos with Courier RPMs available for RHEL/Cent.
3. Install rpmbuild if not installed already with the following command,
sudo yum -y install rpm-build
4. Log into CentOS using a regular account, not root. If you don't have one already then you can create it by using the following commands,
sudo adduser bob
sudo passwd bob
5. In your home directory build Courier like so ( from your downloaded archive ),
rpmbuild -ta courier.tar.bz2
6. Navigate your built RPMs in the newly created "rpmbuild" directory.
cd rpmbuild/RPMs
7. Delete all the unnecessary RPMs
  • maildrop
  • mlm
  • sqweb
rm -rf x.rpm
8. Try installing every remaining RPM with the following command
rpm -ivh *
8a. If you receive any dependency errors, try installing them by their given name with yum.
8b. If you cannot find the package via your available repos, your best bet would be google.
8c. If you receive any missing perl package errors run the following command,
yum -y install perl*
9. You should now be safe to install ajenti-v-mail without any given dependency errors.

IMAP Connection Refused - CentOS

> This is for those having trouble connecting to IMAP on CentOS with Courier

1. Make sure courier-imapd service is running.
systemctl start courier-imap
2. Open the following ports for IMAP/SMTP if not already done.
  • 143
  • 465
  • 993
  • 25
  • 587
This can be done via Ajenti's web panel or CLI with the following commands,
firewall-cmd --permanent --zone=public --add-port=143/tcp
firewall-cmd --permanent --zone=public --add-port=465/tcp
firewall-cmd --permanent --zone=public --add-port=993/tcp
firewall-cmd --permanent --zone=public --add-port=25/tcp
firewall-cmd --permanent --zone=public --add-port=587/tcp
firewall-cmd --reload
Update : So I tried running the following exim check out of curiosity,
exim -bt foo@mydomain.tld
and received the following output,
foo@mydomain.tld is undeliverable: Unrouteable address
Wish I could've waited for a response but my clients were being picky, had to move back to ZPanel/Sentora. The reason I love Ajenti is because it's Node-friendly. I'd still appreciate any possible suggestions on a fix, for future reference.
Just tried ajenti-v-mail off a clean Ubuntu install 14.04 LTS and received the same error message --

2015-07-14 06:14:44 H=(example.com) [::1] F=<steve@example.com> rejected RCPT <john@example.com>: relay not permitted

Heya,


Not sure if you are still keen to know, ran in to the same issue of "relay not permitted".


The issue is with courier-authdaemon - When you do a netstat -tulpna you'd see couriertcpd is running but when you run

service courier-authdaemon status 

you would get the following error message - At least that's what I got on Ubuntu 14.04


/etc/init.d/courier-authdaemon: invalid arguments
 * could not access PID file for authdaemond

After a bit of googling, stumbled on this link - http://blog.cyberlynx.eu/2015/courier-authdaemon-init-script/


Just a little bit of tweaking in the following line in /etc/init.d/courier-authdaemon


status_of_proc -p "$pidfile" "courier-authdaemon" "authdaemond" && exit 0 || exit $?

The original line would be as follows

status_of_proc -p "$pidfile" "" "authdaemond" && exit 0 || exit $?

After making that change, when you restart courier-authdaemon it would run but you'd get the following error in /var/log/exim4/mainlog


failed to connect to socket /var/run/courier/authdaemon/socket: Permission denied

You'll have to change the permission of /var/run/courier/authdaemon to 777.


Now, restart courier-daemon and exim4, this fixed the issue for me.


Hope this helps.


Cheers


PS: I was too quick to post, once I restarted the server, ran in to same error of Permission Denied, change the following line

mkdir -m 0750 $rundir  

like this

mkdir -m 0777 $rundir

Restarted the server and found it to work this time around!

+2
i made tutorial for installing ajenti on centos 7 
this is the part for installing ajenvi-v-mail

disable se-linux and firewalld 

# yum install ajenti-v-mail 
if you get error
    installing manually exim
    # yum install exim
    # adduser uucp
    # systemctl start exim
    # systemctl enable exim
    
    installing manually courier
        first install rpm-build
        # yum install rpm-build
        download courier
        # wget http://sourceforge.net/projects/courier/files/courier-unicode-devel/20150228/courier-unicode-1.1.20150228.tar.bz2
        # wget http://sourceforge.net/projects/courier/files/authlib/0.66.2/courier-authlib-0.66.2.tar.bz2
            if you get error from above wget , go to http://sourceforge.net/projects/courier/files/, and download manualy 
        install needed package
        # yum install libtool openldap-devel mysql-devel zlib-devel sqlite-devel postgresql-devel gdbm-devel pam-devel expect gcc-c++  perl-Digest-MD5 libtool-ltdl-devel libtool-ltdl libidn-devel fam-devel
        build rpm for courier 
        # rpmbuild -ta courier-unicode-1.1.20150228.tar.bz2
        # cd /root/rpmbuild/RPMS/x86_64
        # rpm -i courier-unicode-1.1.20150228-1.el7.centos.x86_64.rpm
        # rpm -i courier-unicode-debuginfo-1.1.20150228-1.el7.centos.x86_64.rpm
        # rpm -i courier-unicode-devel-1.1.20150228-1.el7.centos.x86_64.rpm
        # cd
        # rpmbuild -ta courier-authlib-0.66.2.tar.bz2
        # cd /root/rpmbuild/RPMS/x86_64
        # rpm -i courier-authlib-0.66.2-1.el7.centos.x86_64.rpm
        # rpm -i courier-authlib-debuginfo-0.66.2-1.el7.centos.x86_64.rpm
        # rpm -i courier-authlib-devel-0.66.2-1.el7.centos.x86_64.rpm
        # rpm -i courier-authlib-ldap-0.66.2-1.el7.centos.x86_64.rpm
        # rpm -i courier-authlib-mysql-0.66.2-1.el7.centos.x86_64.rpm
        # rpm -i courier-authlib-pgsql-0.66.2-1.el7.centos.x86_64.rpm
        # rpm -i courier-authlib-pipe-0.66.2-1.el7.centos.x86_64.rpm
        # rpm -i courier-authlib-sqlite-0.66.2-1.el7.centos.x86_64.rpm
        # rpm -i courier-authlib-userdb-0.66.2-1.el7.centos.x86_64.rpm
        # adduser courier-user
        # passwd courier-user
        # su courier-user
        # cd
        # wget http://sourceforge.net/projects/courier/files/imap/4.16.1/courier-imap-4.16.1.tar.bz2
        # rpmbuild -ta courier-imap-4.16.1.tar.bz2
        # su
        # cd /home/courier-user/rpmbuild/RPMS/x86_64
        # rpm -i courier-imap-4.16.1-2.x86_64.rpm
        # rpm -i courier-imap-debuginfo-4.16.1-2.x86_64.rpm
        # yum install ajenti-v-mail 
        # systemctl start courier-imap 
        # systemctl enable courier-imap 
        # systemctl start courier-authlib 
        # systemctl enable courier-authlib