[PATCH] Add support for Apple Mail's Maildir format to builtin-mailsplit.

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

 



 Add support for Apple Mail's Maildir format to builtin-mailsplit.
 Currently, mailsplit only checks for the directory 'cur' inside of the
specified directory, whereas Apple Mail's Maildirs have a Messages directory.

Signed-off-by: Michael Cohen <mjc@xxxxxxxxxx>
---

Another patch will follow to allow builtin-mailinfo to parse Apple Mail's extra header and footers.

 builtin-mailsplit.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/builtin-mailsplit.c b/builtin-mailsplit.c
index 74b0470..6256351 100644
--- a/builtin-mailsplit.c
+++ b/builtin-mailsplit.c
@@ -129,8 +129,11 @@ static int split_maildir(const char *maildir, const char *dir,
 	struct path_list list = {NULL, 0, 0, 1};

 	snprintf(curdir, sizeof(curdir), "%s/cur", maildir);
-	if (populate_maildir_list(&list, curdir) < 0)
-		goto out;
+	if (populate_maildir_list(&list, curdir) < 0) {
+		snprintf(curdir, sizeof(curdir), "%s/Messages", maildir);
+		if (populate_maildir_list(&list, curdir) < 0)
+			goto out;
+	}

 	for (i = 0; i < list.nr; i++) {
 		FILE *f;
--
1.5.3.5.562.g45f4-dirty

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux