bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-mailutils] movemail and maildir destination


From: Sergey Poznyakoff
Subject: Re: [bug-mailutils] movemail and maildir destination
Date: Tue, 19 Dec 2006 16:22:17 +0200

Georg Sauthoff <address@hidden> wrote:

> how do I move mail via 'movemail' from an existing mbox file to a
> non-existing maildir destination?

Use this patch:

Index: mailbox/amd.c
===================================================================
RCS file: /cvsroot/mailutils/mailutils/mailbox/amd.c,v
retrieving revision 1.21
diff -p -u -r1.21 amd.c
--- mailbox/amd.c       27 Jun 2006 13:10:37 -0000      1.21
+++ mailbox/amd.c       19 Dec 2006 14:21:42 -0000
@@ -332,8 +332,18 @@ amd_open (mu_mailbox_t mailbox, int flag
 
   mailbox->flags = flags;
   if (stat (amd->name, &st) < 0)
-    return errno;
-
+    {
+      if ((flags & MU_STREAM_CREAT) && errno == ENOENT)
+       {
+         if (mkdir (amd->name, S_IRUSR|S_IWUSR|S_IXUSR))
+           return errno;
+         if (stat (amd->name, &st) < 0)
+           return errno;
+       }
+      else
+       return errno;
+    }
+  
   if (!S_ISDIR (st.st_mode))
     return EINVAL;
 

Reagards,
Sergey
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]