Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Having trouble to use preline command with Qmail's mail filtering.

When i use next syntax in .qmail-default file:

| /var/qmail/bin/preline /usr/bin/maildrop /etc/mail/mailfilter

... I get following error:

preline: usage: preline cmd [ arg ... ]

Just to mention that upper line is content of the file


Can you tell me what I'm doing wrong with this, and how to use preline command in this case?

Thank you in advance!

share|improve this question
Your .qmail* file should have a pipe character at the beginning of the line, which you didn't show here, but it looks like preline is being run, so that's probably not the actual problem. Still it would be nice to see the real unaltered .qmail-default. If the problem isn't there, we'll need to know some of the surrounding context. Is /home/vpopmail/domains/ the home directory of some user? Presumably with a virtualdomains mapping? – Wumpus Q. Wumbley Dec 22 '13 at 2:58
sorry, i forgot to add pipe in my primary post, and .qmail-default looks like in my primary post – user48058 Dec 22 '13 at 9:30
directory /home/vpopmail/domains/ is not home dir of some user – user48058 Dec 22 '13 at 9:34
A good way to debug such problems is to attach an strace -ff -s200 -o /tmp/qmail.log to the qmail-lspawn process, then attempt a delivery. The strace log should show you how preline is actually called or how it fails (maybe the error message is misleading). – András Korn Sep 2 '14 at 21:35
@Danijel, just press CTRL-C to stop strace (and thus deattach it from the process it is tracing). You can give strace the PID of the qmail-lspawn process to attach to using the -p switch; see man strace. – András Korn Mar 24 '15 at 16:38

This happend to me after uprgading/recompiling qmail The fix is, recompile vpopmail ;)

share|improve this answer
Please accept the answer. – Danijel Mar 23 '15 at 14:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.