Andreas Krennmair:
[apps/madmutt.git] / sendlib.c
index 8128089..7a718a2 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -40,6 +40,7 @@
 #include <signal.h>
 #include <sys/wait.h>
 #include <fcntl.h>
+#include <sys/utsname.h>
 
 #ifdef USE_NNTP
 #include <nntp.h>
@@ -1736,10 +1737,30 @@ int mutt_write_rfc822_header (FILE *fp, ENVELOPE *env, BODY *attach,
     }
   }
 
+  /* Add X-Face headers */
+  if (env->x_face)
+  {
+    LIST *face;
+
+    for (face = env->x_face; face; face = face->next)
+      fprintf (fp, "X-Face: %s\n", face->data);
+  }
+
   if (mode == 0 && !privacy && option (OPTXMAILER) && !has_agent)
   {
+    struct utsname un;
+    char * os;
+    if (OperatingSystem!=NULL) {
+      os = OperatingSystem;
+    } else {
+      if (uname(&un)==-1) {
+        os = "UNIX";
+      } else {
+        os = un.sysname;
+      }
+    }
     /* Add a vanity header */
-    fprintf (fp, "User-Agent: Mutt/%s\n", MUTT_VERSION);
+    fprintf (fp, "User-Agent: mutt-ng %s (%s)\n", MUTT_VERSION,os);
   }
 
   return (ferror (fp) == 0 ? 0 : -1);