flashmob / go-guerrilla

Mini SMTP server written in golang
MIT License
2.79k stars 366 forks source link

Header detection & MIME content aware Reader for the DATA command #130

Closed flashmob closed 5 years ago

flashmob commented 5 years ago

We can scan for the header boundary as we receive the emails in the DATA command state, saving the position of the header boundary for later processing, and/or parse as we go along. At present, the data is re-scanned at the end of the transaction.

Additionally, once we have the header, we could could have a MIME aware reader, that can read in chunks and is aware about content boundaries, getting us closer to addressing issue #84

iwex commented 5 years ago

Hi, I have some problem with headers. Should I start new Issue?

DEBU[0001] Client sent: DATA
DEBU[0001] Writing response to client: 54 Enter message, ending with '.' on a line by itself
ERRO[0001] parse headers error error=EOF

I tested it with swaks -f me@example.org -t test@example.com --server 127.0.0.1:2525

flashmob commented 5 years ago

Hi there. Yes, you can report an issue and include sample input that triggered the error please.

On Fri., 8 Mar. 2019, 02:48 Serhii Chaplia, notifications@github.com wrote:

DEBU[0001] Client sent: DATA DEBU[0001] Writing response to client: 54 Enter message, ending with '.' on a line by itself ERRO[0001] parse headers error error=EOF

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/flashmob/go-guerrilla/issues/130#issuecomment-470578931, or mute the thread https://github.com/notifications/unsubscribe-auth/AAnmP4T1kQsduZ2Oz4jwvbuB6YS-3-Qqks5vUTTMgaJpZM4ZyS78 .

flashmob commented 5 years ago

Fixed in #142