I am running Plesk for Linux and I've noticed that emails are sent very very slow. As a result, emails are delayed..
I was able to research a fix to at least speed up the sending of emails in Plesk.
Login thru SSH and go to /etc/xinetd.d and edit the smtp_psa file.
The file should look like this:
------------------------------------------------------------------------------------------------------
service smtp
{
socket_type = stream
protocol = tcp
wait = no
disable = no
user = root
instances = UNLIMITED
server = /var/qmail/bin/tcp-env
server_args = /usr/sbin/rblsmtpd -r bl.spamcop.net -r cbl.abuseat.org -r sbl-xt.spamhaus.org /var/qmail/bin/relaylock /var/qmail/bin/qmail-smtpd /var/qmail/bin/smtp_auth /var/qmail/bin/true /var/qmail/bin/cmd5checkpw /var/qmail/bin/true
------------------------------------------------------------------------------------------------------
you are going to do is, add "-Rt0" (minus the quotes" ") to "server_args" so it will look like:
server_args = -Rt0 /usr/sbin/rblsmtpd -r bl.spamcop.net -r cbl.abuseat.org -r sbl-xt.spamhaus.org /var/qmail/bin/relaylock /var/qmail/bin/qmail-smtpd /var/qmail/bin/smtp_auth /var/qmail/bin/true /var/qmail/bin/cmd5checkpw /var/qmail/bin/true
Save the file, and restart xinetd:
/etc/init.d/xinetd restart
This should help speed up the sending of emails in Plesk.
You are here because you have seen the following message in either /var/log/qmail/qmail-smtpd/current or /var/log/qmail/qmail-pop3d/current.
tcpserver: fatal: unable to bind: address already used
If you see this error message, the problem is that another program has bound to the address to which you are trying to bind. Stop the revelant service with using the svc command. Verify the service is down with the svstat command. The below example will use the qmail-smtpd service.
# svc -d /service/qmail-smtpd
# svstat /service/qmail-smtpd
The service should show as down. Next run the following command to verify another program has bound to the port using the netstat and grep commands. The below example continues with the qmail-smtpd service as will the rest. If you are experiencing this problem with qmail-pop3d, substitute 110 in place of 25. If the command returns something, then another program is bound to that port.
# netstat -an grep 25
After determining something is indeed bound to the address, determine what program is with the lsof command.
# lsof -n -i:25
The output of lsof will tell you what program is running on that port. You need to stop that program and remove it and its related start scripts. Once this is completed, you can restart the service by using the svc command.
# svc -u /service/qmail-smtpd
Now verify that the service has started correctly with the svstat and tail commands.
# svstat /service/qmail-smtpd
# tail /var/log/qmail/qmail-smtpd/current
The svstat command should show the service running for more than one second. The tail command should also show that the service has started correctly and the address already in use message has disappeared.
Preventing this error:
The two most common causes of this error are:
1. Not stopping any pre-existing mail server software. If you are installing qmail on a machine which already has sendmail, postfix, exim, or some other mail server installed (possibly installed by default with your OS distribution) you need to make sure that this other program is not only stopped, but is not configured to run automatically when the system boots.
For RedHat, Fedora, CentOS, Whitebox, and other RedHat-like systems, you can use the chkconfig command to make sure these other services will not start automatically when the system boots. You may need a command like this:
# chkconfig --level 2345 sendmail off
For debian linux, there is a similar command called update-rc.d. A similar command would look something like this (and if somebody knows debian better than I do, please correct me here...)
# update-rc.d -r -f sendmail
2. Running two services on the same port without specifying separate IP addresses. Note that running one service with a specific IP address and another service with 0.0.0.0 (or just 0) as the IP address is the same thing- the service running with 0.0.0.0 will try and attach to every IP address on the machine, and if anything is already attached to even one of those IPs, it will fail. Likewise, if there is a service running on 0.0.0.0 and another service tries to start which uses the same port a single IP, it will fail. There is no way to "share" a port on any single IP address- if you need to share a single port between two services, those services MUST be listening on different IP addresses, and neither of them can use 0.0.0.0.
Retrieved from "http://www.qmailinfo.org/index.php/UnableToBindAddress"
PHP mail function stopped working after Plesk qmail reinstallation
Posted by adminix Labels: PHP, Plesk, qmailOne client's contact form that is using the PHP mail function suddenly stopped working. I thought it was a misconfiguration on sendmail:
[mail function]
; For Win32 only.
SMTP = localhost
; For Win32 only.
sendmail_from = me@localhost.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /usr/sbin/sendmail -t -i
You are using qmail!
Bummer! Looking back into my notes,I found out that qmail supports sendmail binaries so it doesn't matter whether PHP specifies the old path to sendmail.
And prior to that day, we reinstalled Qmail.(Server got hit by a spammer) So maybe we messed up a bit with the symlinks.
Solution:
Link the sendmail binary with qmail-sendmail using this command:
ln -s /var/qmail/bin/qmail-sendmail /usr/sbin/sendmail
That solved the problem. Hope this post helps you too.
The title says it all. Here's a simple how to from
a great wordpress blogger.
Here are the steps in changingthe outgoing mail port for Plesk.
1. Create a copy of smtp_psa by entering:
# cp /etc/xinetd.d/smtp_psa /etc/xinetd.d/smtp_nonstandard
2. Add these lines to the copy you just made.
#vi /etc/xinetd.d/smtp_nonstandard
type = "UNLISTEDport = 2525" <>and change the service name to match the name of the file.
3. Restart xinetd.
# /etc/init.d/xinetd restart
You should now be able to send mails through port 2525. You can also use any available port you want.
