Speaking of vpopmail...
Unless it's me having "finger trouble", vpopmail+mysql+virtualmin+mail aliases = broken. Many standard virtualmail installs use mysql - and this means this issue is a bug not a feature request.
For the sake of sanity - I had erased my vpopmail mysql tables - all of them deleted the domain and started over. All the configuration that lead to this breakage is courtesy of virtualmin ;)
FYI The configuration options for how gentoo compiles vpopmail is in an ebuild file on packages.gentoo.org. If that's too much trouble, here's what the configuration arguments are during compiling.
" ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64 --disable-dependency-tracking --enable-incdir=/usr/include/mysql --enable-auth-module=mysql --enable-libdir=/usr/lib64/mysql --enable-sql-logging --enable-valias --disable-mysql-replication --enable-mysql-limits --sysconfdir=/var/vpopmail/etc --enable-non-root-build --enable-qmaildir=/var/qmail --enable-qmail-newu=/var/qmail/bin/qmail-newu --enable-qmail-inject=/var/qmail/bin/qmail-inject --enable-qmail-newmrh=/var/qmail/bin/qmail-newmrh --enable-vpopuser=vpopmail --enable-vpopgroup=vpopmail --enable-many-domains --enable-file-locking --enable-file-sync --enable-md5-passwords --enable-logging --enable-auth-logging --enable-log-name=vpopmail --enable-qmail-ext --disable-tcpserver-file --disable-roaming-users --enable-ip-alias-domains --enable-clear-passwd --disable-maildrop --disable-maildrop-prog --enable-spamassassin"
At least on my system, Spamassassin and maildrop can cause problems, but I disable those features in the SQL. That is the same as a .qmail-limits file qmailadmin would make in the root of the domain. Supporting the limits file would also be a nice feature request for webmin, well more to the point defining the limits through vmoduser is the way to implement it, as it would apply the settings to ldap /mysql instances of vpopmail too.
NB: Real domain names changed to lame ones in the examples below.
crm domains # valias -s hifive.biz firstname.lastname@example.org -> email@example.com firstname.lastname@example.org -> email@example.com firstname.lastname@example.org -> | /var/vpopmail/bin/vdelivermail '' email@example.com snip this is the issue ^^^ firstname.lastname@example.org -> email@example.com
Notice the domain administrator account (firstname.lastname@example.org) was not created by virtualmin! Yet appears in virtual min panel. Another issue....
Lets test delivery of mail aliases created with a virtualmin user panel's "Additional Email Addresses"
crm domains # jobs + Running tail -f /var/log/qmail/qmail-send/current &
crm domains # @40000000501c681d1262ac34 new msg 6103593 @40000000501c681d1262b7ec info msg 6103593: bytes 1671 from email@example.com qp 10834 uid 201 @40000000501c681d12634874 starting delivery 20: msg 6103593 to local firstname.lastname@example.org @40000000501c681d12635044 status: local 1/25 remote 0/50 @40000000501c681f379e6934 delivery 20: deferral: vdelivermail:_deferred,_database_down/ @40000000501c681f379e7104 status: local 0/25 remote 0/50 @40000000501c688301e1ba44 starting delivery 21: msg 6103593 to local email@example.com @40000000501c688301e1c5fc status: local 1/25 remote 0/50 @40000000501c68852329c32c delivery 21: deferral: vdelivermail:_deferred,_database_down/ @40000000501c68852329cee4 status: local 0/25 remote 0/50
Not happy with the virtualmin created alias! Pipes are not deliverable I believe in mysql valias - standard on gentoo with mysql backed virtualmin. There are NO .qmail-support file in /var/vpopmail/domains/hifive.biz/ - this is because aliases have moved to SQL and are not handed with all the same semantics of dot-qmail files.
Now here is with a more conventional alias (the firstname.lastname@example.org - also created by virtualmin without a "|" pipe in the alias line)
@40000000501c6aa60d47ae5c info msg 6107723: bytes 2164 from email@example.com qp 13864 uid 201 @40000000501c6aa60d4842cc starting delivery 26: msg 6107723 to local firstname.lastname@example.org @40000000501c6aa60d4846b4 status: local 1/25 remote 0/50 @40000000501c6aa60ed19a1c delivery 26: success: vdelivermail:_valiases_processed/did_0+0+1/ @40000000501c6aa60ed3cc9c status: local 0/25 remote 0/50 @40000000501c6aa60ed3d46c new msg 6115473 @40000000501c6aa60ed3d854 info msg 6115473: bytes 2263 from SRS0=/4YGe0=GEemail@example.com qp 13870 uid 89 @40000000501c6aa60ed445b4 starting delivery 27: msg 6115473 to local firstname.lastname@example.org @40000000501c6aa60ed4499c status: local 1/25 remote 0/50 @40000000501c6aa60ed58dd4 end msg 6107723 @40000000501c6aa61039ffd4 delivery 27: success: did_0+0+1/ @40000000501c6aa6103ce9ec status: local 0/25 remote 0/50 @40000000501c6aa6103e41ac end msg 6115473 q@40000000501c6b1716346514 starting delivery 28: msg 6103597 to local email@example.com @40000000501c6b17163470cc status: local 1/25 remote 0/50 @40000000501c6b17178ca9e4 delivery 28: success: did_0+0+1/ @40000000501c6b17178f49c4 status: local 0/25 remote 0/50 @40000000501c6b171790dc1c end msg 6103597
The message got delivered. The SRS stuff is forced on for local MDA's not using the host's send as addresss, just ignore it. It means that the valias (mysql) handling module in vpopmail is using /var/qmail/bin/qmail-inject to do it's mailforwarding for all aliases.
I need to look over the vpopmail code to work out the scope of this bug, and see what kind of alias entries (forward, pipe, local mailbox etc) it can handle. .... DONE... looks like firstname.lastname@example.org only with support for qmail extensions (optional) eg email@example.com being correctly handled by aliases.
valias -i just inserts whatever data you throw at it.
It's structure is as follows.
alias char(32) NO MUL
domain char(96) NO
valias_line text NO
I would look at process_valias(void) in vdelivermail - i think this bug could affect more than just SQL backended vpopmail installs. vdelivermail.c on my system (gentoo patched up version) attached.
My version is slightly different - it calls maildrop -d firstname.lastname@example.org to do the deliveries, and always runs under vpopmail. maildrop is suid, and vpopmail is hacked to always use uid/gid 89. deliverable is just the alias looker-upper, but can still support domain based filesystem quotas. vpopmail domain quotas are broken.
If I get the my implementation of vpopmail+mysql+maildrop+[no]mailscript+spamc that supports user level anti-virus scanning (virtualmin's way) it would be a nice addition to virtualmin. Would you give then give your corporate users a choice to run qmail or postfix, and distribute packages for the both. I guess and ebuild could be converted to src.deb / src.rpms and hosted on your repository for subscribed customers.
THINK PLESK - and their patched up version of qmail has all the same features my patched up version of qmail supports. This would be a step forwards to making a more plesk migration friendly product.
don't use "|/var/vpopmail/bin/vdelivermail '' email@example.com" to forward mail anymore. Let qmail do the conventional way even if has to spawn some more processes.