when using maildrop in delivery (-d) mode, it fails with a signal 11 if it
can't read the maildropmysql.cf file.
In a setup with both virtual and local users, only the virtual mailbox user(s)
should be able to read the configfile, the local users should not be able to
read it, as it contains mysql username/password information.
Reproducible: Always
Steps to Reproduce:
1. USE=mysql emerge maildrop
2. chgrp virtual_group /etc/maildrop/maildropmysql.cf
3. chmod 640 /etc/maildrop/maildropmysql.cf
4. (as a local user) maildrop -d $USER
Actual Results:
maildrop: signal 0x0B
Expected Results:
it should wait for input on stdin, and deliver the message on EOF.
this patch seems to fix it:
diff -ru maildrop-1.7.0.20040907/maildrop/main.C
maildrop-1.7.0.20040907-ivo/maildrop/main.C
--- maildrop-1.7.0.20040907/maildrop/main.C 2004-06-26 17:20:14.000000000
+0200
+++ maildrop-1.7.0.20040907-ivo/maildrop/main.C 2004-12-27 23:12:57.187589776
+0100
@@ -326,7 +326,9 @@
// Read the config
mysqlcfg = (mdmysqlconfig*)get_mysql_config(MAILDROPMYSQLCONFIG);
- if ( mysqlcfg )
+ if ( !mysqlcfg )
+ return 0;
+ else
if ( !(mysqlcfg->hostname && mysqlcfg->database && mysqlcfg->dbtable)
)
return 0;
Thanks Ivo, your patch gets applied in -r1 ebuild, which should hit portage
mirrors in few hours, along with the patch itself.
I've also reported this upstream on courier-maildrop mailinglist, since I
couldn't find any bug tracker. Let's see how will upstream developers react.