From: Markus Amsler Date: Thu, 12 Oct 2006 22:19:35 +0000 (+0200) Subject: git-imap-send: Strip smtp From_ header from imap message. X-Git-Tag: v1.4.3^0 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e0b0830726286287744cc9e1a629a534bbe75452;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/imap-send.c b/imap-send.c index 362e47437..16804ab28 100644 --- a/imap-send.c +++ b/imap-send.c @@ -1226,6 +1226,14 @@ split_msg( msg_data_t *all_msgs, msg_data_t *msg, int *ofs ) if (msg->len < 5 || strncmp( data, "From ", 5 )) return 0; + p = strchr( data, '\n' ); + if (p) { + p = &p[1]; + msg->len -= p-data; + *ofs += p-data; + data = p; + } + p = strstr( data, "\nFrom " ); if (p) msg->len = &p[1] - data;