diff -Naur slrn-0.9.7.2.orig/src/misc.h slrn-0.9.7.2/src/misc.h --- slrn-0.9.7.2.orig/src/misc.h Sat Jul 21 23:18:45 2001 +++ slrn-0.9.7.2/src/misc.h Thu Oct 18 10:33:29 2001 @@ -69,6 +69,7 @@ char *hostname; char *replyto; char *org; + char *user_agent; char *followup_string; char *reply_string; char *signature; diff -Naur slrn-0.9.7.2.orig/src/post.c slrn-0.9.7.2/src/post.c --- slrn-0.9.7.2.orig/src/post.c Mon Aug 20 18:12:18 2001 +++ slrn-0.9.7.2/src/post.c Thu Oct 18 10:33:34 2001 @@ -186,6 +186,20 @@ Slrn_Post_Obj->po_puts (buf); } +int file_has_sigdashes (FILE *file) +{ + int ret = 0; + char buf [256]; + + while (NULL != fgets (buf, sizeof(buf), file)) + { + if (0 != strcmp (buf, "-- \n")) ret = 1; + } + rewind (file); + + return ret; +} + void slrn_add_signature (FILE *fp) { FILE *sfp; @@ -209,12 +223,17 @@ fputs ("\n", fp); /* Apparantly some RFC suggests the -- \n. */ - fputs ("\n-- \n", fp); + if (! file_has_sigdashes (sfp) ) + fputs ("\n-- \n", fp); /* If signature file already has -- \n, do not add it. */ - if ((NULL != fgets (buf, sizeof (buf), sfp)) - && (0 != strcmp (buf, "-- \n"))) - fputs (buf, fp); + + /* It is already tested before (enable the sig. file to have + * something before the sigdashes + */ +/* if ((NULL != fgets (buf, sizeof (buf), sfp)) */ +/* && (0 != strcmp (buf, "-- \n"))) */ +/* fputs (buf, fp); */ while (NULL != fgets (buf, sizeof(buf), sfp)) { @@ -751,8 +770,14 @@ slrn_mime_add_headers (outfp); #endif system_os_name = slrn_get_os_name (); - fprintf (outfp, "User-Agent: slrn/%s (%s)\n", Slrn_Version, - system_os_name); + if ( (NULL != Slrn_User_Info.user_agent) && + (0 != Slrn_User_Info.user_agent[0])) { + fprintf (outfp, "User-Agent: %s\n", + Slrn_User_Info.user_agent); + } else { + fprintf (outfp, "User-Agent: slrn/%s (%s)\n", + Slrn_Version, system_os_name); + } header = 0; } else if (is_empty_header (line)) @@ -1137,8 +1162,16 @@ if (Slrn_Use_Mime & MIME_DISPLAY) slrn_mime_add_headers (0); /* 0 --> Slrn_Post_Obj->po_puts */ #endif - Slrn_Post_Obj->po_printf ("User-Agent: slrn/%s (%s)\n\n", - Slrn_Version, system_os_name); + if ( (NULL != Slrn_User_Info.user_agent) && + (0 != Slrn_User_Info.user_agent[0])) { + Slrn_Post_Obj->po_printf ("User-Agent: %s\n\n", + Slrn_User_Info.user_agent); + } else { + Slrn_Post_Obj->po_printf ("User-Agent: slrn/%s (%s)\n\n", + Slrn_Version, system_os_name); + } + + header = 0; #if SLRN_HAS_MIME if (Slrn_Use_Mime & MIME_DISPLAY) fp = slrn_mime_encode (fp); diff -Naur slrn-0.9.7.2.orig/src/startup.c slrn-0.9.7.2/src/startup.c --- slrn-0.9.7.2.orig/src/startup.c Thu Aug 16 11:45:54 2001 +++ slrn-0.9.7.2/src/startup.c Thu Oct 18 10:33:38 2001 @@ -637,6 +637,7 @@ {"quote_string", &Slrn_Quote_String}, {"replyto", &Slrn_User_Info.replyto}, {"organization", &Slrn_User_Info.org}, + {"user_agent", &Slrn_User_Info.user_agent}, {"followup", &Slrn_User_Info.followup_string}, /* FIXME: obsolete */ {"followup_string", &Slrn_User_Info.followup_string}, {"reply_string", &Slrn_User_Info.reply_string}, @@ -1178,6 +1179,7 @@ {"scorefile", &Slrn_Score_File, 0}, {"replyto", &Slrn_User_Info.replyto, 0}, {"organization", &Slrn_User_Info.org, 0}, + {"user_agent", &Slrn_User_Info.user_agent, 0}, {"followup", &Slrn_User_Info.followup_string, 0}, {"signature", &Slrn_User_Info.signature, 0}, {"cc_followup_string", &Slrn_CC_Followup_Message, 0},