git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-imap-send: Strip smtp From_ header from imap message.
@ 2006-10-12 22:19 Markus Amsler
  2006-10-18  6:04 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Markus Amsler @ 2006-10-12 22:19 UTC (permalink / raw)
  To: git; +Cc: Mike McCormack

Cyrus imap refuses messages with a 'From ' Header.

Signed-off-by: Markus Amsler <markus.amsler@oribi.org>

---
   imap-send.c |    8 ++++++++
   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_dat
  	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;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] git-imap-send: Strip smtp From_ header from imap message.
  2006-10-12 22:19 [PATCH] git-imap-send: Strip smtp From_ header from imap message Markus Amsler
@ 2006-10-18  6:04 ` Junio C Hamano
  2006-10-18  8:53   ` Markus Amsler
  2006-10-18 19:02   ` Mike McCormack
  0 siblings, 2 replies; 6+ messages in thread
From: Junio C Hamano @ 2006-10-18  6:04 UTC (permalink / raw)
  To: Markus Amsler; +Cc: git, Mike McCormack

Markus Amsler <markus.amsler@oribi.org> writes:

> Cyrus imap refuses messages with a 'From ' Header.
>
> Signed-off-by: Markus Amsler <markus.amsler@oribi.org>

Do you know if this change does not upset other implementations
of imap servers?

Mike, are you Ok with this change?

---
  imap-send.c |    8 ++++++++
  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_dat
 	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;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] git-imap-send: Strip smtp From_ header from imap message.
  2006-10-18  6:04 ` Junio C Hamano
@ 2006-10-18  8:53   ` Markus Amsler
  2006-10-18 19:02   ` Mike McCormack
  1 sibling, 0 replies; 6+ messages in thread
From: Markus Amsler @ 2006-10-18  8:53 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Mike McCormack

Junio C Hamano wrote:
> Markus Amsler <markus.amsler@oribi.org> writes:
> 
>> Cyrus imap refuses messages with a 'From ' Header.
>>
>> Signed-off-by: Markus Amsler <markus.amsler@oribi.org>
> 
> Do you know if this change does not upset other implementations
> of imap servers?
I only tested it with cyrus 2.1.18 on debian. I did some research: The 
From_ header field was introduced in rfc976 which only affects UUCP(Unix 
to Unix CoPy). I assume it's an invalid header field in SMTP/IMAP, and 
most implementation ignores it.
I'm no mail header guru, so I could be wrong

Markus
> 
> Mike, are you Ok with this change?
> 
> ---
>   imap-send.c |    8 ++++++++
>   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_dat
>  	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;
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] git-imap-send: Strip smtp From_ header from imap message.
  2006-10-18 19:02   ` Mike McCormack
@ 2006-10-18 10:28     ` Junio C Hamano
  2006-10-18 11:54       ` Markus Amsler
  0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2006-10-18 10:28 UTC (permalink / raw)
  To: Mike McCormack; +Cc: git, Markus Amsler

Mike McCormack <mike@codeweavers.com> writes:

> Junio C Hamano wrote:
>> Markus Amsler <markus.amsler@oribi.org> writes:
>>
>>> Cyrus imap refuses messages with a 'From ' Header.
>>>
>>> Signed-off-by: Markus Amsler <markus.amsler@oribi.org>
>>
>> Do you know if this change does not upset other implementations
>> of imap servers?
>>
>> Mike, are you Ok with this change?
>
> Works for me with Courier IMAP.  I'm no expert on mail headers either,
> so no objections from me.
>
> Mike

Thanks; then will apply.

By the way, Markus, did you send the patch with imap-send?  It
had a funny whitespace corruptions.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] git-imap-send: Strip smtp From_ header from imap message.
  2006-10-18 10:28     ` Junio C Hamano
@ 2006-10-18 11:54       ` Markus Amsler
  0 siblings, 0 replies; 6+ messages in thread
From: Markus Amsler @ 2006-10-18 11:54 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Mike McCormack, git

Junio C Hamano wrote:
> Mike McCormack <mike@codeweavers.com> writes:
> 
>> Junio C Hamano wrote:
>>> Markus Amsler <markus.amsler@oribi.org> writes:
>>>
>>>> Cyrus imap refuses messages with a 'From ' Header.
>>>>
>>>> Signed-off-by: Markus Amsler <markus.amsler@oribi.org>
>>> Do you know if this change does not upset other implementations
>>> of imap servers?
>>>
>>> Mike, are you Ok with this change?
>> Works for me with Courier IMAP.  I'm no expert on mail headers either,
>> so no objections from me.
>>
>> Mike
> 
> Thanks; then will apply.
> 
> By the way, Markus, did you send the patch with imap-send?  It
> had a funny whitespace corruptions.
No, I was too lazy to set up an imap config for one patch. So I used git 
diff an copy pasted it into Thunderbird. Sorry.

Markus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] git-imap-send: Strip smtp From_ header from imap message.
  2006-10-18  6:04 ` Junio C Hamano
  2006-10-18  8:53   ` Markus Amsler
@ 2006-10-18 19:02   ` Mike McCormack
  2006-10-18 10:28     ` Junio C Hamano
  1 sibling, 1 reply; 6+ messages in thread
From: Mike McCormack @ 2006-10-18 19:02 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Markus Amsler, git


Junio C Hamano wrote:
> Markus Amsler <markus.amsler@oribi.org> writes:
> 
>> Cyrus imap refuses messages with a 'From ' Header.
>>
>> Signed-off-by: Markus Amsler <markus.amsler@oribi.org>
> 
> Do you know if this change does not upset other implementations
> of imap servers?
> 
> Mike, are you Ok with this change?

Works for me with Courier IMAP.  I'm no expert on mail headers either, 
so no objections from me.

Mike

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-10-18 12:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-12 22:19 [PATCH] git-imap-send: Strip smtp From_ header from imap message Markus Amsler
2006-10-18  6:04 ` Junio C Hamano
2006-10-18  8:53   ` Markus Amsler
2006-10-18 19:02   ` Mike McCormack
2006-10-18 10:28     ` Junio C Hamano
2006-10-18 11:54       ` Markus Amsler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).