* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*/
+#if HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include "mutt.h"
#include "mutt_curses.h"
#include "rfc2047.h"
#include "mx.h"
#include "mutt_crypt.h"
#include "mutt_idna.h"
+#include "url.h"
#include <ctype.h>
#include <stdlib.h>
FILE *tmpfp;
pid_t thepid;
+ if (SignOffString) {
+ fprintf(f,"\n%s",SignOffString);
+ }
+
if (Signature && (tmpfp = mutt_open_read (Signature, &thepid)))
{
if (option (OPTSIGDASHES))
fputs ("\n-- \n", f);
+ else if (SignOffString)
+ fputs("\n",f);
mutt_copy_stream (tmpfp, f);
fclose (tmpfp);
if (thepid != -1)
static int include_reply (CONTEXT *ctx, HEADER *cur, FILE *out)
{
- int cmflags = M_CM_PREFIX | M_CM_DECODE | M_CM_CHARCONV;
+ int cmflags = M_CM_PREFIX | M_CM_DECODE | M_CM_CHARCONV | M_CM_REPLYING;
int chflags = CH_DECODE;
if (WithCrypto && (cur->security & ENCRYPT))
/* 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");
#ifdef USE_NNTP
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 ();
msg->security |= SIGN;
if (option (OPTCRYPTREPLYSIGNENCRYPTED) && cur && (cur->security & ENCRYPT))
msg->security |= SIGN;
- }
+ if (WithCrypto & APPLICATION_PGP && (msg->security & (ENCRYPT | SIGN)))
+ {
+ if (option (OPTPGPAUTOINLINE))
+ msg->security |= INLINE;
+ if (option (OPTPGPREPLYINLINE) && cur && (cur->security & INLINE))
+ msg->security |= INLINE;
+ }
+ }
if (WithCrypto && msg->security)
{
if (!(msg->security & (APPLICATION_SMIME|APPLICATION_PGP)))
msg->security = 0;
}
+
+ /*
+ * This hook is even called for postponed messages, and can, e.g., be
+ * used for setting the editor, the sendmail path, or the
+ * envelope sender.
+ */
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
+
/* wait until now to set the real name portion of our return address so
that $realname can be set in a send-hook */
if (msg->env->from && !msg->env->from->personal
}
else
mutt_edit_file (Editor, msg->content->filename);
+
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
}
if (! (flags & (SENDPOSTPONED | SENDFORWARD | SENDKEY | SENDRESEND)))
clear_content = msg->content;
if ((crypt_get_keys (msg, &pgpkeylist) == -1) ||
- mutt_protect (msg, cur, pgpkeylist) == -1)
+ mutt_protect (msg, pgpkeylist) == -1)
{
msg->content = mutt_remove_multipart (msg->content);
/* this means writing only the main part */
msg->content = clear_content->parts;
- if (mutt_protect (msg, cur, pgpkeylist) == -1)
+ if (mutt_protect (msg, pgpkeylist) == -1)
{
/* we can't do much about it at this point, so
* fallback to saving the whole thing to fcc