aboutsummaryrefslogtreecommitdiff
path: root/src/compose.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-11-28 05:43:35 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-11-28 05:43:35 +0000
commit928a2cc8708a85a7fbcceb4d77e163835b158934 (patch)
tree57697350a6f0be8c96d4f2181e22312cb6cb1acd /src/compose.c
parent064a7b172123d65c3bafa35d60ce2c550f30b1ec (diff)
reverted linebreak conversion.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@783 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/compose.c')
-rw-r--r--src/compose.c65
1 files changed, 34 insertions, 31 deletions
diff --git a/src/compose.c b/src/compose.c
index 1ecd8603..0e35f5ca 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -3013,14 +3013,19 @@ static gint compose_write_to_file(Compose *compose, const gchar *file,
return -1;
}
- if (canonicalize_file_replace(file) < 0) {
- g_unlink(file);
- return -1;
- }
-
#if USE_GPGME
- if (!rfc2015_is_available() || is_draft)
+ if (!rfc2015_is_available() || is_draft) {
+ uncanonicalize_file_replace(file);
return 0;
+ }
+
+ if ((compose->use_signing && !compose->account->clearsign) ||
+ compose->use_encryption) {
+ if (canonicalize_file_replace(file) < 0) {
+ g_unlink(file);
+ return -1;
+ }
+ }
if (compose->use_signing && !compose->account->clearsign) {
GSList *key_list;
@@ -3040,6 +3045,8 @@ static gint compose_write_to_file(Compose *compose, const gchar *file,
}
#endif /* USE_GPGME */
+ uncanonicalize_file_replace(file);
+
return 0;
}
@@ -3177,10 +3184,6 @@ static gint compose_redirect_write_to_file(Compose *compose, const gchar *file)
g_unlink(file);
return -1;
}
- if (canonicalize_file_replace(file) < 0) {
- g_unlink(file);
- return -1;
- }
return 0;
error:
@@ -3250,40 +3253,40 @@ static gint compose_queue(Compose *compose, const gchar *file)
}
/* queueing variables */
- fprintf(fp, "AF:\r\n");
- fprintf(fp, "NF:0\r\n");
- fprintf(fp, "PS:10\r\n");
- fprintf(fp, "SRH:1\r\n");
- fprintf(fp, "SFN:\r\n");
- fprintf(fp, "DSR:\r\n");
+ fprintf(fp, "AF:\n");
+ fprintf(fp, "NF:0\n");
+ fprintf(fp, "PS:10\n");
+ fprintf(fp, "SRH:1\n");
+ fprintf(fp, "SFN:\n");
+ fprintf(fp, "DSR:\n");
if (compose->msgid)
- fprintf(fp, "MID:<%s>\r\n", compose->msgid);
+ fprintf(fp, "MID:<%s>\n", compose->msgid);
else
- fprintf(fp, "MID:\r\n");
- fprintf(fp, "CFG:\r\n");
- fprintf(fp, "PT:0\r\n");
- fprintf(fp, "S:%s\r\n", compose->account->address);
- fprintf(fp, "RQ:\r\n");
+ fprintf(fp, "MID:\n");
+ fprintf(fp, "CFG:\n");
+ fprintf(fp, "PT:0\n");
+ fprintf(fp, "S:%s\n", compose->account->address);
+ fprintf(fp, "RQ:\n");
if (compose->account->smtp_server)
- fprintf(fp, "SSV:%s\r\n", compose->account->smtp_server);
+ fprintf(fp, "SSV:%s\n", compose->account->smtp_server);
else
- fprintf(fp, "SSV:\r\n");
+ fprintf(fp, "SSV:\n");
if (compose->account->nntp_server)
- fprintf(fp, "NSV:%s\r\n", compose->account->nntp_server);
+ fprintf(fp, "NSV:%s\n", compose->account->nntp_server);
else
- fprintf(fp, "NSV:\r\n");
- fprintf(fp, "SSH:\r\n");
+ fprintf(fp, "NSV:\n");
+ fprintf(fp, "SSH:\n");
if (compose->to_list) {
fprintf(fp, "R:<%s>", (gchar *)compose->to_list->data);
for (cur = compose->to_list->next; cur != NULL;
cur = cur->next)
fprintf(fp, ",<%s>", (gchar *)cur->data);
- fprintf(fp, "\r\n");
+ fprintf(fp, "\n");
} else
- fprintf(fp, "R:\r\n");
+ fprintf(fp, "R:\n");
/* Sylpheed account ID */
- fprintf(fp, "AID:%d\r\n", compose->account->account_id);
- fprintf(fp, "\r\n");
+ fprintf(fp, "AID:%d\n", compose->account->account_id);
+ fprintf(fp, "\n");
while (fgets(buf, sizeof(buf), src_fp) != NULL) {
if (fputs(buf, fp) == EOF) {