#include "rfc2047.h"
#include "rfc2231.h"
#include "mutt_crypt.h"
+#include "url.h"
#include <string.h>
#include <ctype.h>
matched = 1;
}
+ else if (!ascii_strcasecmp (line + 1, "ist-Post"))
+ {
+ /* RFC 2369. FIXME: We should ignore whitespace, but don't. */
+ if (strncmp (p, "NO", 2))
+ {
+ char *beg, *end;
+ for (beg = strchr (p, '<'); beg; beg = strchr (end, ','))
+ {
+ ++beg;
+ if (!(end = strchr (beg, '>')))
+ break;
+
+ /* Take the first mailto URL */
+ if (url_check_scheme (beg) == U_MAILTO)
+ {
+ FREE (&e->list_post);
+ e->list_post = mutt_substrdup (beg, end);
+ break;
+ }
+ }
+ }
+ matched = 1;
+ }
break;
case 'm':
#include "mx.h"
#include "mutt_crypt.h"
#include "mutt_idna.h"
+#include "url.h"
#include <ctype.h>
#include <stdlib.h>
/* set the default subject for the message. */
mutt_make_string (buffer, sizeof (buffer), NONULL(ForwFmt), ctx, cur);
- env->subject = safe_strdup (buffer);
+ mutt_str_replace (&env->subject, buffer);
}
void mutt_make_misc_reply_headers (ENVELOPE *env, CONTEXT *ctx,
HEADER *cur, ENVELOPE *curenv)
{
+ /* This takes precedence over a subject that might have
+ * been taken from a List-Post header. Is that correct?
+ */
if (curenv->real_subj)
{
+ FREE (&env->subject);
env->subject = safe_malloc (mutt_strlen (curenv->real_subj) + 5);
sprintf (env->subject, "Re: %s", curenv->real_subj); /* __SPRINTF_CHECKED__ */
}
- else
+ else if (!env->subject)
env->subject = safe_strdup ("Re: your mail");
-
}
void mutt_add_to_reference_headers (ENVELOPE *env, ENVELOPE *curenv, LIST ***pp, LIST ***qq)
msg->env = mutt_new_envelope ();
}
+ /* Parse and use an eventual list-post header */
+ if ((flags & SENDLISTREPLY)
+ && cur && cur->env && cur->env->list_post)
+ {
+ /* Use any list-post header as a template */
+ url_parse_mailto (msg->env, NULL, cur->env->list_post);
+ /* We don't let them set the sender's address. */
+ rfc822_free_address (&msg->env->from);
+ }
+
if (! (flags & (SENDKEY | SENDPOSTPONED | SENDRESEND)))
{
pbody = mutt_new_body ();