[47697] trunk/dports/mail/mutt-devel

simon at macports.org simon at macports.org
Tue Mar 3 15:37:57 PST 2009


Revision: 47697
          http://trac.macports.org/changeset/47697
Author:   simon at macports.org
Date:     2009-03-03 15:37:57 -0800 (Tue, 03 Mar 2009)
Log Message:
-----------
mail/mutt-devel: Update to 1.5.19, closes #18439.

Some variants were disabled as they no longer apply.

Also removed old unused patch files.

Modified Paths:
--------------
    trunk/dports/mail/mutt-devel/Portfile

Removed Paths:
-------------
    trunk/dports/mail/mutt-devel/files/patch-0.20051006.1.dgc.xlabel_ext.7
    trunk/dports/mail/mutt-devel/files/patch-1.5.10.cd.trash_folder.3.4
    trunk/dports/mail/mutt-devel/files/patch-cvs20051112.bc.smtp

Modified: trunk/dports/mail/mutt-devel/Portfile
===================================================================
--- trunk/dports/mail/mutt-devel/Portfile	2009-03-03 23:37:43 UTC (rev 47696)
+++ trunk/dports/mail/mutt-devel/Portfile	2009-03-03 23:37:57 UTC (rev 47697)
@@ -3,7 +3,7 @@
 PortSystem          1.0
 
 name                mutt-devel
-version             1.5.18
+version             1.5.19
 categories          mail
 platforms           darwin
 maintainers         simon openmaintainer
@@ -21,9 +21,9 @@
 master_sites        ftp://ftp.mutt.org/mutt/devel/
 distname            mutt-${version}
 checksums           ${distfiles} \
-                        md5 27c30037120189b9f9c0d3e76361b8f8 \
-                        sha1 a835a1933297494f2c6c68b9a334cc1d71a95e5a \
-                        rmd160 1c8595f66eb9aa94c01a6020be20a75c0c8d2d14
+                        md5 73b3747bc7f7c805921e8d24ebac693f \
+                        sha1 96e4cc1e1419ba816fcc19d77255978e62c20793 \
+                        rmd160 dcb8d027593bfccd62eb7aba338007bce3c7e22e
 
 depends_lib         port:gettext \
                     port:libiconv \
@@ -75,9 +75,9 @@
 variant compress description {Compressed folders} {
     configure.args-append   --enable-compressed
     patch_sites-append      http://www.spinnaker.de/mutt/compressed/
-    patchfiles-append       patch-1.5.18.rr.compressed.1.gz
-    checksums-append        patch-1.5.18.rr.compressed.1.gz md5 \
-                                93cf145ea84b05e3a8b217c2841e5c69
+    patchfiles-append       patch-1.5.19.rr.compressed.1.gz
+    checksums-append        patch-1.5.19.rr.compressed.1.gz md5 \
+                                7e4e8a547763d217351846f31599019e
 }
 
 variant headercache conflicts db4 description {Enable header caching (requires gdbm or qdbm)} {
@@ -105,10 +105,10 @@
 # The patches for nntp and sidebar conflict, see ticket #15135
 variant nntp conflicts sidebar description {NNTP support} {
     configure.args-append   --enable-nntp
-    patch_sites-append      http://www.mutt.org.ua/download/mutt-1.5.18/
-    patchfiles-append       patch-1.5.18.vvv.nntp.gz
-    checksums-append        patch-1.5.18.vvv.nntp.gz md5 \
-                                b642b723363dc2e172d34f63e077831b
+    patch_sites-append      http://www.mutt.org.ua/download/mutt-1.5.19/
+    patchfiles-append       patch-1.5.19.vvv.nntp.gz
+    checksums-append        patch-1.5.19.vvv.nntp.gz md5 \
+                                1e2ad0cb9b918f8382537752df0c9958
 }
 
 variant deepif description {Allow nested if-else sequences in strings} {
@@ -136,12 +136,13 @@
                                 83479a011390802b3f9f1c0f95b15199
 }
 
-variant xlabel description {Custom message-tagging - X-Label:} {
-    patch_sites-append      http://home.uchicago.edu/~dgc/sw/mutt/
-    patchfiles-append       patch-1.5.14.dgc.xlabel_ext.9
-    checksums-append        patch-1.5.14.dgc.xlabel_ext.9 md5 \
-                                c5badc733020187b6677f31b343195e8
-}
+# FIXME: doesn't apply
+#variant xlabel description {Custom message-tagging - X-Label:} {
+#    patch_sites-append      http://home.uchicago.edu/~dgc/sw/mutt/
+#    patchfiles-append       patch-1.5.14.dgc.xlabel_ext.9
+#    checksums-append        patch-1.5.14.dgc.xlabel_ext.9 md5 \
+#                                c5badc733020187b6677f31b343195e8
+#}
 
 # patch_site appears to be dead, can re-enable the variant if a working one is found
 #variant checkseen {
@@ -155,17 +156,20 @@
     configure.args-append   --enable-smtp
 }
 
-variant trash description {Add a Trash folder} {
-    patchfiles-append       patch-trash-1.5.16.diff \
-                            patch-1.5.17.cd.purge_message.bk.1.diff
-}
+# FIXME: doesn't apply
+#variant trash description {Add a Trash folder} {
+#    patchfiles-append       patch-trash-1.5.16.diff \
+#                            patch-1.5.17.cd.purge_message.bk.1.diff
+#}
 
-variant sidebar conflicts nntp description {Add a sidebar with a list of folders} {
-    patch_sites-append      http://lunar-linux.org/~tchan/mutt/
-    patchfiles-append       patch-1.5.18.sidebar.20080611.txt
-    checksums-append        patch-1.5.18.sidebar.20080611.txt md5 \
-                                0f6565cecfc7fd72eaf33756abbc3088
-}
+# FIXME: doesn't apply
+#variant sidebar conflicts nntp description {Add a sidebar with a list of folders} {
+#    # http://www.lunar-linux.org/index.php/en/component/content/article/44-mutt-sidebar.html
+#    patch_sites-append      http://lunar-linux.org/~tchan/mutt/
+#    patchfiles-append       patch-1.5.18.sidebar.20080611.txt
+#    checksums-append        patch-1.5.18.sidebar.20080611.txt md5 \
+#                                0f6565cecfc7fd72eaf33756abbc3088
+#}
 
 variant gpgme description {Enable GPGME crypto support} {
     configure.args-append   --enable-gpgme --with-gpgme-prefix=${prefix}

Deleted: trunk/dports/mail/mutt-devel/files/patch-0.20051006.1.dgc.xlabel_ext.7
===================================================================
--- trunk/dports/mail/mutt-devel/files/patch-0.20051006.1.dgc.xlabel_ext.7	2009-03-03 23:37:43 UTC (rev 47696)
+++ trunk/dports/mail/mutt-devel/files/patch-0.20051006.1.dgc.xlabel_ext.7	2009-03-03 23:37:57 UTC (rev 47697)
@@ -1,339 +0,0 @@
-Index: OPS
-===================================================================
-RCS file: /home/roessler/cvs/mutt/OPS,v
-retrieving revision 3.7
-diff -u -r3.7 OPS
---- foo/OPS	24 Jul 2005 16:51:38 -0000	3.7
-+++ bar/OPS	6 Oct 2005 17:06:50 -0000
-@@ -56,6 +56,7 @@
- OP_DISPLAY_ADDRESS "display full address of sender"
- OP_DISPLAY_HEADERS "display message and toggle header weeding"
- OP_DISPLAY_MESSAGE "display a message"
-+OP_EDIT_LABEL "add, change, or delete a message's label"
- OP_EDIT_MESSAGE "edit the raw message"
- OP_EDITOR_BACKSPACE "delete the char in front of the cursor"
- OP_EDITOR_BACKWARD_CHAR "move the cursor one character to the left"
-Index: PATCHES
-===================================================================
-RCS file: /home/roessler/cvs/mutt/PATCHES,v
-retrieving revision 3.6
-diff -u -r3.6 PATCHES
---- foo/PATCHES	9 Dec 2002 17:44:54 -0000	3.6
-+++ bar/PATCHES	6 Oct 2005 17:06:50 -0000
-@@ -0,0 +1 @@
-+patch-1.5.11.dgc.xlabel_ext.7
-Index: copy.c
-===================================================================
-RCS file: /home/roessler/cvs/mutt/copy.c,v
-retrieving revision 3.26
-diff -u -r3.26 copy.c
---- foo/copy.c	29 Sep 2005 23:02:49 -0000	3.26
-+++ bar/copy.c	6 Oct 2005 17:06:50 -0000
-@@ -108,6 +108,10 @@
- 	ignore = 0;
-       }
- 
-+      if (flags & CH_UPDATE_LABEL &&
-+	  mutt_strncasecmp ("X-Label:", buf, 8) == 0)
-+	continue;
-+
-       if (!ignore && fputs (buf, out) == EOF)
- 	return (-1);
-     }
-@@ -475,6 +479,15 @@
-       fprintf (out, "Lines: %d\n", h->lines);
-   }
- 
-+  if (flags & CH_UPDATE_LABEL && h->xlabel_changed)
-+  {
-+    h->xlabel_changed = 0;
-+    if (h->env->x_label != NULL)
-+      if (fprintf(out, "X-Label: %s\n", h->env->x_label) !=
-+		  10 + strlen(h->env->x_label))
-+        return -1;
-+  }
-+
-   if ((flags & CH_NONEWLINE) == 0)
-   {
-     if (flags & CH_PREFIX)
-@@ -556,6 +569,9 @@
-       _mutt_make_string (prefix, sizeof (prefix), NONULL (Prefix), Context, hdr, 0);
-   }
- 
-+  if (hdr->xlabel_changed)
-+    chflags |= CH_UPDATE_LABEL;
-+
-   if ((flags & M_CM_NOHEADER) == 0)
-   {
-     if (flags & M_CM_PREFIX)
-Index: curs_main.c
-===================================================================
-RCS file: /home/roessler/cvs/mutt/curs_main.c,v
-retrieving revision 3.34
-diff -u -r3.34 curs_main.c
---- foo/curs_main.c	4 Oct 2005 04:29:09 -0000	3.34
-+++ bar/curs_main.c	6 Oct 2005 17:06:50 -0000
-@@ -1945,6 +1945,21 @@
- 	menu->redraw = REDRAW_FULL;
- 	break;
- 
-+      case OP_EDIT_LABEL:
-+
-+	CHECK_MSGCOUNT;
-+	CHECK_READONLY;
-+	rc = mutt_label_message(tag ? NULL : CURHDR);
-+	if (rc > 0) {
-+	  Context->changed = 1;
-+	  menu->redraw = REDRAW_FULL;
-+	  mutt_message ("%d label%s changed.", rc, rc == 1 ? "" : "s");
-+	}
-+	else {
-+	  mutt_message _("No labels changed.");
-+	}
-+	break;
-+
-       case OP_LIST_REPLY:
- 
- 	CHECK_ATTACH;
-Index: functions.h
-===================================================================
-RCS file: /home/roessler/cvs/mutt/functions.h,v
-retrieving revision 3.12
-diff -u -r3.12 functions.h
---- foo/functions.h	17 Sep 2005 20:46:10 -0000	3.12
-+++ bar/functions.h	6 Oct 2005 17:06:51 -0000
-@@ -82,6 +82,7 @@
-   { "delete-thread",		OP_DELETE_THREAD,		"\004" },
-   { "delete-subthread",		OP_DELETE_SUBTHREAD,		"\033d" },
-   { "edit",			OP_EDIT_MESSAGE,		"e" },
-+  { "edit-label",		OP_EDIT_LABEL,			"y" },
-   { "edit-type",		OP_EDIT_TYPE,			"\005" },
-   { "forward-message",		OP_FORWARD_MESSAGE,		"f" },
-   { "flag-message",		OP_FLAG_MESSAGE,		"F" },
-@@ -166,6 +167,7 @@
-   { "delete-thread",	OP_DELETE_THREAD,		"\004" },
-   { "delete-subthread",	OP_DELETE_SUBTHREAD,		"\033d" },
-   { "edit",		OP_EDIT_MESSAGE,		"e" },
-+  { "edit-label",	OP_EDIT_LABEL,			"y" },
-   { "edit-type",	OP_EDIT_TYPE,			"\005" },
-   { "forward-message",	OP_FORWARD_MESSAGE,		"f" },
-   { "flag-message",	OP_FLAG_MESSAGE,		"F" },
-Index: headers.c
-===================================================================
-RCS file: /home/roessler/cvs/mutt/headers.c,v
-retrieving revision 3.8
-diff -u -r3.8 headers.c
---- foo/headers.c	17 Sep 2005 20:46:10 -0000	3.8
-+++ bar/headers.c	6 Oct 2005 17:06:51 -0000
-@@ -205,3 +205,59 @@
-     }
-   }
- }
-+
-+/*
-+ * dgc: Add an X-Label: field.
-+ */
-+static int label_message(HEADER *hdr, char *new)
-+{
-+	if (hdr == NULL)
-+		return 0;
-+	if (hdr->env->x_label == NULL && new == NULL)
-+		return 0;
-+	if (hdr->env->x_label != NULL && new != NULL &&
-+			strcmp(hdr->env->x_label, new) == 0)
-+		return 0;
-+	if (hdr->env->x_label != NULL)
-+		FREE(&hdr->env->x_label);
-+	if (new == NULL)
-+		hdr->env->x_label = NULL;
-+	else
-+		hdr->env->x_label = safe_strdup(new);
-+	return hdr->changed = hdr->xlabel_changed = 1;
-+}
-+
-+int mutt_label_message(HEADER *hdr)
-+{
-+	char buf[LONG_STRING], *new;
-+	int i;
-+	int changed;
-+
-+	*buf = '\0';
-+	if (hdr != NULL && hdr->env->x_label != NULL) {
-+		strncpy(buf, hdr->env->x_label, LONG_STRING);
-+	}
-+
-+	mutt_get_field("Label: ", buf, sizeof(buf), M_CLEAR);
-+	new = buf;
-+	SKIPWS(new);
-+	if (*new == '\0')
-+		new = NULL;
-+
-+	changed = 0;
-+	if (hdr != NULL) {
-+		changed += label_message(hdr, new);
-+	} else {
-+#define HDR_OF(index)	Context->hdrs[Context->v2r[(index)]]
-+		for (i = 0; i < Context->vcount; ++i) {
-+			if (HDR_OF(i)->tagged)
-+				if (label_message(HDR_OF(i), new)) {
-+					++changed;
-+					mutt_set_flag(Context, HDR_OF(i),
-+						M_TAG, 0);
-+				}
-+		}
-+	}
-+
-+	return changed;
-+}
-Index: mh.c
-===================================================================
-RCS file: /home/roessler/cvs/mutt/mh.c,v
-retrieving revision 3.29
-diff -u -r3.29 mh.c
---- foo/mh.c	17 Sep 2005 20:46:10 -0000	3.29
-+++ bar/mh.c	6 Oct 2005 17:06:51 -0000
-@@ -1382,7 +1382,7 @@
- {
-   HEADER *h = ctx->hdrs[msgno];
- 
--  if (h->attach_del || 
-+  if (h->attach_del || h->xlabel_changed ||
-       (h->env && (h->env->refs_changed || h->env->irt_changed)))
-     if (mh_rewrite_message (ctx, msgno) != 0)
-       return -1;
-@@ -1394,7 +1394,7 @@
- {
-   HEADER *h = ctx->hdrs[msgno];
- 
--  if (h->attach_del || 
-+  if (h->attach_del || h->xlabel_changed ||
-       (h->env && (h->env->refs_changed || h->env->irt_changed)))
-   {
-     /* when doing attachment deletion/rethreading, fall back to the MH case. */
-@@ -1503,6 +1503,7 @@
-       }
-     }
-     else if (ctx->hdrs[i]->changed || ctx->hdrs[i]->attach_del ||
-+	     ctx->hdrs[i]->xlabel_changed ||
- 	     (ctx->magic == M_MAILDIR
- 	      && (option (OPTMAILDIRTRASH) || ctx->hdrs[i]->trash)
- 	      && (ctx->hdrs[i]->deleted != ctx->hdrs[i]->trash)))
-Index: pager.c
-===================================================================
-RCS file: /home/roessler/cvs/mutt/pager.c,v
-retrieving revision 3.29
-diff -u -r3.29 pager.c
---- foo/pager.c	4 Oct 2005 05:24:00 -0000	3.29
-+++ bar/pager.c	6 Oct 2005 17:06:51 -0000
-@@ -2658,6 +2658,18 @@
- 	redraw = REDRAW_FULL;
- 	break;
- 
-+     case OP_EDIT_LABEL:
-+        CHECK_MODE(IsHeader (extra));
-+        rc = mutt_label_message(extra->hdr);
-+        if (rc > 0) {
-+          Context->changed = 1;
-+          redraw = REDRAW_FULL;
-+          mutt_message ("%d label%s changed.", rc, rc == 1 ? "" : "s");
-+        }
-+        else {
-+          mutt_message _("No labels changed.");
-+        }
-+        break;
- 
-       case OP_MAIL_KEY:
-         if (!(WithCrypto & APPLICATION_PGP))
-Index: protos.h
-===================================================================
-RCS file: /home/roessler/cvs/mutt/protos.h,v
-retrieving revision 3.39
-diff -u -r3.39 protos.h
---- foo/protos.h	4 Oct 2005 06:05:39 -0000	3.39
-+++ bar/protos.h	6 Oct 2005 17:06:51 -0000
-@@ -181,6 +181,7 @@
- void mutt_edit_content_type (HEADER *, BODY *, FILE *);
- void mutt_edit_file (const char *, const char *);
- void mutt_edit_headers (const char *, const char *, HEADER *, char *, size_t);
-+int mutt_label_message (HEADER *);
- void mutt_curses_error (const char *, ...);
- void mutt_curses_message (const char *, ...);
- void mutt_enter_command (void);
-Index: doc/manual.xml.head
-===================================================================
-RCS file: /home/roessler/cvs/mutt/doc/manual.xml.head,v
-retrieving revision 3.13
-diff -u -r3.13 manual.xml.head
---- foo/doc/manual.xml.head	5 Oct 2005 19:24:40 -0000	3.13
-+++ bar/doc/manual.xml.head	6 Oct 2005 17:06:51 -0000
-@@ -4019,6 +4019,12 @@
- </para>
- 
- <para>
-+You can change or delete the ``X-Label:'' field within Mutt using the
-+``edit-label'' command, bound to the ``y'' key by default.  This works
-+for tagged messages, too.
-+</para>
-+
-+<para>
- Lastly, Mutt has the ability to <link linkend="sort">sort</link> the mailbox into
- <link linkend="threads">threads</link>.  A thread is a group of messages which all relate to the same
- subject.  This is usually organized into a tree-like structure where a
-Index: imap/imap.c
-===================================================================
-RCS file: /home/roessler/cvs/mutt/imap/imap.c,v
-retrieving revision 3.44
-diff -u -r3.44 imap.c
---- foo/imap/imap.c	22 Sep 2005 03:09:49 -0000	3.44
-+++ bar/imap/imap.c	6 Oct 2005 17:06:51 -0000
-@@ -1058,7 +1058,7 @@
-   /* save status changes */
-   for (n = 0; n < ctx->msgcount; n++)
-   {
--    if (ctx->hdrs[n]->active && ctx->hdrs[n]->changed)
-+    if (ctx->hdrs[n]->active && (ctx->hdrs[n]->changed || ctx->hdrs[n]->xlabel_changed))
-     {
-       mutt_message (_("Saving message status flags... [%d/%d]"), n+1,
-         ctx->msgcount);
-@@ -1066,8 +1066,9 @@
-       /* if the message has been rethreaded or attachments have been deleted
-        * we delete the message and reupload it.
-        * This works better if we're expunging, of course. */
-+      /* AFAICT (dgc) we need to do this for header changes, too. */
-       if ((ctx->hdrs[n]->env && (ctx->hdrs[n]->env->refs_changed || ctx->hdrs[n]->env->irt_changed)) ||
--	  ctx->hdrs[n]->attach_del)
-+	  ctx->hdrs[n]->attach_del || ctx->hdrs[n]->xlabel_changed)
-       {
- 	dprint (3, (debugfile, "imap_sync_mailbox: Attachments to be deleted, falling back to _mutt_save_message\n"));
- 	if (!appendctx)
-@@ -1078,6 +1079,7 @@
- 	}
- 	else
- 	  _mutt_save_message (ctx->hdrs[n], appendctx, 1, 0, 0);
-+        ctx->hdrs[n]->xlabel_changed = 0;
-       }
- 
-       if (imap_sync_message (idata, ctx->hdrs[n], &cmd, &err_continue) < 0)
-Index: mutt.h
-===================================================================
-RCS file: /home/roessler/cvs/mutt/mutt.h,v
-retrieving revision 3.60
-diff -u -r3.60 mutt.h
---- foo/mutt.h	4 Oct 2005 06:05:39 -0000	3.60
-+++ bar/mutt.h	6 Oct 2005 17:09:40 -0000
-@@ -92,6 +92,7 @@
- #define CH_NOQFROM	(1<<15)	/* give CH_FROM precedence over CH_WEED? */
- #define CH_UPDATE_IRT	(1<<16) /* update In-Reply-To: */
- #define CH_UPDATE_REFS	(1<<17) /* update References: */
-+#define CH_UPDATE_LABEL	(1<<18) /* update X-Label: from hdr->env->x_label? */
- 
- /* flags for mutt_enter_string() */
- #define  M_ALIAS   1      /* do alias "completion" by calling up the alias-menu */
-@@ -716,6 +717,7 @@
- 					 * This flag is used by the maildir_trash
- 					 * option.
- 					 */
-+  unsigned int xlabel_changed : 1;	/* editable - used for syncing */
-   
-   /* timezone of the sender of this message */
-   unsigned int zhours : 5;

Deleted: trunk/dports/mail/mutt-devel/files/patch-1.5.10.cd.trash_folder.3.4
===================================================================
--- trunk/dports/mail/mutt-devel/files/patch-1.5.10.cd.trash_folder.3.4	2009-03-03 23:37:43 UTC (rev 47696)
+++ trunk/dports/mail/mutt-devel/files/patch-1.5.10.cd.trash_folder.3.4	2009-03-03 23:37:57 UTC (rev 47697)
@@ -1,249 +0,0 @@
-diff -aurN mutt-1.5.10/PATCHES mutt-1.5.10/PATCHES
---- mutt-1.5.10/PATCHES	2005-08-12 07:27:30.000000000 +1000
-+++ mutt-1.5.10/PATCHES	2005-09-04 02:32:50.000000000 +1000
-@@ -0,0 +1 @@
-+patch-1.5.5.1.cd.trash_folder.3.4
-diff -aurN mutt-1.5.10/commands.c mutt-1.5.10/commands.c
---- mutt-1.5.10/commands.c	2005-08-02 17:08:00.000000000 +1000
-+++ mutt-1.5.10/commands.c	2005-09-04 02:34:02.000000000 +1000
-@@ -690,6 +690,7 @@
-     if (option (OPTDELETEUNTAG))
-       mutt_set_flag (Context, h, M_TAG, 0);
-   }
-+  mutt_set_flag (Context, h, M_APPENDED, 1);
-   
-   return 0;
- }
-diff -aurN mutt-1.5.10/flags.c mutt-1.5.10/flags.c
---- mutt-1.5.10/flags.c	2005-02-04 05:47:52.000000000 +1100
-+++ mutt-1.5.10/flags.c	2005-09-04 02:32:48.000000000 +1000
-@@ -69,7 +69,13 @@
-       else if (h->deleted)
-       {
- 	h->deleted = 0;
--	if (upd_ctx) ctx->deleted--;
-+	if (upd_ctx)
-+	{
-+	  ctx->deleted--;
-+	  if (h->appended)
-+	    ctx->appended--;
-+	}
-+	h->appended = 0; /* when undeleting, also reset the appended flag */
- #ifdef USE_IMAP
-         /* see my comment above */
- 	if (ctx->magic == M_IMAP) 
-@@ -91,6 +97,17 @@
-       }
-       break;
- 
-+    case M_APPENDED:
-+      if (bf)
-+      {
-+	if (!h->appended)
-+	{
-+	  h->appended = 1;
-+	  if (upd_ctx) ctx->appended++;
-+	}
-+      }
-+      break;
-+
-     case M_NEW:
- 
- #ifdef USE_IMAP
-diff -aurN mutt-1.5.10/globals.h mutt-1.5.10/globals.h
---- mutt-1.5.10/globals.h	2005-08-03 19:17:46.000000000 +1000
-+++ mutt-1.5.10/globals.h	2005-09-04 02:32:48.000000000 +1000
-@@ -128,6 +128,7 @@
- WHERE char *Status;
- WHERE char *Tempdir;
- WHERE char *Tochars;
-+WHERE char *TrashPath;
- WHERE char *Username;
- WHERE char *Visual;
- 
-diff -aurN mutt-1.5.10/imap/message.c mutt-1.5.10/imap/message.c
---- mutt-1.5.10/imap/message.c	2005-08-02 17:08:02.000000000 +1000
-+++ mutt-1.5.10/imap/message.c	2005-09-04 02:32:48.000000000 +1000
-@@ -755,6 +755,7 @@
-         if (ctx->hdrs[n]->tagged)
-         {
-           mutt_set_flag (ctx, ctx->hdrs[n], M_DELETE, 1);
-+	  mutt_set_flag (ctx, ctx->hdrs[n], M_APPENDED, 1);
-           if (option (OPTDELETEUNTAG))
-             mutt_set_flag (ctx, ctx->hdrs[n], M_TAG, 0);
-         }
-@@ -762,6 +763,7 @@
-     else
-     {
-       mutt_set_flag (ctx, h, M_DELETE, 1);
-+      mutt_set_flag (ctx, h, M_APPENDED, 1);
-       if (option (OPTDELETEUNTAG))
-         mutt_set_flag (ctx, h, M_TAG, 0);
-     }
-diff -aurN mutt-1.5.10/init.h mutt-1.5.10/init.h
---- mutt-1.5.10/init.h	2005-08-12 05:37:01.000000000 +1000
-+++ mutt-1.5.10/init.h	2005-09-04 02:32:49.000000000 +1000
-@@ -2748,6 +2748,16 @@
-   ** by \fIyou\fP.  The sixth character is used to indicate when a mail
-   ** was sent to a mailing-list you subscribe to (default: L).
-   */
-+  { "trash",		DT_PATH, R_NONE, UL &TrashPath, 0 },
-+  /*
-+  ** .pp
-+  ** If set, this variable specifies the path of the trash folder where the
-+  ** mails marked for deletion will be moved, instead of being irremediably
-+  ** purged.
-+  ** .pp
-+  ** NOTE: When you delete a message in the trash folder, it is really
-+  ** deleted, so that you have a way to clean the trash.
-+  */
- #ifdef USE_SOCKET
-   { "tunnel",            DT_STR, R_NONE, UL &Tunnel, UL 0 },
-   /*
-diff -aurN mutt-1.5.10/mutt.h mutt-1.5.10/mutt.h
---- mutt-1.5.10/mutt.h	2005-08-12 05:37:23.000000000 +1000
-+++ mutt-1.5.10/mutt.h	2005-09-04 02:32:49.000000000 +1000
-@@ -202,6 +202,7 @@
-   M_DELETE,
-   M_UNDELETE,
-   M_DELETED,
-+  M_APPENDED,
-   M_FLAG,
-   M_TAG,
-   M_UNTAG,
-@@ -695,6 +696,7 @@
-   unsigned int mime : 1;    		/* has a Mime-Version header? */
-   unsigned int flagged : 1; 		/* marked important? */
-   unsigned int tagged : 1;
-+  unsigned int appended : 1; /* has been saved */
-   unsigned int deleted : 1;
-   unsigned int changed : 1;
-   unsigned int attach_del : 1; 		/* has an attachment marked for deletion */
-@@ -823,6 +825,7 @@
-   int new;			/* how many new messages? */
-   int unread;			/* how many unread messages? */
-   int deleted;			/* how many deleted messages */
-+  int appended;                 /* how many saved messages? */
-   int flagged;			/* how many flagged messages */
-   int msgnotreadyet;		/* which msg "new" in pager, -1 if none */
- #if defined USE_POP || defined USE_IMAP
-diff -aurN mutt-1.5.10/muttlib.c mutt-1.5.10/muttlib.c
---- mutt-1.5.10/muttlib.c	2005-08-02 17:08:01.000000000 +1000
-+++ mutt-1.5.10/muttlib.c	2005-09-04 02:35:45.000000000 +1000
-@@ -1267,7 +1267,9 @@
- 
-   if (magic > 0 && !mx_access (s, W_OK))
-   {
--    if (option (OPTCONFIRMAPPEND))
-+	if (option (OPTCONFIRMAPPEND) &&
-+	  (!TrashPath || (mutt_strcmp (s, TrashPath) != 0)))
-+	  	/* if we're appending to the trash, there's no point in asking */
-     {
-       snprintf (tmp, sizeof (tmp), _("Append messages to %s?"), s);
-       if ((rc = mutt_yesorno (tmp, M_YES)) == M_NO)
-diff -aurN mutt-1.5.10/mx.c mutt-1.5.10/mx.c
---- mutt-1.5.10/mx.c	2005-08-02 17:08:01.000000000 +1000
-+++ mutt-1.5.10/mx.c	2005-09-04 02:32:49.000000000 +1000
-@@ -819,6 +819,53 @@
-   return rc;
- }
- 
-+/* move deleted mails to the trash folder */
-+static int trash_append (CONTEXT *ctx)
-+{
-+    CONTEXT *ctx_trash;
-+    int i = 0;
-+    struct stat st, stc;
-+
-+    if (!TrashPath || !ctx->deleted ||
-+	(ctx->magic == M_MAILDIR && option (OPTMAILDIRTRASH)))
-+      return 0;
-+
-+    for (;i < ctx->msgcount && (!ctx->hdrs[i]->deleted ||
-+				ctx->hdrs[i]->appended); i++);
-+    if (i == ctx->msgcount)
-+      return 0; /* nothing to be done */
-+
-+    if (mutt_save_confirm (TrashPath, &st) != 0)
-+    {
-+      mutt_error _("message(s) not deleted");
-+      return -1;
-+    }
-+
-+    if (lstat (ctx->path, &stc) == 0 && stc.st_ino == st.st_ino
-+	&& stc.st_dev == st.st_dev && stc.st_rdev == st.st_rdev)
-+      return 0;  /* we are in the trash folder: simple sync */
-+
-+    if ((ctx_trash = mx_open_mailbox (TrashPath, M_APPEND, NULL)) != NULL)
-+    {
-+      for (i = 0 ; i < ctx->msgcount ; i++)
-+	if (ctx->hdrs[i]->deleted && !ctx->hdrs[i]->appended
-+	    && mutt_append_message (ctx_trash, ctx, ctx->hdrs[i], 0, 0) == -1)
-+	  {
-+	    mx_close_mailbox (ctx_trash, NULL);
-+	    return -1;
-+	  }
-+
-+      mx_close_mailbox (ctx_trash, NULL);
-+    }
-+    else
-+    {
-+      mutt_error _("Can't open trash folder");
-+      return -1;
-+    }
-+
-+    return 0;
-+}
-+
- /* save changes and close mailbox */
- int mx_close_mailbox (CONTEXT *ctx, int *index_hint)
- {
-@@ -958,6 +1005,7 @@
- 	  if (mutt_append_message (&f, ctx, ctx->hdrs[i], 0, CH_UPDATE_LEN) == 0)
- 	  {
- 	    mutt_set_flag (ctx, ctx->hdrs[i], M_DELETE, 1);
-+	    mutt_set_flag (ctx, ctx->hdrs[i], M_APPENDED, 1);
- 	  }
- 	  else
- 	  {
-@@ -979,6 +1027,14 @@
-     return 0;
-   }
-   
-+  /* copy mails to the trash before expunging */
-+  if (purge && ctx->deleted)
-+    if (trash_append (ctx) != 0)
-+    {
-+      ctx->closing = 0;
-+      return -1;
-+    }
-+
- #ifdef USE_IMAP
-   /* allow IMAP to preserve the deleted flag across sessions */
-   if (ctx->magic == M_IMAP)
-@@ -1174,6 +1230,12 @@
-   msgcount = ctx->msgcount;
-   deleted = ctx->deleted;
- 
-+  if (purge && ctx->deleted)
-+  {
-+    if (trash_append (ctx) == -1)
-+      return -1;
-+  } 
-+
- #ifdef USE_IMAP
-   if (ctx->magic == M_IMAP)
-     rc = imap_sync_mailbox (ctx, purge, index_hint);
-diff -aurN mutt-1.5.10/postpone.c mutt-1.5.10/postpone.c
---- mutt-1.5.10/postpone.c	2005-02-04 05:47:53.000000000 +1100
-+++ mutt-1.5.10/postpone.c	2005-09-04 02:32:50.000000000 +1000
-@@ -279,6 +279,9 @@
-   /* finished with this message, so delete it. */
-   mutt_set_flag (PostContext, h, M_DELETE, 1);
- 
-+  /* and consider it saved, so that it won't be moved to the trash folder */
-+  mutt_set_flag (PostContext, h, M_APPENDED, 1);
-+
-   /* update the count for the status display */
-   PostCount = PostContext->msgcount - PostContext->deleted;
- 

Deleted: trunk/dports/mail/mutt-devel/files/patch-cvs20051112.bc.smtp
===================================================================
--- trunk/dports/mail/mutt-devel/files/patch-cvs20051112.bc.smtp	2009-03-03 23:37:43 UTC (rev 47696)
+++ trunk/dports/mail/mutt-devel/files/patch-cvs20051112.bc.smtp	2009-03-03 23:37:57 UTC (rev 47697)
@@ -1,934 +0,0 @@
-diff -r ede30c9816d5 Makefile.am
---- a/Makefile.am	Sat Nov 12 06:45:36 2005
-+++ b/Makefile.am	Sat Nov 12 10:33:03 2005
-@@ -61,7 +61,7 @@
- EXTRA_mutt_SOURCES = account.c md5c.c mutt_sasl.c mutt_socket.c mutt_ssl.c \
- 	mutt_tunnel.c pop.c pop_auth.c pop_lib.c smime.c pgp.c pgpinvoke.c pgpkey.c \
- 	pgplib.c sha1.c pgpmicalg.c gnupgparse.c resize.c dotlock.c remailer.c \
--	browser.h mbyte.h remailer.h url.h \
-+	smtp.c browser.h mbyte.h remailer.h url.h \
- 	crypt-mod-pgp-classic.c crypt-mod-smime-classic.c \
- 	pgppacket.c mutt_idna.h hcache.c mutt_ssl_gnutls.c \
- 	crypt-gpgme.c crypt-mod-pgp-gpgme.c crypt-mod-smime-gpgme.c
-diff -r ede30c9816d5 account.c
---- a/account.c	Sat Nov 12 06:45:36 2005
-+++ b/account.c	Sat Nov 12 10:33:03 2005
-@@ -123,6 +123,16 @@
-   }
- #endif
- 
-+#ifdef USE_SMTP
-+  if (account->type == M_ACCT_TYPE_SMTP)
-+  {
-+    if (account->flags & M_ACCT_SSL)
-+      url->scheme = U_SMTPS;
-+    else
-+      url->scheme = U_SMTP;
-+  }
-+#endif
-+
-   url->host = account->host;
-   if (account->flags & M_ACCT_PORT)
-     url->port = account->port;
-diff -r ede30c9816d5 account.h
---- a/account.h	Sat Nov 12 06:45:36 2005
-+++ b/account.h	Sat Nov 12 10:33:03 2005
-@@ -28,7 +28,8 @@
- {
-   M_ACCT_TYPE_NONE = 0,
-   M_ACCT_TYPE_IMAP,
--  M_ACCT_TYPE_POP
-+  M_ACCT_TYPE_POP,
-+  M_ACCT_TYPE_SMTP
- };
- 
- /* account flags */
-diff -r ede30c9816d5 configure.in
---- a/configure.in	Sat Nov 12 06:45:36 2005
-+++ b/configure.in	Sat Nov 12 10:33:03 2005
-@@ -514,6 +514,13 @@
-         fi
- ])
- AM_CONDITIONAL(BUILD_IMAP, test x$need_imap = xyes)
-+
-+AC_ARG_ENABLE(smtp, AC_HELP_STRING([--enable-smtp], [include internal SMTP relay support]),
-+	[if test $enableval = yes; then
-+		AC_DEFINE(USE_SMTP, 1, [Include internal SMTP relay support])
-+            	MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS smtp.o"
-+		need_socket="yes"
-+	fi])
- 
- dnl -- end socket dependencies --
- 
-diff -r ede30c9816d5 globals.h
---- a/globals.h	Sat Nov 12 06:45:36 2005
-+++ b/globals.h	Sat Nov 12 10:33:03 2005
-@@ -112,6 +112,10 @@
- WHERE char *Shell;
- WHERE char *Signature;
- WHERE char *SimpleSearch;
-+#if USE_SMTP
-+WHERE char *SmtpUrl INITVAL (NULL);
-+WHERE char *SmtpAuthenticators INITVAL (NULL);
-+#endif /* USE_SMTP */
- WHERE char *Spoolfile;
- WHERE char *SpamSep;
- #if defined(USE_SSL) || defined(USE_GNUTLS)
-diff -r ede30c9816d5 init.h
---- a/init.h	Sat Nov 12 06:45:36 2005
-+++ b/init.h	Sat Nov 12 10:33:03 2005
-@@ -91,6 +91,9 @@
- # endif
- # ifndef USE_POP
- #  define USE_POP
-+# endif
-+# ifndef USE_SMTP
-+#  define USE_SMTP
- # endif
- # ifndef USE_SSL
- #  define USE_SSL
-@@ -2507,6 +2510,34 @@
-   ** messages from the current folder.  The default is to pause one second, so 
-   ** a value of zero for this option suppresses the pause.
-   */
-+#if USE_SMTP
-+  { "smtp_url",		DT_STR, R_NONE, UL &SmtpUrl, UL 0 },
-+  /*
-+  ** .pp
-+  ** Defines the SMTP ``smart'' host where sent messages should relayed for
-+  ** delivery. This should take the form of an SMTP URL, eg:
-+  ** .pp
-+  **   smtp[s]://[user[:pass]@]host[:port]/
-+  ** .pp
-+  ** Setting this variable overrides the value of the ``$$sendmail''
-+  ** variable.
-+  */
-+# ifdef USE_SASL
-+  { "smtp_authenticators", DT_STR, R_NONE, UL &SmtpAuthenticators, UL 0 },
-+  /*
-+   ** .pp
-+   ** This is a colon-delimited list of authentication methods mutt may
-+   ** attempt to use to log in to an SMTP server, in the order mutt should
-+   ** try them.  Authentication methods are any SASL mechanism, eg
-+   ** 'digest-md5', 'gssapi' or 'cram-md5'.
-+   ** This parameter is case-insensitive. If this parameter is unset
-+   ** (the default) mutt will try all available methods, in order from
-+   ** most-secure to least-secure.
-+   ** .pp
-+   ** Example: set smtp_authenticators="digest-md5:cram-md5"
-+   */
-+# endif /* USE_SASL */
-+#endif /* USE_SMTP */
-   { "sort",		DT_SORT, R_INDEX|R_RESORT, UL &Sort, SORT_DATE },
-   /*
-   ** .pp
-@@ -2902,7 +2933,10 @@
-   /*
-   ** .pp
-   ** Controls whether mutt writes out the Bcc header when preparing
--  ** messages to be sent.  Exim users may wish to unset this.
-+  ** messages to be sent.  Exim users may wish to unset this. If mutt
-+  ** is set to deliver directly via SMTP (see ``$$smtp_url''), this
-+  ** option does nothing: mutt will never write out the BCC header
-+  ** in this case.
-   */
-   /*--*/
-   { NULL }
-diff -r ede30c9816d5 main.c
---- a/main.c	Sat Nov 12 06:45:36 2005
-+++ b/main.c	Sat Nov 12 10:33:03 2005
-@@ -257,6 +257,12 @@
-         "-USE_IMAP  "
- #endif
- 
-+#ifdef USE_SMTP
-+	"+USE_SMTP  "
-+#else
-+	"-USE_SMTP  "
-+#endif
-+
- #ifdef USE_GSS
- 	"+USE_GSS  "
- #else
-diff -r ede30c9816d5 mutt_sasl.c
---- a/mutt_sasl.c	Sat Nov 12 06:45:36 2005
-+++ b/mutt_sasl.c	Sat Nov 12 10:33:03 2005
-@@ -182,42 +182,44 @@
-     case M_ACCT_TYPE_POP:
-       service = "pop";
-       break;
-+    case M_ACCT_TYPE_SMTP:
-+      service = "smtp";
-+      break;
-     default:
--      dprint (1, (debugfile, "mutt_sasl_client_new: account type unset\n"));
-+      mutt_error (_("Unknown SASL profile"));
-       return -1;
-   }
- 
-   size = sizeof (local);
--  if (getsockname (conn->fd, (struct sockaddr *)&local, &size)){
--    dprint (1, (debugfile, "mutt_sasl_client_new: getsockname for local failed\n"));
-+  if (getsockname (conn->fd, (struct sockaddr *)&local, &size)) {
-+    mutt_error (_("SASL failed to get local IP address"));
-     return -1;
-   }
-   else 
--  if (iptostring((struct sockaddr *)&local, size, iplocalport, IP_PORT_BUFLEN) != SASL_OK){
--    dprint (1, (debugfile, "mutt_sasl_client_new: iptostring for local failed\n"));
-+  if (iptostring((struct sockaddr *)&local, size, iplocalport, IP_PORT_BUFLEN) != SASL_OK) {
-+    mutt_error (_("SASL failed to parse local IP address"));
-     return -1;
-   }
-   
-   size = sizeof (remote);
-   if (getpeername (conn->fd, (struct sockaddr *)&remote, &size)){
--    dprint (1, (debugfile, "mutt_sasl_client_new: getsockname for remote failed\n"));
-+    mutt_error (_("SASL failed to get remote IP address"));
-     return -1;
-   }
-   else 
-   if (iptostring((struct sockaddr *)&remote, size, ipremoteport, IP_PORT_BUFLEN) != SASL_OK){
--    dprint (1, (debugfile, "mutt_sasl_client_new: iptostring for remote failed\n"));
--    return -1;
--  }
--
--  dprint(1,(debugfile, "local ip: %s, remote ip:%s\n", iplocalport, ipremoteport));
-+    mutt_error (_("SASL failed to parse remote IP address"));
-+    return -1;
-+  }
-+
-+  dprint(2, (debugfile, "local ip: %s, remote ip:%s\n", iplocalport, ipremoteport));
-   
-   rc = sasl_client_new (service, conn->account.host, iplocalport, ipremoteport,
-     mutt_sasl_get_callbacks (&conn->account), 0, saslconn);
- 
-   if (rc != SASL_OK)
-   {
--    dprint (1, (debugfile,
--      "mutt_sasl_client_new: Error allocating SASL connection\n"));
-+    mutt_error (_("Error allocating SASL connection"));
-     return -1;
-   }
- 
-@@ -232,8 +234,7 @@
-   secprops.security_flags |= SASL_SEC_NOPLAINTEXT;
-   if (sasl_setprop (*saslconn, SASL_SEC_PROPS, &secprops) != SASL_OK)
-   {
--    dprint (1, (debugfile,
--      "mutt_sasl_client_new: Error setting security properties\n"));
-+    mutt_error (_("Error setting SASL security properties"));
-     return -1;
-   }
- 
-@@ -243,13 +244,13 @@
-     dprint (2, (debugfile, "External SSF: %d\n", conn->ssf));
-     if (sasl_setprop (*saslconn, SASL_SSF_EXTERNAL, &(conn->ssf)) != SASL_OK)
-     {
--      dprint (1, (debugfile, "mutt_sasl_client_new: Error setting external properties\n"));
-+      mutt_error (_("Error setting SASL external security strength"));
-       return -1;
-     }
-     dprint (2, (debugfile, "External authentication name: %s\n", conn->account.user));
-     if (sasl_setprop (*saslconn, SASL_AUTH_EXTERNAL, conn->account.user) != SASL_OK)
--     {
--      dprint (1, (debugfile, "mutt_sasl_client_new: Error setting external properties\n"));
-+    {
-+      mutt_error (_("Error setting SASL external user name"));
-       return -1;
-     }
-   }
-diff -r ede30c9816d5 mutt_socket.h
---- a/mutt_socket.h	Sat Nov 12 06:45:36 2005
-+++ b/mutt_socket.h	Sat Nov 12 10:33:03 2005
-@@ -56,7 +56,7 @@
- int mutt_socket_readchar (CONNECTION *conn, char *c);
- #define mutt_socket_readln(A,B,C) mutt_socket_readln_d(A,B,C,M_SOCK_LOG_CMD)
- int mutt_socket_readln_d (char *buf, size_t buflen, CONNECTION *conn, int dbg);
--#define mutt_socket_write(A,B) mutt_socket_write_d(A,B,M_SOCK_LOG_CMD);
-+#define mutt_socket_write(A,B) mutt_socket_write_d(A,B,M_SOCK_LOG_CMD)
- int mutt_socket_write_d (CONNECTION *conn, const char *buf, int dbg);
- 
- /* stupid hack for imap_logout_all */
-diff -r ede30c9816d5 protos.h
---- a/protos.h	Sat Nov 12 06:45:36 2005
-+++ b/protos.h	Sat Nov 12 10:33:03 2005
-@@ -343,6 +343,10 @@
- int _mutt_save_message (HEADER *, CONTEXT *, int, int, int);
- int mutt_save_message (HEADER *, int, int, int, int *);
- int mutt_search_command (int, int);
-+#ifdef USE_SMTP
-+int mutt_smtp_send (const ADDRESS *, const ADDRESS *, const ADDRESS *,
-+                    const ADDRESS *, const char *, int);
-+#endif
- int mutt_strwidth (const char *);
- int mutt_compose_menu (HEADER *, char *, size_t, HEADER *);
- int mutt_thread_set_flag (HEADER *, int, int, int);
-diff -r ede30c9816d5 send.c
---- a/send.c	Sat Nov 12 06:45:36 2005
-+++ b/send.c	Sat Nov 12 10:33:03 2005
-@@ -962,18 +962,30 @@
-   char tempfile[_POSIX_PATH_MAX];
-   FILE *tempfp;
-   int i;
-+#ifdef USE_SMTP
-+  short old_write_bcc;
-+#endif
-   
-   /* Write out the message in MIME form. */
-   mutt_mktemp (tempfile);
-   if ((tempfp = safe_fopen (tempfile, "w")) == NULL)
-     return (-1);
- 
-+#ifdef USE_SMTP
-+  old_write_bcc = option (OPTWRITEBCC);
-+  if (SmtpUrl)
-+    unset_option (OPTWRITEBCC);
-+#endif
- #ifdef MIXMASTER
-   mutt_write_rfc822_header (tempfp, msg->env, msg->content, 0, msg->chain ? 1 : 0);
- #endif
- #ifndef MIXMASTER
-   mutt_write_rfc822_header (tempfp, msg->env, msg->content, 0, 0);
- #endif
-+#ifdef USE_SMTP
-+  if (old_write_bcc)
-+    set_option (OPTWRITEBCC);
-+#endif
-   
-   fputc ('\n', tempfp); /* tie off the header. */
- 
-@@ -996,8 +1008,16 @@
-     return mix_send_message (msg->chain, tempfile);
- #endif
- 
-+#if USE_SMTP
-+  if (SmtpUrl)
-+      return mutt_smtp_send (msg->env->from, msg->env->to, msg->env->cc,
-+                             msg->env->bcc, tempfile,
-+                             (msg->content->encoding == ENC8BIT));
-+#endif /* USE_SMTP */
-+
-   i = mutt_invoke_sendmail (msg->env->from, msg->env->to, msg->env->cc, 
--			    msg->env->bcc, tempfile, (msg->content->encoding == ENC8BIT));
-+			    msg->env->bcc, tempfile,
-+                            (msg->content->encoding == ENC8BIT));
-   return (i);
- }
- 
-diff -r ede30c9816d5 sendlib.c
---- a/sendlib.c	Sat Nov 12 06:45:36 2005
-+++ b/sendlib.c	Sat Nov 12 10:33:03 2005
-@@ -2178,6 +2178,12 @@
-     mutt_copy_bytes (fp, f, h->content->length);
-     fclose (f);
- 
-+#if USE_SMTP
-+    if (SmtpUrl)
-+      ret = mutt_smtp_send (env_from, to, NULL, NULL, tempfile,
-+                            h->content->encoding == ENC8BIT);
-+    else
-+#endif /* USE_SMTP */
-     ret = mutt_invoke_sendmail (env_from, to, NULL, NULL, tempfile,
- 			  	h->content->encoding == ENC8BIT);
-   }
-@@ -2428,7 +2434,7 @@
-     rewind (tempfp);
-     while (fgets (sasha, sizeof (sasha), tempfp) != NULL)
-       lines++;
--    fprintf (msg->fp, "Content-Length: " OFF_T_FMT "\n", ftello (tempfp));
-+    fprintf (msg->fp, "Content-Length: " OFF_T_FMT "\n", (LOFF_T) ftell (tempfp));
-     fprintf (msg->fp, "Lines: %d\n\n", lines);
- 
-     /* copy the body and clean up */
-diff -r ede30c9816d5 url.c
---- a/url.c	Sat Nov 12 06:45:36 2005
-+++ b/url.c	Sat Nov 12 10:33:03 2005
-@@ -37,10 +37,12 @@
-   { "file", 	U_FILE },
-   { "imap", 	U_IMAP },
-   { "imaps", 	U_IMAPS },
--  { "pop",  	U_POP  },
--  { "pops", 	U_POPS  },
-+  { "pop",  	U_POP },
-+  { "pops", 	U_POPS },
-   { "mailto",	U_MAILTO },
--  { NULL,	U_UNKNOWN}
-+  { "smtp",     U_SMTP },
-+  { "smtps",    U_SMTPS },
-+  { NULL,	U_UNKNOWN }
- };
- 
- 
-diff -r ede30c9816d5 url.h
---- a/url.h	Sat Nov 12 06:45:36 2005
-+++ b/url.h	Sat Nov 12 10:33:03 2005
-@@ -8,6 +8,8 @@
-   U_POPS,
-   U_IMAP,
-   U_IMAPS,
-+  U_SMTP,
-+  U_SMTPS,
-   U_MAILTO,
-   U_UNKNOWN
- }
-diff -r ede30c9816d5 smtp.c
---- /dev/null	Sat Nov 12 06:45:36 2005
-+++ b/smtp.c	Sat Nov 12 10:33:03 2005
-@@ -0,0 +1,556 @@
-+/* mutt - text oriented MIME mail user agent
-+ * Copyright (C) 2002 Michael R. Elkins <me at mutt.org>
-+ * Copyright (C) 2005 Brendan Cully <brendan at kublai.com>
-+ *
-+ *     This program is free software; you can redistribute it and/or modify
-+ *     it under the terms of the GNU General Public License as published by
-+ *     the Free Software Foundation; either version 2 of the License, or
-+ *     (at your option) any later version.
-+ *
-+ *     This program is distributed in the hope that it will be useful,
-+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *     GNU General Public License for more details.
-+ *
-+ *     You should have received a copy of the GNU General Public License
-+ *     along with this program; if not, write to the Free Software
-+ *     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
-+ */
-+
-+/* This file contains code for direct SMTP delivery of email messages. */
-+
-+#if HAVE_CONFIG_H
-+#include "config.h"
-+#endif
-+
-+#include "mutt.h"
-+#include "mutt_curses.h"
-+#include "mutt_socket.h"
-+#if defined(USE_SSL) || defined(USE_GNUTLS)
-+# include "mutt_ssl.h"
-+#endif
-+#ifdef USE_SASL
-+#include "mutt_sasl.h"
-+
-+#include <sasl/sasl.h>
-+#include <sasl/saslutil.h>
-+#endif
-+
-+#include <netdb.h>
-+#include <stdio.h>
-+#include <sys/stat.h>
-+
-+#define smtp_success(x) ((x)/100 == 2)
-+#define smtp_ready 334
-+#define smtp_continue 354
-+
-+#define smtp_err_read -2
-+#define smtp_err_write -3
-+
-+#define SMTP_PORT 25
-+#define SMTPS_PORT 465
-+
-+#define SMTP_AUTH_SUCCESS 0
-+#define SMTP_AUTH_UNAVAIL 1
-+#define SMTP_AUTH_FAIL    -1
-+
-+enum {
-+  STARTTLS,
-+  AUTH,
-+  DSN,
-+  EIGHTBITMIME,
-+
-+  CAPMAX
-+};
-+
-+#ifdef USE_SASL
-+static int smtp_auth (CONNECTION* conn);
-+static int smtp_auth_sasl (CONNECTION* conn, const char* mechanisms);
-+#endif
-+
-+static int smtp_fill_account (ACCOUNT* account);
-+static int smtp_open (CONNECTION* conn);
-+
-+static int Esmtp = 0;
-+static char* AuthMechs = NULL;
-+static unsigned char Capabilities[(CAPMAX + 7)/ 8];
-+
-+/* Reads a command response from the SMTP server.
-+ * Returns:
-+ * 0	on success (2xx code) or continue (354 code)
-+ * -1	write error, or any other response code
-+ */
-+static int
-+smtp_get_resp (CONNECTION * conn)
-+{
-+  int n;
-+  char buf[1024];
-+
-+  do {
-+    n = mutt_socket_readln (buf, sizeof (buf), conn);
-+    if (n == -1)
-+      return smtp_err_read;
-+    n = atoi (buf);
-+
-+    if (!ascii_strncasecmp ("8BITMIME", buf + 4, 8))
-+      mutt_bit_set (Capabilities, EIGHTBITMIME);
-+    else if (!ascii_strncasecmp ("AUTH", buf + 4, 4))
-+    {
-+      mutt_bit_set (Capabilities, AUTH);
-+      FREE (&AuthMechs);
-+      AuthMechs = safe_strdup (buf + 9);
-+    }
-+    else if (!ascii_strncasecmp ("DSN", buf + 4, 3))
-+      mutt_bit_set (Capabilities, DSN);
-+    else if (!ascii_strncasecmp ("STARTTLS", buf + 4, 8))
-+      mutt_bit_set (Capabilities, STARTTLS);
-+  } while (buf[3] == '-');
-+
-+  if (smtp_success (n) || n == smtp_continue)
-+    return 0;
-+
-+  mutt_error (_("SMTP session failed: %s"), buf);
-+    return -1;
-+}
-+
-+static int
-+smtp_rcpt_to (CONNECTION * conn, const ADDRESS * a)
-+{
-+  char buf[1024];
-+  int r;
-+
-+  while (a)
-+  {
-+    if (mutt_bit_isset (Capabilities, DSN) && DsnNotify)
-+      snprintf (buf, sizeof (buf), "RCPT TO:<%s> NOTIFY=%s\r\n",
-+                a->mailbox, DsnNotify);
-+    else
-+      snprintf (buf, sizeof (buf), "RCPT TO:<%s>\r\n", a->mailbox);
-+    if (mutt_socket_write (conn, buf) == -1)
-+      return smtp_err_write;
-+    if ((r = smtp_get_resp (conn)))
-+      return r;
-+    a = a->next;
-+  }
-+
-+  return 0;
-+}
-+
-+static int
-+smtp_data (CONNECTION * conn, const char *msgfile)
-+{
-+  char buf[1024];
-+  FILE *fp = 0;
-+  progress_t progress;
-+  struct stat st;
-+  int r;
-+  size_t buflen;
-+
-+  fp = fopen (msgfile, "r");
-+  if (!fp)
-+  {
-+    mutt_error ("SMTP session failed: unable to open %s", msgfile);
-+    return -1;
-+  }
-+  stat (msgfile, &st);
-+  progress.msg = _("Sending message...");
-+  progress.size = st.st_size;
-+  mutt_progress_bar (&progress, 0);
-+
-+  snprintf (buf, sizeof (buf), "DATA\r\n");
-+  if (mutt_socket_write (conn, buf) == -1)
-+  {
-+    fclose (fp);
-+    return smtp_err_write;
-+  }
-+  if ((r = smtp_get_resp (conn)))
-+  {
-+    fclose (fp);
-+    return r;
-+  }
-+
-+  while (fgets (buf, sizeof (buf) - 1, fp))
-+  {
-+    buflen = mutt_strlen (buf);
-+    if (buflen && buf[buflen-1] == '\n'
-+	&& (buflen == 1 || buf[buflen - 2] != '\r'))
-+      snprintf (buf + buflen - 1, sizeof (buf) - buflen + 1, "\r\n");
-+    if (buf[0] == '.')
-+    {
-+      if (mutt_socket_write_d (conn, ".", 3) == -1)
-+      {
-+        fclose (fp);
-+        return smtp_err_write;
-+      }
-+    }
-+    if (mutt_socket_write_d (conn, buf, 3) == -1)
-+    {
-+      fclose (fp);
-+      return smtp_err_write;
-+    }
-+
-+    mutt_progress_bar (&progress, ftell (fp));
-+  }
-+  fclose (fp);
-+
-+  /* terminate the message body */
-+  if (mutt_socket_write (conn, ".\r\n") == -1)
-+    return smtp_err_write;
-+
-+  if ((r = smtp_get_resp (conn)))
-+    return r;
-+
-+  return 0;
-+}
-+
-+int
-+mutt_smtp_send (const ADDRESS* from, const ADDRESS* to, const ADDRESS* cc,
-+                const ADDRESS* bcc, const char *msgfile, int eightbit)
-+{
-+  CONNECTION *conn;
-+  ACCOUNT account;
-+  int ret = -1;
-+  char buf[1024];
-+
-+  if (smtp_fill_account (&account) < 0)
-+    return ret;
-+
-+  if (!(conn = mutt_conn_find (NULL, &account)))
-+    return -1;
-+
-+  Esmtp = eightbit;
-+
-+  do
-+  {
-+    /* send our greeting */
-+    if (( ret = smtp_open (conn)))
-+      break;
-+    FREE (&AuthMechs);
-+
-+    /* send the sender's address */
-+    ret = snprintf (buf, sizeof (buf), "MAIL FROM:<%s>",
-+                    EnvFrom ? EnvFrom->mailbox : from->mailbox);
-+    if (eightbit && mutt_bit_isset (Capabilities, EIGHTBITMIME))
-+    {
-+      safe_strncat (buf, sizeof (buf), " BODY=8BITMIME", 15);
-+      ret += 14;
-+    }
-+    if (DsnReturn && mutt_bit_isset (Capabilities, DSN))
-+      ret += snprintf (buf + ret, sizeof (buf) - ret, " RET=%s", DsnReturn);
-+    safe_strncat (buf, sizeof (buf), "\r\n", 3);
-+    if (mutt_socket_write (conn, buf) == -1)
-+    {
-+      ret = smtp_err_write;
-+      break;
-+    }
-+    if ((ret = smtp_get_resp (conn)))
-+      break;
-+
-+    /* send the recipient list */
-+    if ((ret = smtp_rcpt_to (conn, to)) || (ret = smtp_rcpt_to (conn, cc))
-+        || (ret = smtp_rcpt_to (conn, bcc)))
-+      break;
-+
-+    /* send the message data */
-+    if ((ret = smtp_data (conn, msgfile)))
-+      break;
-+
-+    mutt_socket_write (conn, "QUIT\r\n");
-+
-+    ret = 0;
-+  }
-+  while (0);
-+
-+  if (conn)
-+    mutt_socket_close (conn);
-+
-+  if (ret == smtp_err_read)
-+    mutt_error (_("SMTP session failed: read error"));
-+  else if (ret == smtp_err_write)
-+    mutt_error (_("SMTP session failed: write error"));
-+
-+  return ret;
-+}
-+
-+static int smtp_fill_account (ACCOUNT* account)
-+{
-+  static unsigned short SmtpPort = 0;
-+
-+  struct servent* service;
-+  ciss_url_t url;
-+  char* urlstr;
-+
-+  account->flags = 0;
-+  account->port = 0;
-+  account->type = M_ACCT_TYPE_SMTP;
-+
-+  urlstr = safe_strdup (SmtpUrl);
-+  url_parse_ciss (&url, urlstr);
-+  if ((url.scheme != U_SMTP && url.scheme != U_SMTPS)
-+      || mutt_account_fromurl (account, &url) < 0)
-+  {
-+    FREE (&urlstr);
-+    mutt_error (_("Invalid SMTP URL: %s"), SmtpUrl);
-+    mutt_sleep (1);
-+    return -1;
-+  }
-+  FREE (&urlstr);
-+
-+  if (url.scheme == U_SMTPS)
-+    account->flags |= M_ACCT_SSL;
-+
-+  if (!account->port)
-+  {
-+    if (account->flags & M_ACCT_SSL)
-+      account->port = SMTPS_PORT;
-+    else
-+    {
-+      if (!SmtpPort)
-+      {
-+        service = getservbyname ("smtp", "tcp");
-+        if (service)
-+          SmtpPort = ntohs (service->s_port);
-+        else
-+          SmtpPort = SMTP_PORT;
-+        dprint (3, (debugfile, "Using default SMTP port %d\n", SmtpPort));
-+      }
-+      account->port = SmtpPort;
-+    }
-+  }
-+
-+  return 0;
-+}
-+
-+static int smtp_helo (CONNECTION* conn)
-+{
-+  char buf[LONG_STRING];
-+
-+  memset (Capabilities, 0, sizeof (Capabilities));
-+
-+  if (!Esmtp)
-+  {
-+    /* if TLS or AUTH are requested, use EHLO */
-+    if (conn->account.flags & M_ACCT_USER)
-+      Esmtp = 1;
-+#if defined(USE_SSL) || defined(USE_GNUTLS)
-+    if (option (OPTSSLFORCETLS) || quadoption (OPT_SSLSTARTTLS) != M_NO)
-+      Esmtp = 1;
-+#endif
-+  }
-+
-+  snprintf (buf, sizeof (buf), "%s %s\r\n", Esmtp ? "EHLO" : "HELO", Fqdn);
-+  /* XXX there should probably be a wrapper in mutt_socket.c that
-+    * repeatedly calls conn->write until all data is sent.  This
-+    * currently doesn't check for a short write.
-+    */
-+  if (mutt_socket_write (conn, buf) == -1)
-+    return smtp_err_write;
-+  return smtp_get_resp (conn);
-+}
-+
-+static int smtp_open (CONNECTION* conn)
-+{
-+  int rc;
-+
-+  if (mutt_socket_open (conn))
-+    return -1;
-+
-+  /* get greeting string */
-+  if ((rc = smtp_get_resp (conn)))
-+    return rc;
-+
-+  if ((rc = smtp_helo (conn)))
-+    return rc;
-+
-+#if defined(USE_SSL) || defined(USE_GNUTLS)
-+  if (conn->ssf)
-+    rc = M_NO;
-+  else if (option (OPTSSLFORCETLS))
-+    rc = M_YES;
-+  else if (mutt_bit_isset (Capabilities, STARTTLS) &&
-+           (rc = query_quadoption (OPT_SSLSTARTTLS,
-+                                   _("Secure connection with TLS?"))) == -1)
-+    return rc;
-+
-+  if (rc == M_YES)
-+  {
-+    if (mutt_socket_write (conn, "STARTTLS\r\n") < 0)
-+      return smtp_err_write;
-+    if ((rc = smtp_get_resp (conn)))
-+      return rc;
-+
-+#ifdef USE_SSL
-+    if (mutt_ssl_starttls (conn))
-+#elif USE_GNUTLS
-+    if (mutt_gnutls_starttls (conn))
-+#endif
-+    {
-+      mutt_error (_("Could not negotiate TLS connection"));
-+      mutt_sleep (1);
-+      return -1;
-+    }
-+
-+    /* re-EHLO to get authentication mechanisms */
-+    if ((rc = smtp_helo (conn)))
-+      return rc;
-+  }
-+#endif
-+
-+  if (conn->account.flags & M_ACCT_USER)
-+  {
-+    if (!mutt_bit_isset (Capabilities, AUTH))
-+    {
-+      mutt_error (_("SMTP server does not support authentication"));
-+      mutt_sleep (1);
-+      return -1;
-+    }
-+
-+#ifdef USE_SASL
-+    return smtp_auth (conn);
-+#else
-+    mutt_error (_("SMTP authentication requires SASL"));
-+    mutt_sleep (1);
-+    return -1;
-+#endif /* USE_SASL */
-+  }
-+
-+  return 0;
-+}
-+
-+#ifdef USE_SASL
-+static int smtp_auth (CONNECTION* conn)
-+{
-+  int r = SMTP_AUTH_UNAVAIL;
-+
-+  if (SmtpAuthenticators && *SmtpAuthenticators)
-+  {
-+    char* methods = safe_strdup (SmtpAuthenticators);
-+    char* method;
-+    char* delim;
-+
-+    for (method = methods; method; method = delim)
-+    {
-+      delim = strchr (method, ':');
-+      if (delim)
-+	*delim++ = '\0';
-+      if (! method[0])
-+	continue;
-+
-+      dprint (2, (debugfile, "smtp_authenticate: Trying method %s\n", method));
-+
-+      if ((r = smtp_auth_sasl (conn, method)) != SMTP_AUTH_UNAVAIL)
-+        break;
-+    }
-+
-+    FREE (&methods);
-+  }
-+  else
-+    r = smtp_auth_sasl (conn, AuthMechs);
-+
-+  if (r == SMTP_AUTH_UNAVAIL)
-+  {
-+    mutt_error (_("No authenticators available"));
-+    mutt_sleep (1);
-+  }
-+
-+  return r == SMTP_AUTH_SUCCESS ? 0 : -1;
-+}
-+
-+static int smtp_auth_sasl (CONNECTION* conn, const char* mechlist)
-+{
-+  sasl_conn_t* saslconn;
-+  sasl_interact_t* interaction = NULL;
-+  const char* mech;
-+  const char* data = NULL;
-+  unsigned int len;
-+  char buf[HUGE_STRING];
-+  int rc, saslrc;
-+
-+  if (mutt_sasl_client_new (conn, &saslconn) < 0)
-+    return SMTP_AUTH_FAIL;
-+
-+  do
-+  {
-+    rc = sasl_client_start (saslconn, mechlist, &interaction, &data, &len, &mech);
-+    if (rc == SASL_INTERACT)
-+      mutt_sasl_interact (interaction);
-+  }
-+  while (rc == SASL_INTERACT);
-+
-+  if (rc != SASL_OK && rc != SASL_CONTINUE)
-+  {
-+    dprint (2, (debugfile, "smtp_auth_sasl: %s unavailable\n", mech));
-+    sasl_dispose (&saslconn);
-+    return SMTP_AUTH_UNAVAIL;
-+  }
-+
-+  mutt_message (_("Authenticating (%s)..."), mech);
-+
-+  snprintf (buf, sizeof (buf), "AUTH %s", mech);
-+  if (len)
-+  {
-+    strncat (buf, " ", sizeof (buf));
-+    if (sasl_encode64 (data, len, buf + mutt_strlen (buf),
-+                       sizeof (buf) - mutt_strlen (buf), &len) != SASL_OK)
-+    {
-+      dprint (1, (debugfile, "smtp_auth_sasl: error base64-encoding client response.\n"));
-+      goto fail;
-+    }
-+  }
-+  strncat (buf, "\r\n", sizeof (buf));
-+
-+  do {
-+    if (mutt_socket_write (conn, buf) < 0)
-+      goto fail;
-+    if (mutt_socket_readln (buf, sizeof (buf), conn) < 0)
-+      goto fail;
-+    rc = atoi(buf);
-+
-+    if (rc != smtp_ready)
-+      break;
-+
-+    if (sasl_decode64 (buf+4, strlen (buf+4), buf, sizeof (buf), &len) != SASL_OK)
-+    {
-+      dprint (1, (debugfile, "smtp_auth_sasl: error base64-decoding server response.\n"));
-+      goto fail;
-+    }
-+
-+    do
-+    {
-+      saslrc = sasl_client_step (saslconn, buf, len, &interaction, &data, &len);
-+      if (saslrc == SASL_INTERACT)
-+        mutt_sasl_interact (interaction);
-+    }
-+    while (saslrc == SASL_INTERACT);
-+
-+    if (len)
-+    {
-+      if (sasl_encode64 (data, len, buf, sizeof (buf), &len) != SASL_OK)
-+      {
-+        dprint (1, (debugfile, "smtp_auth_sasl: error base64-encoding client response.\n"));
-+        goto fail;
-+      }
-+    }
-+    strfcpy (buf + len, "\r\n", sizeof (buf) - len);
-+  } while (rc == smtp_ready);
-+
-+  if (smtp_success (rc))
-+  {
-+    mutt_sasl_setup_conn (conn, saslconn);
-+    return SMTP_AUTH_SUCCESS;
-+  }
-+  else if (SmtpAuthenticators && *SmtpAuthenticators)
-+  {
-+    /* if we're given a mech list to attempt, failure means try the next */
-+    dprint (2, (debugfile, "smtp_auth_sasl: %s failed\n", mech));
-+    sasl_dispose (&saslconn);
-+    return SMTP_AUTH_UNAVAIL;
-+  }
-+
-+fail:
-+  mutt_error (_("SASL authentication failed"));
-+  mutt_sleep (1);
-+  sasl_dispose (&saslconn);
-+  return SMTP_AUTH_FAIL;
-+}
-+#endif /* USE_SASL */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090303/2d638821/attachment-0001.html>


More information about the macports-changes mailing list