Giter Site home page Giter Site logo

Comments (7)

waynew avatar waynew commented on July 25, 2024

Just trying to understand here - is there a case where you would want to return a different response to the EHLO and still succeed?

I know personally I haven't had a need for that, but I'm not sure what the valid use cases are.

from aiosmtpd.

waynew avatar waynew commented on July 25, 2024

I just did some searching and I haven't been able to find a really great reason that EHLO should be returning anything besides a 250.

The only reason I can think of that you might be returning something different is that you've got some kind of broken setup - which indicates that you need to fix your code, not that there's an issue here.

But if there's some case that I have considered, I'd love to hear about it!

from aiosmtpd.

cnicodeme avatar cnicodeme commented on July 25, 2024

Hi @waynew ! I do have an example :)

When the server connects to the SMTP daemon, the HELO/EHLO command can allow many checks that can lead to refusal:

  1. checking if the IP has a PTR record
  2. checking that the hostname matches the PTR of that the SPF records allow the IP to send emails
  3. Checking that the sending IP is not on a blacklist (Spamhaus for instance)

If one of those checks fails, you can return a 4xx/5xx to refuse the connection, before going further.

But with the EHLO command, aiosmtpd has already returned 250-* messages before sending that 4xx/5xx code, so it's not good.

Hope that makes sense :)

from aiosmtpd.

waynew avatar waynew commented on July 25, 2024

Hey @cnicodeme yeah, thanks! That definitely makes sense. Do you have any ideas about how we would want to change this? Pull requests of course are always welcome :)

from aiosmtpd.

cnicodeme avatar cnicodeme commented on July 25, 2024

I've sent a PR (#157). Let me know what you think.

The PR also kind of join the idea of having None returned for the hooks instead of MISSING. (see #154 )

from aiosmtpd.

agronholm avatar agronholm commented on July 25, 2024

If there is no way to override the 250 response, how can I test that my SMTP client can fall back to HELOwhen EHLO fails?

from aiosmtpd.

agronholm avatar agronholm commented on July 25, 2024

Answering my own question, overriding smtp_EHLO() is the only way.

from aiosmtpd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.