Skip to content

Commit

Permalink
git-imap-send: Strip smtp From_ header from imap message.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Markus Amsler authored and Junio C Hamano committed Oct 18, 2006
1 parent 17b96be commit e0b0830
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions imap-send.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e0b0830

Please sign in to comment.