On Feb 4, 2004, at 1:49 AM, Luca Morettoni wrote:
Tom Collins, il 03/02/2004 alle 07:48, mi scrisse...
I'm pretty sure that vdelivermail is assuming the second line is an
address and not a Maildir since it doesn't contains the string
"/Maildir/".  I'll look into updating vpopmail to do Maildir delivery
if the line starts with "." or "/".

this is a little patch for my 5.3.30 installation, it chech if is a valid maildir name (start with a slash or a dot and end with a slash too), I hope it could be applied to the 5.4.x revision (I try later)

Enjoy this patch:

--- vdelivermail.c.orig Mon Oct 20 20:59:57 2003
+++ vdelivermail.c      Wed Feb  4 09:44:43 2004
@@ -470,10 +470,11 @@
         return(0);
     }

- /* Contains /Maildir/ ? Then it must be a full or relative
- * path to a Maildir
+ /* Contains a Maildir delivery? Then it must be a full or relative
+ * path to a Maildir (must start with a dot or a slash and end with a slash)
+ * Patched by Luca Morettoni
*/
- else if ( strstr(address, "/Maildir/") != NULL ) {
+ else if ((*address == '.' || *address == '/') && *(address+strlen(address)-1) == '/') {


         /* if the user has a quota set */
         if ( strncmp(quota, "NOQUOTA", 2) != 0 ) {

Here's my version of the patch, currently in CVS. The only thing I'm considering changing is the vexit(111) to return(0) to have it skip the mbox delivery instead of deferring the message. (In a .qmail file, if the path doesn't end with "/", it's considered to be a mbox delivery which is something vdelivermail doesn't support.)


diff -u -r1.10 vdelivermail.c
--- vdelivermail.c      11 Jan 2004 03:53:40 -0000      1.10
+++ vdelivermail.c      12 Feb 2004 17:31:54 -0000
@@ -467,10 +467,13 @@
         return(0);
       }

-    /* Contains /Maildir/ ? Then it must be a full or relative
-     * path to a Maildir
-     */
-    else if ( strstr(address, "/Maildir/") != NULL ) {
+    /* Starts with '.' or '/', then it's an mbox or maildir delivery */
+    else if ((*address == '.') || (*address == '/')) {
+        /* check for mbox delivery and exit accordingly */
+        if (address[strlen(address)-1] != '/') {
+            printf ("can't handle mbox delivery for %s", address);
+            vexit(111);
+        }

         /* if the user has a quota set */
         if ( strncmp(quota, "NOQUOTA", 2) != 0 ) {

--
Tom Collins  -  [EMAIL PROTECTED]
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter handheld Network Tester: http://sniffter.com/



Reply via email to