lib/transports/sparkpost.js
function toInboundMessage(relayMessage, mail) {
    let inboundMessage = transport.defaultInboundMessage({
      to: {
        email: relayMessage.rcpt_to,
        name: ''
      },
      from: mail.from[0],
      subject: mail.subject,
      text: mail.text,
      html: mail.html,
      recipients: mail.to,
      cc: mail.cc,
      bcc: mail.bcc,
      headers: mail.headers,
      attachments: mail.attachments,
      _raw: relayMessage
    });

    inboundMessage.id = transport.defaultMessageId(inboundMessage);

    return inboundMessage;
  }
function toInboundMessage(relayMessage, mail) {
    let inboundMessage = transport.defaultInboundMessage({
      to: {
        email: relayMessage.rcpt_to,
        name: ''
      },
      from: mail.from[0],
      subject: mail.subject,
      text: mail.text,
      html: mail.html,
      recipients: mail.to,
      cc: mail.cc,
      bcc: mail.bcc,
      headers: mail.headers,
      attachments: mail.attachments,
      _raw: relayMessage
    });

    inboundMessage.id = transport.defaultMessageId(inboundMessage);

    return inboundMessage;
  }
function toInboundMessage ( relayMessage , mail ) { let inboundMessage = transport . defaultInboundMessage ( { to : { email : relayMessage . rcpt_to , name : '' } , from : mail . from [ 0 ] , subject : mail . subject , text : mail . text , html : mail . html , recipients : mail . to , cc : mail . cc , bcc : mail . bcc , headers : mail . headers , attachments : mail . attachments , _raw : relayMessage } ) ; inboundMessage . id = transport . defaultMessageId ( inboundMessage ) ; return inboundMessage ; }
Takes a relay message from sparkpost and converts it to an inboundMessage

@param {Object} relayMessage
@param {Object} mail - from MailParser
@returns {InboundMessage} inboundMessage
Takes a relay message from sparkpost and converts it to an inboundMessage