summaryrefslogtreecommitdiff
path: root/imap-send.c
diff options
context:
space:
mode:
authorMarkus Amsler <markus.amsler@oribi.org>2006-10-12 22:19:35 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-10-18 10:34:46 (GMT)
commite0b0830726286287744cc9e1a629a534bbe75452 (patch)
treebe104733f5728bccf3a58dd4183dc05f28cffc0f /imap-send.c
parent17b96be29afd71577374e9deee663120b18eb8f1 (diff)
downloadgit-e0b0830726286287744cc9e1a629a534bbe75452.zip
git-e0b0830726286287744cc9e1a629a534bbe75452.tar.gz
git-e0b0830726286287744cc9e1a629a534bbe75452.tar.bz2
git-imap-send: Strip smtp From_ header from imap message.v1.4.3
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>
Diffstat (limited to 'imap-send.c')
-rw-r--r--imap-send.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/imap-send.c b/imap-send.c
index 362e474..16804ab 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;