code: private Message split(BodyPart bodyPart, Map<String, Object> messageHeaders) {
          MailMessage mailRequest = createMailMessage(messageHeaders, bodyPart.getContent(), bodyPart.getContentType());
  
          Stack<Message> responseStack = new Stack<>();
          if (bodyPart instanceof AttachmentPart) {
              fillStack(getEndpointAdapter().handleMessage(mailRequest
                      .setHeader(CitrusMailMessageHeaders.MAIL_CONTENT_TYPE, bodyPart.getContentType())
                      .setHeader(CitrusMailMessageHeaders.MAIL_FILENAME, ((AttachmentPart) bodyPart).getFileName())), responseStack);
          } else {
              fillStack(getEndpointAdapter().handleMessage(mailRequest
                      .setHeader(CitrusMailMessageHeaders.MAIL_CONTENT_TYPE, bodyPart.getContentType())), responseStack);
          }
  
          if (bodyPart.hasAttachments()) {
              for (AttachmentPart attachmentPart : bodyPart.getAttachments().getAttachments()) {
                  fillStack(split(attachmentPart, messageHeaders), responseStack);
              }
          }
  
          return responseStack.isEmpty() ? null : responseStack.pop();
      }
docs: Split mail message into several messages. Each body and each attachment results in separate message
  invoked on endpoint adapter. Mail message response if any should be sent only once within test case.
  However latest mail response sent by test case is returned, others are ignored.
  
  @param bodyPart
  @param messageHeaders