Comments (2)
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.
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)
- When validation fails, provide a reason to the caller HOT 4
- E-Mail Address Validation on https://www.rohannagar.com/jmail/ broken HOT 4
- Valid email shown as invalid HOT 8
- Question: E-Mail Address with local part containing only slashes valid? HOT 3
- Provide distinct failure reasons for each built-in rule and provide option for specifying custom failure reasons HOT 1
- Add ability to get the ASCII only version of an Email HOT 5
- Make timeout configurable for DNS MX record lookup HOT 2
- Support for configuring non-ascii characters to be invalid HOT 2
- Provide option to unquote localparts when normalising HOT 2
- Improve email address normalization HOT 1
- Add changelog file HOT 3
- Does not work for email Ids containing spaces HOT 1
- Validation reason is incorrectly called FAILED_CUSTOM_VALIDATION HOT 1
- Failure Reason incorrect HOT 1
- IPv4 validation allows non-standard digit characters HOT 3
- Question: preceding zeros in IPv4 address HOT 5
- Support no service resource record for domains that accept no mail "Null MX" HOT 2
- domain valition error while validating using mx records(JMail.validator().requireValidMXRecord();) HOT 2
- Option to validate MX record associated with email domains HOT 5
- Add documentation for all default validation rules HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jmail.