基金方面的一些总结(zz from newsmth) PHP 5.2.0 Released
Nov 02
作者: 肖建彬 | 可以转载, 转载时务必以超链接形式标明文章原始出处和作者信息及版权声明
网址:http://www.xiaojb.com/archives/mailtech/maildrop-vpopmail-authlib.shtml

因为忘记了曾经给courier-authlib的这个patch,导致今天又忙活了半天。当初发现这个问题后写信给courier的作者Sam Varshavchik,Sam没有理睬。

diff -urN courier-authlib-0.58.org/preauthvchkpw.c courier-authlib-0.58/preauthvchkpw.c
— courier-authlib-0.58.org/preauthvchkpw.c 2005-02-20 12:41:20.000000000 +0800
+++ courier-authlib-0.58/preauthvchkpw.c 2006-11-02 11:02:45.000000000 +0800
@@ -56,6 +56,7 @@
static char User[256];
static char Domain[256];
static char options[80];
+static char maildir[256];

/* Make sure the auth struct is empty */
memset(&auth, 0, sizeof(auth));
@@ -140,6 +141,7 @@
*/
vset_lastauth(User, Domain, service);
#endif
+ snprintf(maildir,255,”%s/Maildir/”,vpw->pw_dir);

/* save the user’s passwd fields into the appropriate
* courier structure
@@ -148,6 +150,7 @@
auth.sysuserid = &uid;
auth.sysgroupid = gid;
auth.homedir = vpw->pw_dir;
+ auth.maildir = maildir;
auth.address = userid;
auth.fullname = vpw->pw_gecos;
auth.passwd = vpw->pw_passwd;

说明:
本patch适用于maildrop+vpopmail+authlib的情况。
maildrop在投递是是根据authlib返回的maildir来投递的,默认情况下的authlib不返回maildir,maildrop将信投递到/var/mail目录,所以会出现“Unable to open mailbox.”的错误。

Tags:

Leave a Reply