Skip to content

Commit e0b0830

Browse files
amslerJunio C Hamano
authored andcommitted
git-imap-send: Strip smtp From_ header from imap message.
Cyrus imap refuses messages with a 'From ' Header. [jc: Mike McCormack says this is fine with Courier as well.] Signed-off-by: Markus Amsler <markus.amsler@oribi.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 17b96be commit e0b0830

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

imap-send.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,14 @@ split_msg( msg_data_t *all_msgs, msg_data_t *msg, int *ofs )
12261226
if (msg->len < 5 || strncmp( data, "From ", 5 ))
12271227
return 0;
12281228

1229+
p = strchr( data, '\n' );
1230+
if (p) {
1231+
p = &p[1];
1232+
msg->len -= p-data;
1233+
*ofs += p-data;
1234+
data = p;
1235+
}
1236+
12291237
p = strstr( data, "\nFrom " );
12301238
if (p)
12311239
msg->len = &p[1] - data;

0 commit comments

Comments
 (0)