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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle empty EHLO and HELO commands #112

Merged
merged 2 commits into from Nov 8, 2016
Merged

Conversation

toxinu
Copy link
Contributor

@toxinu toxinu commented Nov 8, 2016

Related to #111.
I also add tests.

Feedbacks are welcome! 馃槃

@coveralls
Copy link

coveralls commented Nov 8, 2016

Coverage Status

Coverage decreased (-0.02%) to 93.594% when pulling 6845bb1 on oasiswork:fix-empty-ehlo into 62cb6cd on slimta:master.

Copy link
Member

@icgood icgood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests look great, just requested a minor tweak on implementation and then you're good to go.

ehlo_as = ehlo_as.decode('utf-8')
reply = Reply('250', 'Hello '+ehlo_as)
reply.enhanced_status_code = False
self._call_custom_handler('EHLO', reply, ehlo_as)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd rather see this implemented as if/elif clauses at the top of the handlers, e.g.

if not self.bannered:
    bad_sequence.send(self.io)
    return
elif not ehlo_as:
    bad_arguments.send(self.io)
    return

@toxinu
Copy link
Contributor Author

toxinu commented Nov 8, 2016

Do you want that I rewrite git history in order to melt commits before merging?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 93.487% when pulling 2a10ef4 on oasiswork:fix-empty-ehlo into 62cb6cd on slimta:master.

@coveralls
Copy link

coveralls commented Nov 8, 2016

Coverage Status

Coverage increased (+0.04%) to 93.653% when pulling 2a10ef4 on oasiswork:fix-empty-ehlo into 62cb6cd on slimta:master.

Copy link
Member

@icgood icgood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to squash commits, I'll do that on merge. This looks great, thanks!

@icgood icgood merged commit d7c5608 into slimta:master Nov 8, 2016
@toxinu toxinu deleted the fix-empty-ehlo branch November 9, 2016 08:38
@icgood icgood added this to the 4.0 milestone Nov 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants