Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Aug 2004 00:30:06 GMT
From:      Claudiu Bosioc <claudiu@casi.ro>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/69969: vpopmail default setup doesn't allow use of maildrop filters in virtual domains.
Message-ID:  <200408040030.i740U6Oo098234@www.freebsd.org>
Resent-Message-ID: <200408040030.i740URoD054756@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         69969
>Category:       ports
>Synopsis:       vpopmail default setup doesn't allow use of maildrop filters in virtual domains.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 04 00:30:27 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Claudiu Bosioc
>Release:        4.10-STABLE
>Organization:
>Environment:
FreeBSD jerry.li-net.ro 4.10-STABLE FreeBSD 4.10-STABLE #1: Fri Jul 23 15:18:00 EEST 2004     root@jerry.li-net.ro:/usr/src/sys/compile/JERRY  i386

>Description:
I have FreeBSD box running qmail-1.03, vpopmail-5.4.3, qmailadmin-1.0.20, sqwebmail-4.0.6, maildrop-1.6.3

I want users from virtual domains to be able to use maildrop filtering (configured by each of them from sqwebmail and enabled/disabled by me from qmailadmin.

short version of problem:
maildrop fails delivering a message for a virtual domain user when using mail filters (with to or cc rules) because it wants to run qmail-inject using $SHELL: execle(shell, q, "-c", cmd, (const char *)0, env);
$SHELL seen by maildrop in this case is the shell of the vpopmail user

long version:
the file: /usr/local/share/sqwebmail/maildirfilterconfig contains:
MAILDIRFILTER=../.mailfilter
MAILDIR=./Maildir
this allows one to edit mail filtering rules, located in (e.g.) /usr/local/vpopmail/domains/domain.com/postmaster/.mailfilter

but, vdelivermail from /usr/local/vpopmail/domains/domain.com/.qmail-default ignores the .mailfilter
this is why I activated SPAM_DETECTION in qmailadmin, with the SPAM_COMMAND="| preline /usr/local/bin/maildrop .mailfilter"

so far so good. I add a virtual account test@domain.com from qmailadmin, with spam detection enabled. I login from sqwebmail go to "Edit Mail Filters" and I click on save all changes. this creates the file .mailfilter

when I send a test message to the account I get the following error in qmail logs:
delivery xxx: failure: Unable_to_execute_/nonexistent/

>How-To-Repeat:

>Fix:
quick fix: pw user mod vpopmail -s /bin/sh

fix #1: empower vpopmail user /bin/sh instead of /nonexistent
root@jerry:/usr/ports/mail/vpopmail# diff pkg-install.orig pkg-install
64c64
<               $result = system ("/usr/sbin/pw useradd $user -g $users{$user} -d \"$ENV{PKG_PREFIX}\" -s /nonexistent $x");
---
>               $result = system ("/usr/sbin/pw useradd $user -g $users{$user} -d \"$ENV{PKG_PREFIX}\" -s /bin/sh $x");

fix #2: modify vdelivermail from vpopmail in order to set env variable SHELL to /bin/sh - in case the program (maildrop) needs to run another program (qmail-inject, in case of to or cc rules), using $SHELL env variable

I know fix #2 is not FreeBSD related; I will send this informations to vpopmail mailing-list also.
but, I guess this is what ports is all about: tweaking software in order to run on FreeBSD without problems.

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408040030.i740U6Oo098234>