-
Notifications
You must be signed in to change notification settings - Fork 462
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
JAMES-4008 JMAP - Email/set - Should be able to save a draft with invalid email address #2040
JAMES-4008 JMAP - Email/set - Should be able to save a draft with invalid email address #2040
Conversation
…alid email address
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small remarks but looks good otherwise
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/mail/EmailSet.scala
Show resolved
Hide resolved
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/mail/EmailSet.scala
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Please add a test to ensure that
EmailSubmission/set
is not able to send a mail with invalid addresses...
…ith invalid email address
updated it in last commit 52ab0e8 the note here is invalid addresses in the "mimeMessage header" (The address in |
@@ -7507,6 +7507,142 @@ trait EmailSetMethodContract { | |||
|
|||
} | |||
|
|||
@Disabled("Bug of james-mime4j when pasing mimeMessages https://github.com/linagora/james-project/issues/5086") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where the problem is? In Email/get?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we handle the exception in Scala code for the time being?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, Email/get
it returns incorrect to
property response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As expressed in linagora#5086 (comment) this corner on't happen with Twake mail in practice so it will not be a blocker...
.inPath("methodResponses[1][1].list") | ||
.isEqualTo("""[{ | ||
| "to": [{ | ||
| "name": "name1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Temporarily disable this test:
Right now the response is
"to": [
{
"name": "name1",
"email": "invalid1"
},
{
"email": ">"
}
]
It is a bug of james-mime4j when parse the message
Detail: linagora#5086
…draft with invalid email address
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the very nice work!
How about by the time we get this fixed we filter in the JMAP stack the lone > email? Not clean but it would do as a temporary fix... |
org.apache.james.jmap.rfc8621.memory.MemoryEmailSubmissionSetMethodTest.emailSubmissionSetCanBeChainedAfterEmailSet(GuiceJamesServer) Assertion condition defined as a lambda expression in org.apache.james.jmap.rfc8621.contract.EmailSubmissionSetMethodContract that uses java.lang.String [Node "methodResponses[0][1].ids"] |
Related? |
…ith invalid email address
.`then`(SMono.just(mimeMessage)) | ||
|
||
private def validateMailAddress(headName: String, address: Address): MailAddress = | ||
Try(new MailAddress(address.toString)) match { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try(new MailAddress(address.getAddress)) match {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class Address
do not have .getAddress
method
…alid email address (apache#2040)
jira https://issues.apache.org/jira/browse/JAMES-4008