[Commits] [SCM] claws branch, master, updated. 4.3.0-28-g0c6385ef2

paul at claws-mail.org paul at claws-mail.org
Tue Aug 13 16:55:20 UTC 2024


The branch, master has been updated
       via  0c6385ef2b989fa26d2e17cdcdb71d305092572e (commit)
      from  2319aaaf6f28c88c2d04a2b1afd8366363dfc73b (commit)

Summary of changes:
 src/compose.c | 29 +++++++++--------------------
 1 file changed, 9 insertions(+), 20 deletions(-)


- Log -----------------------------------------------------------------
commit 0c6385ef2b989fa26d2e17cdcdb71d305092572e
Author: Paul <paul at claws-mail.org>
Date:   Tue Aug 13 17:55:16 2024 +0100

    always avoid exceeding 998 byte line length limit
    
    when Content-Transfer-Encoding is set to 'automatic' or '8bit' and the 998 byte line length limited is exceeded, don't ask user to send it as-is or cancel, instead use quoted-printable

diff --git a/src/compose.c b/src/compose.c
index 9953207ad..3d73f2197 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -5851,6 +5851,15 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action, gbool
 	}
 	g_free(chars);
 
+	/* check for line length limit */
+	if (action == COMPOSE_WRITE_FOR_SEND &&
+	    encoding != ENC_QUOTED_PRINTABLE && encoding != ENC_BASE64 &&
+	    check_line_length(buf, 1000, &line) < 0) {
+		debug_print("Line %d exceeds the line length limit (998 bytes), "
+			    "switching to QP transfer encoding\n", line + 1);
+		encoding = ENC_QUOTED_PRINTABLE;
+	}
+	
 	if (prefs_common.rewrite_first_from && (encoding == ENC_8BIT || encoding == ENC_7BIT)) {
 		if (!strncmp(buf, "From ", sizeof("From ")-1) ||
 		    strstr(buf, "\nFrom ") != NULL) {
@@ -5878,26 +5887,6 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action, gbool
 	debug_print("main text: %" G_GSIZE_FORMAT " bytes encoded as %s in %d\n",
 		strlen(buf), out_codeset, encoding);
 
-	/* check for line length limit */
-	if (action == COMPOSE_WRITE_FOR_SEND &&
-	    encoding != ENC_QUOTED_PRINTABLE && encoding != ENC_BASE64 &&
-	    check_line_length(buf, 1000, &line) < 0) {
-		AlertValue aval;
-
-		msg = g_strdup_printf
-			(_("Line %d exceeds the line length limit (998 bytes).\n"
-			   "The contents of the message might be broken on the way to the delivery.\n"
-			   "\n"
-			   "Send it anyway?"), line + 1);
-		aval = alertpanel(_("Warning"), msg, NULL, _("_Cancel"), NULL, _("_OK"),
-				  NULL, NULL, ALERTFOCUS_FIRST);
-		g_free(msg);
-		if (aval != G_ALERTALTERNATE) {
-			g_free(buf);
-			return COMPOSE_QUEUE_ERROR_NO_MSG;
-		}
-	}
-	
 	if (encoding != ENC_UNKNOWN)
 		procmime_encode_content(mimetext, encoding);
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list