You see the “qmail-inject: fatal: mail server permanently rejected message” error message while sending emails from a Plesk server and the error message such as follows in the mail logs:
qmail-queue-handlers[xxxx]: Unable to change group ID: Operation not permitted
qmail-queue[xxxx]: files: write buf 0xbff4dfe0[156] to fd (5) error – (32) Broken pipe
qmail-queue[xxxx]: files: cannot write chuck from 4 to 5 – (32) Broken pipe
It is due to the incorrect permission/ownership of the ‘qmail-queue’ file under the “/var/qmail/bin” directory. Make sure
the ownership is ”mhandlers-user:popuser’
the permission is 2511.
Check the current ownership/permission:
# ls -la /var/qmail/bin/qmail-queue
It should be as follows:
-r-x–s–x 1 mhandlers-user popuser 67804 May 4 08:41 /var/qmail/bin/qmail-queue
If not, correct the ownership
# chown mhandlers-user.popuser /var/qmail/bin/qmail-queue
set the proper permissions,
# chmod 2511 /var/qmail/bin/qmail-queue
Restart Qmail once and see if the email works.
Note: If the emails still doesn’t work, please comment this post with the error message and the output of the following command and I will find out the solution for you:
ls -la /var/qmail/bin/qmail-queue*
#yum install postfix*
#vim /etc/postfix/main.cf
line no. 77 mydomain = san.com
93 myorigin = $mydomain -----------uncomment this line
69 myhostname = pc1.san.com
115 mydestination = $myhostname, localhost.$mydomain, localhost
(uncomment this line if it is commented)
225 mynetworks = 192.168.0.0/24 (define your network here)
107 inet_interfaces = all (uncomment this line)
:wq! save and exit now
#yum install system-switch-mail*
#system-switch-mail
and select MTA agent Postfix and ok
#service postfix start
Now u can send mail using postfix server by sandeeprhce5
This post helps to install and configure a mail server with postfix as MTA[ (Mail Transfer agent), Dovecot as MDA (Mail Delivery Agent) and Squirrel mail as MUA (Mail User
Agent). This is a simple basic configuration without much advanced configurations. This is tested in Redhat linux and will also work in other redhat disrtos like
fedora, centos etc.
Assuming you have a configured yumserver. Else use the rpms.
#yum install postfix* dovecot* Squirrelmail*
Steps
1. Configure the DNS eg: example.com
2. Select the defalt MTA as postfix. Most systems it will be Sendmail.
#alternatives --config mta
Select postfix.
3. open the configuration file of Postfix and edit the following.
#vi /etc/postfix/main.cf
edit the following
1. my domain
2. my hostname
3. inet_interfaces
and reload the service.
4. Configure the Squirrel mail
#cd /usr/share/squirrelmail/config/
run the perl file
#./conf.pl
Give
1.Domain name
2.host name [FQDN]
3.protocol
5. Configure the dovecot
#vi /etc/dovecot.conf
protocols = imap
save it and restart the service.
#service dovecot restart
#chkconfig dovecot on
6. Add the MX entry to DNS. Dont fotget to give the priority.
7. Resolve the hostname in /etc/hosts.
8. Start the httpd [apache]
9. Thats it. you can now access the webmail through
http://example.com/webmail
This document helps to configure a mail server with sendmail as MTA[ (Mail Transfer agent), Dovecot as MDA (Mail Delivery Agent) and Squirrel-mail as MUA (Mail User
Agent). This is a simple basic configuration without much advanced configurations. This is tested in Redhat linux and will also work in other redhat disrtos like
fedora, centos etc.
Steps:
#yum -y install sendmail* dovecot* squirrelmail* bind* #Bind for DNS
#yum -y install caching-* #for DNS
Remove the hostname conflicts from /etc/hosts /etc/sysconfig/network
You must set a Fully Quallified Domain name [FQDN]
#sysctl -p
#rm -rf /etc/mail #if necessary
#rm -rf /var/named #If necessary. If DNS already exists, dont do this.
#service network restart
Now configure the DNS. If already existing add the entries to it.
Configure the dns as example.com
Check the following command returns the correct IP.
#nslookup example.com
Now Configuring MTA (sendmail)
#vi /etc/mail/sendmail.mc
Comment the lines 116 and 155. I.e add 'dnl' to the begining of those lines
eg:
dnl DAEMON_OPTIONS
Uncomment the line 160. I.e remove 'dnl' from the begining of the line.
eg:
MASQURAD_AS (example.com)
#cd /etc/mail
#make restart
#chkconfig sendmail on
Now installing the MUA (squirrel mail)
#vi /etc/mail/local-host-names
example.com
save it
Now installing the MDA (dovecot)
#vi /etc/dovecot.conf
protocols = imap
save it and restart the service.
#service dovecot restart
#chkconfig dovecot on
now
#cd /usr/share/squirrelmail/config/
run the perl file
#./conf.pl
Give
1.Domail name
2.host name
3.protocol
Configuring DNS
IN NS
IN MX
Save it and reload the named service.
add the nameserver ip to
/etc/resolv.conf
You can access the webmail through
http://example.com/webmail