Users don't know what they are doing most of the timeā€¦
[apps/madmutt.git] / sendlib.c
index 669140d..a81949c 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -10,7 +10,6 @@
 #include <lib-lib/lib-lib.h>
 
 #include <signal.h>
-#include <sys/utsname.h>
 
 #include <lib-lua/lib-lua.h>
 #include <lib-sys/exit.h>
 #include "pager.h"
 #include "charset.h"
 #include "mutt_idna.h"
-
-#ifdef USE_LIBESMTP
-# include "mutt_libesmtp.h"
-#endif /* USE_LIBESMTP */
+#include "mutt_libesmtp.h"
 
 #ifdef USE_NNTP
 #include <nntp/nntp.h>
@@ -1498,16 +1494,12 @@ int mutt_write_rfc822_header (FILE * fp, ENVELOPE * env, BODY * attach,
   }
 
   if (mode == 0 && !privacy && option (OPTXMAILER) && !has_agent) {
-    const char *os;
-
-    if (OperatingSystem != NULL) {
-      os = OperatingSystem;
+    if (MCore.operating_system) {
+      fprintf(fp, "User-Agent: %s (%s)\n", mutt_make_version(),
+              MCore.operating_system);
     } else {
-      struct utsname un;
-      os = (uname(&un) == -1) ? "UNIX" : un.sysname;
+      fprintf(fp, "User-Agent: %s\n", mutt_make_version());
     }
-    /* Add a vanity header */
-    fprintf (fp, "User-Agent: %s (%s)\n", mutt_make_version(), os);
   }
 
   return (ferror (fp) == 0 ? 0 : -1);
@@ -1539,22 +1531,22 @@ static void encode_headers (string_list_t * h)
   }
 }
 
-const char *mutt_fqdn (short may_hide_host)
+const char *mutt_fqdn(short may_hide_host)
 {
   char *p = NULL, *q;
 
-  if (Fqdn && Fqdn[0] != '@') {
-    p = Fqdn;
+  if (MCore.hostname && MCore.hostname[0] != '@') {
+    p = MCore.hostname;
 
     if (may_hide_host && option (OPTHIDDENHOST)) {
-      if ((p = strchr (Fqdn, '.')))
+      if ((p = strchr(MCore.hostname, '.')))
         p++;
 
       /* sanity check: don't hide the host if
          the fqdn is something like detebe.org.  */
 
-      if (!p || !(q = strchr (p, '.')))
-        p = Fqdn;
+      if (!p || !(q = strchr(p, '.')))
+        p = MCore.hostname;
     }
   }
 
@@ -1657,7 +1649,7 @@ static char *mutt_gen_msgid (void)
     const char *fqdn;
 
     if (!(fqdn = mutt_fqdn(0)))
-        fqdn = NONULL(Hostname);
+        fqdn = NONULL(MCore.shorthost);
 
     mutt_gen_localpart(localpart, sizeof(localpart), MsgIdFormat);
     snprintf(buf, sizeof(buf), "<%s@%s>", localpart, fqdn);
@@ -1985,12 +1977,7 @@ void mutt_prepare_envelope (ENVELOPE * env, int final)
   rfc2047_encode_adrlist(env->reply_to, "Reply-To");
 
   if (env->subject)
-#ifdef USE_NNTP
-    if (!option (OPTNEWSSEND) || option (OPTMIMESUBJECT))
-#endif
-    {
-      rfc2047_encode_string (&env->subject);
-    }
+    rfc2047_encode_string (&env->subject);
   encode_headers (env->userhdrs);
 }