]> granicus.if.org Git - neomutt/commitdiff
Qualify addresses before passing them to mixmaster.
authorThomas Roessler <roessler@does-not-exist.org>
Wed, 13 Jan 1999 08:35:16 +0000 (08:35 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Wed, 13 Jan 1999 08:35:16 +0000 (08:35 +0000)
compose.c
remailer.c
send.c

index 1aacf75948768f4da780568c80f35d4521fe435f..4aa5bdf939da039328bb9fcfc5495ea59bd3aab8 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -824,7 +824,7 @@ int mutt_compose_menu (HEADER *msg,   /* structure for new message */
 
       
 #ifdef MIXMASTER
-        if (mix_check_message (msg) != 0)
+        if (msg->chain && mix_check_message (msg) != 0)
          break;
 #endif
       
index f216b9ae1a347e6b68bfe9afb3846ca92b3566ab..ac2ad9cd6314d89d9047ecaf369bf41f079fa286 100644 (file)
@@ -638,14 +638,48 @@ void mix_make_chain (LIST **chainp, int *redraw)
   safe_free ((void **) &chain);
 }
 
+/* some safety checks before piping the message to mixmaster */
+
 int mix_check_message (HEADER *msg)
 {
+  const char *fqdn;
+  short need_hostname = 0;
+  ADDRESS *p;
+  
   if (msg->env->cc || msg->env->bcc)
   {
     mutt_error _("Mixmaster doesn't accept Cc or Bcc headers.");
     return -1;
   }
+
+  /* When using mixmaster, we MUST qualify any addresses since
+   * the message will be delivered through remote systems.
+   * 
+   * use_domain won't be respected at this point, hidden_host will.
+   */
+
+  for (p = msg->env->to; p; p = p->next)
+  {
+    if (!p->group && strchr (p->mailbox, '@') == NULL)
+    {
+      need_hostname = 1;
+      break;
+    }
+  }
+    
+  if (need_hostname)
+  {
+    
+    if (!(fqdn = mutt_fqdn (1)))
+    {
+      mutt_error _("Please set the hostname variable to a proper value when using mixmaster!");
+      return (-1);
+    }
   
+    /* Cc and Bcc are empty at this point. */
+    rfc822_qualify (msg->env->to, fqdn);
+  }
+
   return 0;
 }
 
diff --git a/send.c b/send.c
index 592dd361bbcd1a097c6134209c385cc8bd3e3260..478b5e624931599ea6bf756f3cbe8f6719fb93c9 100644 (file)
--- a/send.c
+++ b/send.c
@@ -796,7 +796,7 @@ static int send_message (HEADER *msg)
   char tempfile[_POSIX_PATH_MAX];
   FILE *tempfp;
   int i;
-
+  
   /* Write out the message in MIME form. */
   mutt_mktemp (tempfile);
   if ((tempfp = safe_fopen (tempfile, "w")) == NULL)