• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

QMail Configuration

trialotto

Golden Pleskian
Plesk Guru
A number of issues arise, when using Qmail with Plesk 9.2.2. Most common problems can be resolved by taking simple steps.

Solutions to a lot of the problems have already been given by others, in this and other forums. Other problems are not yet resolved and people seem to be stuck with it.

In essence, I missed some general overview of the problems and the solutions to them.

In this thread, i do an effort to channel the Qmail Configuration issues.

Please add your problem and/or solution!
 
Hostname configuration for Qmail and Plesk

The configuration of the hostname in Qmail should be proper, otherwise potentially resulting in unnecessary errors and problems.

The problems mostly arise from the files /var/qmail/control/me and /var/qmail/control/locals and their contents.

Common issues:

A - Hostname in plesk control panel is FQDN and qmail uses <serverShortname>
The plesk control panel contains a FQDN name, often of the form <serverShortname>.<serverDomainname>.tld.
The qmail files contain /var/qmail/control/me and /var/qmail/control/locals only a line with <serverShortname>.

Problem: not really, since it does not hinder Qmail.

Advice: change the <serverShortname> entries in /var/qmail/control/me and /var/qmail/control/locals to a FQDN name. This FQDN name should at least be <serverShortname>.<serverDomainname>.tld, but other FQDN names can be used (but aware of the implications thereof).

Note: Do not manually change the files, in order to prevent problems !

Solution:
1 - open Plesk Control Panel and go to settings (in Plesk 9.2) and select change hostname.
2 - copy the FQDN name (already present in the server host name input box)
3 - delete the server host name
4 - paste the FQDN name and press OK
5 - check the files /var/qmail/control/me and /var/qmail/control/locals

B - Adding custom FQDN name
The FQDN name used by plesk control panel is often a name that contains naming elements, assigned by your hosting/service provider.

This is somewhat undesirable, but cannot do harm. A malconfigured custom FQDN name can do more harm.

However, custom FQDN names can be worthwhile when serving customers, and when defining spf records. The latter is valuable when using a set of mail servers, dealing with and filtering mails for spam and viruses.

Most important: a custom FQDN name can be used for setting up spf filters that are to be considered as qmail local.
A lot of daemon mailing activity is initiated by qmail locally, hence resulting in some security issues if the daemon mail addresses can be used for spamming (amongst others).

Therefore, a first step for setting up spf filters (amongst other security measures) would be changing the FQDN hostname to a custom one.

Solution:
1 - open Plesk Control Panel and go to settings (in Plesk 9.2) and select change hostname.
2 - enter the desired FQDN name (in the server host name input box), preferably with the name format <subdomainName>.<domainName>.tld
3 - press OK

Note: in some known cases, the change of a hostname can result in various problems for qmail. Solutions to these problems, if available, can be found in other posts in this thread.
Let me know, when you encounter a new one.
 
Qmail and DrWeb

Qmail and DrWeb can work properly together, but sometimes it is somewhat peculiar and issue can arise. Some known issues below.

A - Mail not checked due to license limitations
A full license of DrWeb is not delivered with Plesk and should be bought separately. Many problems do coincide with this license issue.

Problem: Mail not checked due to license limitations

Problem reflection:
1 - Errors in the files /usr/local/psa/var/log/maillog and /var/log/mail.* with text similar to: "...not checked due to license limitations..."
2 - Notifications send to the administrator, with text similar to the above.
3 - Errors in the file /usr/local/psa/var/log/maillog with text similar to " ... cannot find drweb32.key..."

Solution: Buy or activate a full license

Note: if reflection 3 is present, something else (and more severe) can be the issue. In this case, check out whether you can find /opt/drweb/drweb32.key. If you can find it, try to go to the plesk control panel, to license management (under settings) and try to activate the license key. If that does not work, other problems are present.
 
Empty maillog

The maillog file (/usr/local/psa/var/log/maillog) is often found to be empty. A list of causes and resolution thereof.

If the files /var/log/mail.* (such as mail.info) are non-empty and the /usr/local/psa/var/log/maillog is empty, then proceed to B (if that does not resolve your problem, then also look at A).

If both A and B are implemented and that does not resolve your issue, then read the post regarding "Ownership of qmail-local".

Remark: the list is validated for a Plesk 9.2.2 / OpenSuse 11.1 install.

Note: should also apply for previous versions of Plesk
Note: in other distributions of linux: replace <syslog-ng> by the corresponding syslog program/names. You can find information (name/pid etc) about the corresponding syslog program with the command: ps aux | grep syslog*

A - syslog-ng.conf not proper

Cause: The configuration file does not contain a line for combined output of maillogs into the file /usr/local/psa/var/log/maillog.

Solution:
1) Find the lines containing the mail logs in /etc/syslog-ng/syslog-ng.conf and change to:

# Mail-messages in separate files:
#
destination mailinfo { file("/var/log/mail.info"); };
log { source(src); filter(f_mailinfo); destination(mailinfo); };

destination mailwarn { file("/var/log/mail.warn"); };
log { source(src); filter(f_mailwarn); destination(mailwarn); };

destination mailerr { file("/var/log/mail.err" fsync(yes)); };
log { source(src); filter(f_mailerr); destination(mailerr); };

#
# and also all in one file:
#
destination mail { file("/usr/local/psa/var/log/maillog"); };
log { source(src); filter(f_mail); destination(mail); };

NOTE: you can leave the first lines out, if you want to prevent double logging

2) restart service with command: service syslog restart

B - AppArmor installed

In a lot of linux installs, AppArmor is activated. That should not be a problem.

Cause: AppArmor profile for /sbin/syslog-ng is not properly configured

Solution:
1) go to /etc/apparmor.d
2) open sbin.syslog-ng (use command: vi sbin.syslog-ng)
3) change the line
@{CHROOT_BASE} = ,
to
@{CHROOT_BASE} = /,
and save
4) restart apparmor with the command: rcapparmor restart

Everything should be fine now and (after some seconds) your file /usr/local/psa/var/log/maillog is filled
 
Permission denied - Ownership qmail-local

Qmail can present some errors in the maillog file. The most common is very likely to be:

qmail-local-handlers[......]: cannot create temporary file - (13) Permission denied

A solution to this problem has been given in the following thread:

http://forum.parallels.com/showthread.php?t=87343

In his post, Johannes Frank simply points out the solution (and indicates a bug in the qmail default installation).

A summary of steps:
1 - go to /var/qmail/bin
2 - change ownership of qmail-local, with command: chown mhandlers-user.popuser qmail-local
3 - do the following command: chmod g+s,g-r,o-r
4 - restart qmail with the command: service qmail restart

Problem should be resolved now.
 
QMail and Hotmail

The mail servers in Plesk can have problems with mails coming from Hotmail.

To be more precise, three issues can arise. These two issues have different causes and solutions.

A - Error message: qmail-smptd timeout
The mail log (/usr/local/psa/var/log/maillog) can be stating errors of the kind:

"possible qmail-smtpd exited by timeout, reset connection or with "See http://pobox.com/~djb/docs/smtplf.html."

An excellent thread and solution considering this problem has already been given in the forums:

http://forum.parallels.com/showthread.php?t=94222

Have a look and solve the problem!

IMPORTANT: the above mentioned thread is only for the errors mentioned above. Otherwise, see below.

B - Error message: DEFER
Hotmail messages are not being received and/or delivered by qmail, due to grey listing settings.

In this case, the error messages in the file /usr/local/psa/var/log/maillog contain the DEFER result, when starting the greylisting filter and the associated handler.

The error message is of the form:

"call_handlers: DEFER during call '/usr/local/psa/handlers/info/05-grey-xxxxxx/executable' handler"

In most cases, this is a combined problem: a broken handler and hotmail adresses being blocked (due to an unknown reason).

SOLUTION: follow the instructions on http://kb.odin.com/en/6410
Advice: follow the instructions at the bottom and rebuild all handlers

Note: it is very likely that more has to be done in order to solve your problem, since it is a combined problem. Try this rebuilding of handlers first and, if not succesful, proceed with C.

C - Rejection of hotmail addresses
Hotmail is sending mail from and via various servers. QMail is accepting mail from hotmail.com in some cases and in other cases, it doesn't.

This problem has nothing to do with qmail not working: it is caused by strange behavior from the grey listing filter.

For reasons unknown to me, specific hotmail servers are blocked. It seems to be that those servers are being regarded as black listed. With that interpretation, a simple solution is available.

SOLUTION: allow hotmail explicitly on the grey listing whitelist, by running the command:

/usr/local/psa/bin/grey_listing -u -domains-whitelist add: *hotmail.com

NOTE: there is an inherent danger in this solution, since this opens up spam possibilities and we all know that hotmail.com is a spammers paradise. You can resolve this by simply adding specific hotmail addresses instead of the hotmail domain. In order to do so, issue the command:

/usr/local/psa/bin/grey_listing -u -whitelist add: <allowedMailname1>@hotmail.com, <allowedMailname2>@hotmail.com [etc]

Advice I: add individual addresses instead of the domain, since the generic whitelist and the mailnames upon it are also shared by the spam filter.

Advice II: add additional spam control to your qmail configuration, like qgreylisting or spamdyke.
 
Last edited:
Hostname configuration for Qmail and Plesk

Hi trialotto,

i have a question about the Hostname configuration. Because my guess is, that it would solve the small issue i have at the moment.

I have been getting 3-5 Emails daily from my Mailserver about a "failure notice". With the nice

I tried to deliver a bounce message to this address, but the bounce bounced!

No "big problem" since the reason is "understandable".

In the actual first email (inside that failure notice) it says:
(Which assured me that there was "only" a internal problem, cause when i first read "failure notice" i first thought: Woah...please no spam...)

Return-Path: <[email protected]>
Received: (qmail 1771 invoked by uid 105); 20 Oct 2009 18:30:28 +0200
Date: 20 Oct 2009 18:30:28 +0200
Message-ID: <20091020163028.1756.qmail@hxxxxxxx>
From: [email protected]xx
To: [email protected]xx
Subject: Cron <drweb@hxxxxxxx> /opt/drweb/update.pl

Problem is:

IF drweb would try sending via [email protected] it would probably work (i think ^_^)...since it's the only service whose msg. i get.

After i found your entry about "changing" the Hostname I looked into that...long story short, my qmail files look like this:

/var/qmail/control/me


/var/qmail/control/locals

localhost
localhost.localdomain
hxxxxxxx

I tried changing this via plesk (9.2), but no matter how often I try changing it in the "change hostname" panel, nothning happens with the files.
I haven't tried manually since I also don't want qmail to "suffer" (as you also suggested).

I should btw. add that the files belong to root and are set to 644... Which I think should explain why nothing happens through plesk...
Question is: Should it be like that?

Would it be enough to just change the access rights? Haven't tried that yet, since its no big deal atm. to just discard a few mails daily...
(Im used to receive SPAM on my WEB.DE address...which, I should add has luckily decreased lately!)

Or should i just deactive that update-msg. completely? I saw something about it somewhere in the forum...^_^

Oh yes... I have Opensuse 11.1.

Hope i didn't forget anything and that you can help me with this small issue!
Thanks in advance.

greetz
MaNIaC
 
Last edited by a moderator:
StefanG or should I say MaNIaC?

At a first glimpse, it seems to be that access rights are not correct.

After reading more carefully, it seems to be the case that you probably have two minor problems, in stead of one.

Problem I - Hostname and changing in Plesk
You should use the FQDN name and you can change that in Plesk or editing the files /var/qmail/control/locals and /var/qmail/control/me.

Changing in Plesk only requires that you should have:

-rw-r--r-- 1 root root 55 Oct 14 22:43 locals (same for the file me)

Hence, 644 should be ok. However, that doesn't work for you, since changing in Plesk does not work for you (did you try to restart qmail?). Then i am rather curious how Plesk itself is installed on your machine, since there seems to be some rights and ownership conflict in your installation.

NOTE: use the manual editing of the files in question, then your mail problem at least is solved.

Problem II - Failure notice
You stated that there is a bounce and that this is related to drweb. Although that is not very clear, i can recall such an issue. I will assume that the mail send to drweb@xxxx is being bounced.

The bounce can be due to two problems, the first of them being the hostname. That can be resolved by changing the files local and me, in order to include the FQDN name.

The second of them is related to the proper setup of drweb mail. If this is the case, your maillog (/usr/local/psa/var/log/maillog) should be including lines with content similar to : "drweb@ ... Mail directory not found."
NOTE: often it states drweb@var .....

This is often the result of bugged change from postfix to qmail or a bugged installation of qmail in general.

It should be sufficient to:
1 Check whether the file /var/drweb/.qmail exists and if yes, check that the contents are: &root
2 If not create file /var/drweb/.qmail manually via the command line and add the contents mentioned in 1.
3 restart qmail with the command: service qmail restart
4 send yourself a mail in order to check the proper working....

Let me know if this does not help you....
 
Is there any way to have Plesk configured in such a way that, for a certain domain, mail accounts are managed locally in plesk and mail is spam-checked before being relayed to another mail server? I found that if I smtproute the domain, I must turn off mail for that domain in order to have mail routed, hence it is not spam-scanned.

Thanks in advance.
 
Relay Settings - Part 0

Is there any way to have Plesk configured in such a way that, for a certain domain, mail accounts are managed locally in plesk and mail is spam-checked before being relayed to another mail server? I found that if I smtproute the domain, I must turn off mail for that domain in order to have mail routed, hence it is not spam-scanned.

Thanks in advance.

Smtp routing can be handy if you want to use a domain to filter all incoming mails and send specific mails to the final adresses.

There are many settings possible, but the first thing you should be aware of: NEVER use a domain for filtering and relaying purposes, if that domain is on the same server as the domains/mailaddresses to which the mails are being relayed.

Seems obvious, but this happens too often.

From what you are saying, i can imagine that this is also the case with your setup. If my intuition is correct, relaying is not meaningful for you.

Ok, the above is of minor importance: what is important, is that you want to relay and have a domain filter the incoming mails.

Depending on your existing set up, a proper solution can be suggested. Can you describe more?
 
Results

Hi trialotto,

Maniac is ok. ^-^ Why the forum displays my name partially and not the nick i set up...No idea.. and i don't care! ^-^

Anyway:
Seems that the access rights of the file were good then. The plesk on my system was installed by my Provider were I bought the server. STRATO

As far as i could tell, that was the only problem with rights in my system until now (that i could find).
I've tried changing the locals and the me file manually with success!

So the Host name problem is done. Thx for that!

Now the emails are at least trying to be delivered (in fact, some other system messages are), but with the problem you already mentioned with drweb... a not existing mailbox (drweb). The reason for that is probably also what you described: the missing .qmail which i created.

Btw. I had installed drweb through plesk. So nothing done "manual".
The biggest thing i noticed why i got so "many" failure notices was, that for some reason plesk had set the update.pl of drweb to run every 30 Min. Which is I think a little much since it also kinda spams my /var/log/messages file each time with the whole update process...
So I set that to @midnight, that's enough in my opinion.

The thing im a little confused about is this nice update.pl of drweb, because when it was still set to every 30 min. it didn't always try to send an email....only once every 2-3 hours....

But in any case. Since i changed the host name to the FQDN name and created the .qmail file in drweb, i think that all my problems should be solved. If you could have really called them problems.

Server was running, the Admin (me) only didn't like error messages of successful update messages that he doesn't really care about most of the time anyway since he checks the server each day...(well...atm. at least) ^_^

Thx for your help! If something else comes up, I know where to find more of it! ^-^

greetz
Maniac
 
Last edited by a moderator:
Maniac,

1 - Disable them completely (can be done, but is not wise)
2 - Disable them partially (in specific log files, such as the mail log of plesk mail server, or the /var/log/messages file. Can be done, but again...not wise)

and my favourite:

3 - Just create a specific "catchall" mail address for drweb mails......Follow steps below:

a) create a new mail account on a domain of your choice (a domain that is owned by you, the administrator)
b) open command line utility and go to /var/qmail/alias
c) change contents of file .qmail-root and .qmail-drweb-daemon to only contain the line &<newmailName>@<domainofyourchoice>.tld

Every mail is then routed to that new mail account and it is not coming in into the administrator's mail account (as identified in plesk control panel).
 
Hello,

since the update from 9.2.2 to 9.2.3 i have problems with qmail. I think nearly the same problem than StefanG had. I'am using also a server of Strato. At first i changed the servername (FQDN) at files /var/qmail/control/locals and /var/qmail/control/me from h1373333 to h1373333.stratoserver.net.
I also created the missing .qmail file at /var/drweb/ and insert "&root".

But i still get following message:

Hi. This is the qmail-send program at h1373333.stratoserver.net.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

<[email protected]>:

--- Below this line is a copy of the message.

Return-Path: <[email protected]>
Received: (qmail 3006 invoked by uid 111); 25 Oct 2009 00:32:05 +0200
Date: 25 Oct 2009 00:32:05 +0200
Message-ID: <[email protected]>
From: [email protected]
To: [email protected]
Subject: Cron <drweb@h1373333> /opt/drweb/update.pl
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/var/drweb>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=drweb>
X-Cron-Env: <USER=drweb>

Dr.Web (R) update details:
Update server: http://update.msk3.drweb.com/unix/500
Update has begun at Sun Oct 25 00:32:02 2009
Update has finished at Sun Oct 25 00:32:05 2009

Following files has been updated:
/var/drweb/bases/drwtoday.vdb
/var/drweb/bases/dwntoday.vdb
/var/drweb/updates/drwtoday.txt
/var/drweb/updates/dwntoday.txt

What can i do? Thanks a lot.
Christian
 
Maniac,

1 - Disable them completely (can be done, but is not wise)
2 - Disable them partially (in specific log files, such as the mail log of plesk mail server, or the /var/log/messages file. Can be done, but again...not wise)

and my favourite:

3 - Just create a specific "catchall" mail address for drweb mails......Follow steps below:

a) create a new mail account on a domain of your choice (a domain that is owned by you, the administrator)
b) open command line utility and go to /var/qmail/alias
c) change contents of file .qmail-root and .qmail-drweb-daemon to only contain the line &<newmailName>@<domainofyourchoice>.tld

Every mail is then routed to that new mail account and it is not coming in into the administrator's mail account (as identified in plesk control panel).

Ok, it's done. But does this solve the problem? Is it possible to change de adress "[email protected]"
to an existing one?
Your favourite solution just will sent the mails to an other account. But they still exist.
 
Nomax2000,

My "favourite" solution simply is intended to channel drweb mails. It is not a solution to your problem, since that is the result of different reasons.

First the answer to your question "Is it possible to change de adress "[email protected]"
to an existing one?
": yes, naturally, but you should NOT change it.

After all, your problem has nothing to do with that.

It can be very likely that the following steps will be enough (commands in command line utility):
1 - service drwebd stop
2 - service qmail restart
3 - check the contents of files /var/qmail/control/locals and /var/qmail/control/me (in order to be sure)
4 - service drwebd start

Verify by sending yourself a email. If this does not work and gives errors in your maillog, please send me a private message with your maillog, your drweb32.ini file and your drweb_handler.conf file (latter two reside in /etc/drweb)
 
Pop3d Error - First solution for Postfix and Qmail

Qmail and Postfix are very likely to signal an error in their maillog. The error is:

"pop3d-ssl: Unexpected SSL Connection shutdown"

This error has nothing to do with the mail server and is the result of a buggy client that does not shutdown gracefully.

SYMPTOMS: your customer, using the mail client over pop3, is receiving messages double. The mail client reloads duplicate messages, since the connection was not closed properly the previous time.

SOLUTION: A restart of courier can be sufficient (command: service courier-imap restart) and is often enough. Naturally, your customer should change the buggy mail client or use IMAP.

NOTE: the error can often be discarded as a notification in the maillog.

NOTE: wanting to test the proper working of your pop3d-ssl connections? use command (in command line utility):

openssl s_client -connect localhost:995

and you get (or similar):

<snip: large output with valuable information>
+OK Hello there.
user <fill in: username>
+ OK Password required.
pass <fill in: password>
+OK logged in.
list
+OK <if unsuccesful, a violation of STD53 occurs>
1 562
2 341
3 1319
<etc>
.
quit
+OK Bye-bye.
 
Nov 28 03:49:25 km22824-09 pop3d: Connection, ip=[91.200.52.5]
Nov 28 03:49:25 km22824-09 pop3d: IMAP connect from @ [91.200.52.5]INFO: LOGIN, [email protected], ip=[91.200.52.5]
Nov 28 03:49:25 km22824-09 pop3d: 1259376565.977778 LOGOUT, [email protected], ip=[91.200.52.5], top=0, retr=0, time=0, rcvd=12, sent=39, maildir=/var/qmail/mailnames/smm.com.ua/boss/Maildir
Nov 28 03:57:21 km22824-09 /var/qmail/bin/relaylock[12196]: /var/qmail/bin/relaylock: mail from 80.232.168.211:60661 (smtp1.apollo.lv)
Nov 28 03:57:21 km22824-09 qmail-queue-handlers[12198]: Unable to change group ID: Operation not permitted
Nov 28 03:58:10 km22824-09 /var/qmail/bin/relaylock[12274]: /var/qmail/bin/relaylock: mail from 193.169.87.19:43463 (dear-soft.com)
Nov 28 03:58:10 km22824-09 /var/qmail/bin/relaylock[12275]: /var/qmail/bin/relaylock: mail from 193.169.87.19:43468 (dear-soft.com)
Nov 28 03:58:10 km22824-09 qmail-queue-handlers[12278]: Unable to change group ID: Operation not permitted
Nov 28 03:58:10 km22824-09 qmail-queue-handlers[12280]: Unable to change group ID: Operation not permitted
Nov 28 03:58:25 km22824-09 /var/qmail/bin/relaylock[13325]: /var/qmail/bin/relaylock: mail from 64.247.49.232:49390 (64.247.49.232.sonicgaming.net)
When i trying to send e-mail i have qq temporary problem # 4.3.0 (Thunderbird)
e-mail is not delivered to user mailbox too.
 
NickolayB,

You should check what the user & group settings (and permissions) for the file qmail-queue (in /var/qmail/bin). You should have something like this:

-r-x--s--x 1 mhandlers-user popuser 78664 Oct 9 13:26 qmail-queue

Furthermore, check the existence of the maildirs and the permissions thereof.

If problem persists, please give me more data (the data supplied is not sufficient)
 
Back
Top