Hi. The attached patch is the beginning of support for RFC 2369. If an email address is found in the List-Post header, and if one uses the list-reply function, then this address is added to the list of recipients. It is incomplete as it doesn't use any of the parameters in the URL. I wasn't sure have to deal with them, and they must be infrequent enough that the current code should cover 90% of the cases. So, for the examples in the RFC, when doing a list-reply: List-Post: <mailto:list@xxxxxxxx> -> list@xxxxxxxx is added to To: List-Post: <mailto:moderator@xxxxxxxx> (Postings are Moderated) -> moderator@xxxxxxxx is added to To: List-Post: <mailto:moderator@xxxxxxxx?subject=list%20posting> -> moderator@xxxxxxxx is added to To:; Subject is unchanged (incomplete support) List-Post: NO (posting not allowed on this list) -> No change. Regards, Hugo -- Hugo Haas - http://larve.net/people/hugo/
diff --exclude muttrc.man -ur mutt-1.5.6/mutt.h mutt-1.5.6+HH/mutt.h --- mutt-1.5.6/mutt.h 2004-02-01 18:15:17.000000000 +0100 +++ mutt-1.5.6+HH/mutt.h 2004-07-18 11:43:15.000000000 +0200 @@ -550,6 +550,7 @@ char *supersedes; char *date; char *x_label; + ADDRESS *list_post; LIST *references; /* message references (in reverse order) */ LIST *in_reply_to; /* in-reply-to header content */ LIST *userhdrs; /* user defined headers */ diff --exclude muttrc.man -ur mutt-1.5.6/parse.c mutt-1.5.6+HH/parse.c --- mutt-1.5.6/parse.c 2003-11-05 10:41:33.000000000 +0100 +++ mutt-1.5.6+HH/parse.c 2004-07-18 11:57:37.000000000 +0200 @@ -23,6 +23,7 @@ #include "rfc2047.h" #include "rfc2231.h" #include "mutt_crypt.h" +#include "url.h" #include <string.h> #include <ctype.h> @@ -1064,6 +1065,35 @@ matched = 1; } + else if (!ascii_strcasecmp (line + 1, "ist-Post")) + { + /* See RFC 2369 */ + if (strcmp (p, "NO")) + { + char *tmp, *beg, *end; + if (!(beg = strchr (p, '<'))) + goto endlistpost; + if ((tmp = safe_strdup (beg + 1)) == NULL) + goto endlistpost; + + if (!(end = strchr (tmp, '>'))) + goto endlistpost; + *end = '\0'; + if (url_check_scheme (tmp) != U_MAILTO) + goto endlistpost; + if (!(beg = strchr (tmp, ':'))) + goto endlistpost; + if ((end = strchr (++beg, '?'))) + *end = '\0'; + /* FIXME: we've just discarded everything which was after the + question mark; how to take it into account? */ + url_pct_decode (beg); + e->list_post = rfc822_parse_adrlist (e->list_post, beg); + endlistpost: + FREE (&tmp); + } + matched = 1; + } break; case 'm': diff --exclude muttrc.man -ur mutt-1.5.6/send.c mutt-1.5.6+HH/send.c --- mutt-1.5.6/send.c 2004-02-01 18:10:58.000000000 +0100 +++ mutt-1.5.6+HH/send.c 2004-07-18 11:45:31.000000000 +0200 @@ -527,6 +527,10 @@ tmp = find_mailing_lists (in->to, in->cc); rfc822_append (&out->to, tmp); rfc822_free_address (&tmp); + if (in->list_post) + { + rfc822_append (&out->to, in->list_post); + } if (in->mail_followup_to && hmfupto == M_YES && default_to (&out->cc, in, flags & SENDLISTREPLY, hmfupto) == -1) diff --exclude muttrc.man -ur mutt-1.5.6/url.c mutt-1.5.6+HH/url.c --- mutt-1.5.6/url.c 2003-11-05 10:41:34.000000000 +0100 +++ mutt-1.5.6+HH/url.c 2004-07-18 11:54:06.000000000 +0200 @@ -40,7 +40,7 @@ }; -static void url_pct_decode (char *s) +void url_pct_decode (char *s) { char *d; diff --exclude muttrc.man -ur mutt-1.5.6/url.h mutt-1.5.6+HH/url.h --- mutt-1.5.6/url.h 2002-01-24 13:10:52.000000000 +0100 +++ mutt-1.5.6+HH/url.h 2004-07-18 11:50:52.000000000 +0200 @@ -27,6 +27,7 @@ ciss_url_t; url_scheme_t url_check_scheme (const char *s); +void url_pct_decode (char *s); int url_parse_file (char *d, const char *src, size_t dl); int url_parse_ciss (ciss_url_t *ciss, char *src); int url_ciss_tostring (ciss_url_t* ciss, char* dest, size_t len, int flags);
Attachment:
signature.asc
Description: Digital signature