summaryrefslogtreecommitdiffstats
path: root/commands.c
diff options
context:
space:
mode:
authorRocco Rutte <pdmef@gmx.net>2009-06-12 13:43:01 +0200
committerRocco Rutte <pdmef@gmx.net>2009-06-12 13:43:01 +0200
commitc7387cb6ceab2da0041d640284a9684623e2fb0d (patch)
tree0b79afd7300f174c5f7fffe5ea27c8bc58714a70 /commands.c
parent13fc564ddb5154c7cfde437fbf25e206ffd62175 (diff)
Warn before bouncing messages without From: header. Closes #3180.
Diffstat (limited to 'commands.c')
-rw-r--r--commands.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/commands.c b/commands.c
index 9aa505e7..b9febd1d 100644
--- a/commands.c
+++ b/commands.c
@@ -246,6 +246,29 @@ void ci_bounce_message (HEADER *h, int *redraw)
char *err = NULL;
int rc;
+ /* RfC 5322 mandates a From: header, so warn before bouncing
+ * messages without one */
+ if (h)
+ {
+ if (!h->env->from)
+ {
+ mutt_error _("Warning: message has no From: header");
+ mutt_sleep (2);
+ }
+ }
+ else if (Context)
+ {
+ for (rc = 0; rc < Context->msgcount; rc++)
+ {
+ if (Context->hdrs[rc]->tagged && !Context->hdrs[rc]->env->from)
+ {
+ mutt_error ("Warning: message has no From: header");
+ mutt_sleep (2);
+ break;
+ }
+ }
+ }
+
if(h)
strfcpy(prompt, _("Bounce message to: "), sizeof(prompt));
else