You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rian Hunter <ri...@MIT.EDU> on 2006/01/17 22:43:07 UTC

Header Handling in mod_smtpd

Hi,

I just wanted to poll dev on how mod_smtpd should handle mail headers  
after receiving the data command.

Currently mod_smtpd parsers headers if there are any, then when that  
is done sends the body to the message buffering loop. A message  
usually looks like this:

---begin_rfc822_message---
From: Rian Hunter <ri...@mit.edu>
To: Rian Hunter <ri...@mit.edu>
Subject: Testing.

Hi this is the body of the message.
---end---

mod_smtpd saves:

---begin body---

Hi this is the body of the message.
---end---

when normal mail clients usually show the body like this:

---begin body---
Hi This is the body of the message.
---end---

Does it seem like a good idea to save the extra line-break as the  
beginning of the body or remove it before letting the plugins deal  
with the body. Keep in mind that the reason it is like this now is to  
keep the loop simple so it can also handle header-less messages (the  
parser eats the bad data). Thanks!

Rian Hunter

Re: Header Handling in mod_smtpd

Posted by Maxime Petazzoni <ma...@bulix.org>.
Hi,

* Rian Hunter <ri...@MIT.EDU> [2006-01-17 16:43:07]:

> I just wanted to poll dev on how mod_smtpd should handle mail headers  
> after receiving the data command.
> 

[snip]

> 
> Does it seem like a good idea to save the extra line-break as the  
> beginning of the body or remove it before letting the plugins deal  
> with the body. Keep in mind that the reason it is like this now is to  
> keep the loop simple so it can also handle header-less messages (the  
> parser eats the bad data). Thanks!

The empty line is part of the mail general structure, used to split
the headers from the mail body. If you stick to this definition, the
mail body does not include this line.

IMHO, mod_smtpd should not save it and eventually put it back if it
has to join the headers and the body together later.

My 2 ยข,
- Sam
-- 
Maxime Petazzoni (http://www.bulix.org)
 -- gone crazy, back soon. leave message.