More things to the Mime package.
[apps/madmutt.git] / lib-lua / madmutt.cpkg
index d083405..9c2dc05 100644 (file)
@@ -58,6 +58,12 @@ static char *madmutt_init_shorthost(void)
     return p_dupstr(utsname.nodename, p - utsname.nodename);
 }
 
+static char *madmutt_init_os(void)
+{
+    struct utsname un;
+    return m_strdup(uname(&un) < 0 ? "Unix" : un.sysname);
+}
+
 static char *madmutt_init_hostname(void)
 {
     char buffer[STRING];
@@ -137,6 +143,16 @@ static char *madmutt_init_hostname(void)
      */
     path_t shell          = madmutt_init_shell();
 
+    /*
+     ** .pp
+     ** This specifies the operating system name for the \fTUser-Agent:\fP header field. If
+     ** this is \fIunset\fP, it will be set to the operating system name that \fTuname(2)\fP
+     ** returns. If \fTuname(2)\fP fails, ``UNIX'' will be used.
+     ** .pp
+     ** It may, for example, look as: ``\fTMadmutt 1.5.9i (Linux)\fP''.
+     */
+    string_t operating_system = madmutt_init_os();
+
     path_t username       = madmutt_init_username();
     path_t homedir        = madmutt_init_homedir();