Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Leading dots are not transformed when reading in Data state #42

Closed
flashmob opened this issue Jan 18, 2017 · 0 comments
Closed

Bug: Leading dots are not transformed when reading in Data state #42

flashmob opened this issue Jan 18, 2017 · 0 comments
Assignees
Labels

Comments

@flashmob
Copy link
Owner

flashmob commented Jan 18, 2017

SMTP spec uses dot stuffing when reading in after the DATA command. However, the current server implements it incorrectly where it doesn't remove a dot if a line with text starts with a dot.

To fix:

Will switch to using go's standard package textproto, using the DotReader.

Additionally, this is an opportunity to change Envelope.Data to a bytes.Buffer, so that the buffer can be re-used after it is placed back in the pool.

The textproto package could also be used for header parsing too.

@flashmob flashmob self-assigned this Jan 18, 2017
@flashmob flashmob added the bug label Jan 18, 2017
flashmob added a commit that referenced this issue Jan 18, 2017
Uses textproto package to read dot-stuffed data

Other changes:

- Envelope.Data is now a bytes buffer, that gets reset when borrowed form pool
- Moved header parsing to envelope & using textproto for reading headers
- adds shutdown state to backend + Reinitialize to backend proxy
- add test for DATA command
@flashmob flashmob mentioned this issue Jan 18, 2017
flashmob added a commit that referenced this issue Jan 19, 2017
* fixes #42  
* Uses textproto package to read dot-stuffed data in DATA state
* envelope.Data is now a buffer
* backend to use data (compress, etc)
* Moved subject parsing to envelope package & using textproto for reading headers


Other changes:

* guerrilla redis & db backend: user a sync.Pool for buffers used for compressing
* adds shutdown state to backend + Reinitialize to backend proxy
@flashmob flashmob mentioned this issue Jan 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant