code: @SuppressWarnings("unchecked")
      protected void setDeliveryStatus(SMTPClientSession session) throws SMTPException {
          SMTPClientFutureImpl<Collection<FutureResult<Iterator<DeliveryRecipientStatus>>>> future = (SMTPClientFutureImpl<Collection<FutureResult<Iterator<DeliveryRecipientStatus>>>>) session.getAttribute(FUTURE_KEY);
          List<DeliveryRecipientStatus> statusList = (List<DeliveryRecipientStatus>) session.getAttribute(DELIVERY_STATUS_KEY);
          List<FutureResult<Iterator<DeliveryRecipientStatus>>> resultList = ((List<FutureResult<Iterator<DeliveryRecipientStatus>>>) session.getAttribute(DELIVERY_RESULT_LIST_KEY));
          Iterator<SMTPDeliveryEnvelope> transactions = ((Iterator<SMTPDeliveryEnvelope>) session.getAttribute(SMTP_TRANSACTIONS_KEY));
  
          resultList.add(new DeliveryResultImpl(statusList));
          
          if (!transactions.hasNext()) {
              future.setResult(resultList);
  
              next(session, SMTPRequestImpl.quit());
          } else {
              initSession(session);
              if (session.getSupportedExtensions().contains(PIPELINING_EXTENSION) && ((SMTPDeliveryAgentConfig)session.getConfig()).getPipeliningMode() != PipeliningMode.NO) {
                  pipelining(session);
              } else {
                  String sender = ((SMTPDeliveryEnvelope) session.getAttribute(CURRENT_SMTP_TRANSACTION_KEY)).getSender();
  
                  next(session, SMTPRequestImpl.mail(sender));
              }
          }
  
      }
docs: Set the DeliveryStatus and notify the {@link SMTPClientFuture} if needed
  
  @param session
  @throws SMTPException