IBM Security SOAR

Expand all | Collapse all

Outbound Email App: mail_from not working

  • 1.  Outbound Email App: mail_from not working

    Posted Mon May 31, 2021 07:23 AM
    Edited by Lionell Libarios Mon May 31, 2021 07:23 AM
    Hi All,

    I'm currently using the Outbound email app for IBM SOAR and there is a field to set for mail_from. The documentation does not include any explanation on this field works. But basically, I'm setting it via pre-process script on workflow. What I aiming is to change the name for the sender when I send the email to my recipient. Any ideas and inputs are much appreciated.

    Thanks!

    ------------------------------
    Lionell Libarios
    ------------------------------


  • 2.  RE: Outbound Email App: mail_from not working

    Posted Tue June 01, 2021 06:53 AM
    Edited by Shane Curtin Tue June 01, 2021 06:53 AM
    Hi Lionell,

    Thank you for reaching out to the community

    What you could do is make use of the principal object in the pre-process script to assign the value. The name attribute is the email address that use users to sign into SOAR - so your pre-process would include:
    inputs.mail_from = principal.name​

    Hope this helps

    ------------------------------
    Shane Curtin
    Apps Engineer - IBM SOAR
    ------------------------------



  • 3.  RE: Outbound Email App: mail_from not working

    Posted Tue June 01, 2021 07:25 AM
    Hi Shane,

    Appreciating your help and response.

    However, does the inputs.mail_from can set with string data type? I wanted to set it with specific value but when doing it, the sender does not taking effect on the email that was sent to the recipient. It's not overriding the email that was configured in the app.config.

    Thanks,

    ------------------------------
    Lionell Libarios
    ------------------------------



  • 4.  RE: Outbound Email App: mail_from not working

    Posted Tue June 01, 2021 07:57 AM
    Hmm - as you can see from the code at https://github.com/ibmresilient/resilient-community-apps/blob/master/fn_outbound_email/fn_outbound_email/lib/smtp_mailer.py#L138 - if you trace it back it is the mail_from function input that sets the sender and behind the scenes its using https://docs.python.org/3.6/library/smtplib.html?highlight=smtplib#smtplib.SMTP.sendmail and that takes a string

    From the docs: https://github.com/ibmresilient/resilient-community-apps/tree/master/fn_outbound_email#function---outbound-email-send-email mail_from is just text (so yeah, it will take a plain string)

    Am not sure how you are seeing this - maybe it is a side effect of your SMTP server that if logged in - it uses that email account to send the mail from - try not setting a user in the app.config and see (but obviously in a production environment, we would not recommend ;) )

    ------------------------------
    Shane Curtin
    Apps Engineer - IBM Security SOAR
    ------------------------------



  • 5.  RE: Outbound Email App: mail_from not working

    Posted Tue June 01, 2021 07:30 AM
    Hi Lionell

    Can you where you see this parameter to set mail_from ?
    The smtp user  defined in the app.config I would have expected to be the sender of the email.

    Regards
    John



    ------------------------------
    John Quirke
    ------------------------------



  • 6.  RE: Outbound Email App: mail_from not working

    Posted Tue June 01, 2021 07:43 AM
    Hi John,

    I set the value for "mail_from" parameter in the pre-processing script.

    Currently, what was happening is that the sender was always the one I set from the app.config and can't be overriden from setting the "mail_from" value. But the application does have that parameter that's why I'm expecting that I can change the sender from that parameter.

    Thanks,


    ------------------------------
    Lionell Libarios
    ------------------------------



  • 7.  RE: Outbound Email App: mail_from not working

    Posted Tue June 01, 2021 07:56 AM
    Thanks Lionell

    I see the parameter now and understand your issue.
    Will work with Shane on this.

    Regards
    John

    ------------------------------
    John Quirke
    ------------------------------