summaryrefslogtreecommitdiffstats
path: root/remailer.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1999-01-13 08:35:16 +0000
committerThomas Roessler <roessler@does-not-exist.org>1999-01-13 08:35:16 +0000
commit80223e6160f487d793a7de7a5200520953fd4e60 (patch)
tree0f824bfc8689e28335a259ee90a742550147c3a9 /remailer.c
parent3073846bcf53bfae27ce3f3e829250d6c5f50d05 (diff)
Qualify addresses before passing them to mixmaster.
Diffstat (limited to 'remailer.c')
-rw-r--r--remailer.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/remailer.c b/remailer.c
index f216b9ae..ac2ad9cd 100644
--- a/remailer.c
+++ b/remailer.c
@@ -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;
}