基金方面的一些总结(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没有理睬。

  1. diff -urN courier-authlib-0.58.org/preauthvchkpw.c courier-authlib-0.58/preauthvchkpw.c
  2. --- courier-authlib-0.58.org/preauthvchkpw.c    2005-02-20 12:41:20.000000000 +0800
  3. +++ courier-authlib-0.58/preauthvchkpw.c        2006-11-02 11:02:45.000000000 +0800
  4. @@ -56,6 +56,7 @@
  5. static char User[256];
  6. static char Domain[256];
  7. static char options[80];
  8. +static char maildir[256];
  9.  
  10.         /* Make sure the auth struct is empty */
  11.          memset(&auth, 0, sizeof(auth));
  12. @@ -140,6 +141,7 @@
  13.           */
  14.          vset_lastauth(User, Domain, service);
  15. #endif
  16. +       snprintf(maildir,255,"%s/Maildir/",vpw->pw_dir);
  17.  
  18.         /* save the user's passwd fields into the appropriate
  19.          * courier structure
  20. @@ -148,6 +150,7 @@
  21.         auth.sysuserid          = &uid;
  22.         auth.sysgroupid         = gid;
  23.         auth.homedir            = vpw->pw_dir;
  24. +       auth.maildir            = maildir;
  25.         auth.address            = userid;
  26.         auth.fullname           = vpw->pw_gecos;
  27.         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