Giter Site home page Giter Site logo

Comments (2)

RohanNagar avatar RohanNagar commented on May 25, 2024

Thank you for the detailed report @XakepSDK!

This is definitely an interesting case, I'll take some time to dig into source routing. Right now it looks like I'll want to support it, but I want to make sure it is still considered valid.

Looks like while it is technically still allowed in RFC 5321, it has been deprecated since then and is strongly discouraged. I'm thinking that allowing these types of addresses could be an opt-in on the EmailValidator, for example:

JMail.validator()
    .isValid("@1st.relay,@2nd.relay:[email protected]"); // returns false

JMail.validator()
    .allowSourceRouting()
    .isValid("@1st.relay,@2nd.relay:[email protected]"); // returns true

From RFC 5321:

RFC 821 utilized the concept of explicit source routing to get mail
from one host to another via a series of relays. The requirement to
utilize source routes in regular mail traffic was eliminated by the
introduction of the domain name system "MX" record and the last
significant justification for them was eliminated by the
introduction, in RFC 1123, of a clear requirement that addresses
following an "@" must all be fully-qualified domain names.
Consequently, the only remaining justifications for the use of source
routes are support for very old SMTP clients or MUAs and in mail
system debugging. They can, however, still be useful in the latter
circumstance and for routing mail around serious, but temporary,
problems such as problems with the relevant DNS records.

SMTP servers MUST continue to accept source route syntax as specified
in the main body of this document and in RFC 1123. They MAY, if
necessary, ignore the routes and utilize only the target domain in
the address. If they do utilize the source route, the message MUST
be sent to the first domain shown in the address. In particular, a
server MUST NOT guess at shortcuts within the source route.

Clients SHOULD NOT utilize explicit source routing except under
unusual circumstances, such as debugging or potentially relaying
around firewall or mail system configuration errors.

from jmail.

RohanNagar avatar RohanNagar commented on May 25, 2024

I fixed this with c23a3c9.

I decided that since it technically is still valid according to RFC, it should be allowed by default. However, JMail.strictValidator() will not allow for explicit source routing and in production it should not be allowed either.

The change will be included in the next release (probably v1.2.0).

from jmail.

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.