chibenwa commented on code in PR #1561:
URL: https://github.com/apache/james-project/pull/1561#discussion_r1222430237


##########
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/EmailSubmissionSetMethod.scala:
##########
@@ -250,31 +253,67 @@ class EmailSubmissionSetMethod @Inject()(serializer: 
EmailSubmissionSetSerialize
 
   private def sendEmail(mailboxSession: MailboxSession,
                         request: EmailSubmissionCreationRequest): 
SMono[(EmailSubmissionCreationResponse, MessageId)] =
-   for {
+    for {
       message <- 
SFlux(messageIdManager.getMessagesReactive(List(request.emailId).asJava, 
FetchGroup.FULL_CONTENT, mailboxSession))
         .next
         .switchIfEmpty(SMono.error(MessageNotFoundException(request.emailId)))
       submissionId = EmailSubmissionId.generate
       message <- SMono.fromTry(toMimeMessage(submissionId.value, message))
       envelope <- SMono.fromTry(resolveEnvelope(message, request.envelope))
       _ <- validate(mailboxSession)(message, envelope)
+      parameters = envelope.mailFrom.parameters
+      _ <- SMono.fromTry(validateFromParameters(parameters))
+      delay <- SMono.fromTry(retrieveDelay(parameters))
+      _ <- SMono.fromTry(validateDelay(delay))
+
       mail = {
         val mailImpl = MailImpl.builder()
           .name(submissionId.value)
-          .addRecipients(envelope.rcptTo.map(_.email).asJava)
+          .addRecipients(envelope.rcptTo.filter(m => 
m.parameters.isEmpty).map(_.email).asJava)

Review Comment:
   Why? Can't we rather have a validation step above enforcing rcptTo not to 
have parameters?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to