tag 487019 +patch
thanks

Nis, Joey, could you please test whether the attached patch fixes the
character conversion issue in #465484 and #487019 for you? Please make
sure that the `ttycharset' variable is _not_ set in /etc/nail.rc.

Thanks
-Hilko

diff --git a/sendout.c b/sendout.c
index 5661bb9..96b33b6 100644
--- a/sendout.c
+++ b/sendout.c
@@ -50,6 +50,7 @@ static char sccsid[] = "@(#)sendout.c	2.95 (gritter) 6/16/07";
 #include <unistd.h>
 #include <time.h>
 #include "md5.h"
+#include <locale.h>
 
 /*
  * Mail -- a mail program
@@ -1002,13 +1003,24 @@ try:	if ((nmtf = infix(hp, mtf, dosign)) == NULL) {
 			goto loop;
 		}
 		/* fprintf(stderr, ". . . message lost, sorry.\n"); */
-		perror("");
-	fail:	senderr++;
-		rewind(mtf);
-		savedeadletter(mtf);
-		fputs(catgets(catd, CATSET, 187,
-				". . . message not sent.\n"), stderr);
-		return STOP;
+	fail:	if ((errno == EILSEQ || errno == EINVAL) &&
+		    (strcmp(setlocale(LC_CTYPE, NULL), "C") == 0)) {
+			/* 
+			 * We don't care about failed character map
+			 * conversion attempts if the character class
+			 * is set to the standard ("C") locale.
+			 */
+			rewind(mtf);
+			nmtf = mtf;
+		} else {
+			perror("");
+			senderr++;
+			rewind(mtf);
+			savedeadletter(mtf);
+			fputs(catgets(catd, CATSET, 187,
+				      ". . . message not sent.\n"), stderr);
+			return STOP;
+		}
 	}
 	mtf = nmtf;
 	if (dosign) {

Reply via email to