DataSphereStudio icon indicating copy to clipboard operation
DataSphereStudio copied to clipboard

[Bug] sendemail appconn execute failed because it cannot set 'from' field correctly

Open YennyQ opened this issue 3 years ago • 0 comments

Search before asking

  • [X] I searched the issues and found no similar issues.

DSS Component

dss-appconn

What happened + What you expected to happen

  1. use sendemail node in dss workflow, email cannot send successfully.
  2. expected: sendemail successfully using config in sendemail node and dss config.sh.
  3. two point i found:
  • modify dss config.sh (not config.sh file in dss & linkis which located in outside ) and restart dss & linkis all service, config in config.sh cannot apply to table dss_appconn_instance;
  • after modify config in table dss_appconn_instance correctly, email still cannot send successfully. then i read the source code located in dss-sendemail-appconn, found that email's from field doesn't set correctly (see the two picture below. the first is the code where Email object which would be send generated. the second is a parse function which would turn Email object to MimeMessage object, and then the mimemessage would be send. the from filed would always set to user logged in by wds.dss.workflow.submit.user which parse from current job if i understand correctly). cuz i'm a new to dss & linkis (about two weeks experience maybe), so i don't know whether it's a real bug or just a feature wrote on purpose? if it's a feature, how to config 'from' field correctly? thanks! G23H$ UH@%2D9H%CIX$HTOJ C)T)_BJ`X6OQD%5_5YD8NOB
  1. finally, send email success after set my from field by hard code.

------ edit 0628 -----

  1. SpringJavaEmailSender's properties need a string but not a boolean, or it wouldn't work. (smtp i configured yesterday didn't need auth so nothing happended.)
  2. email send success but attachment content is wrong. captured smtp packet, i found that content-transfer-encoding seems a little weird. in source code, attachment using base64string but without decode. just change addAttachment's call in SpringJavaEmailSender.java, attachment in email can display normally.

Relevent platform

centos7

Reproduction script

use dss master & linkis 1.1.1, config the table dss_appconn_instance's sendemail correctly, and then use dss workflow sendemail node.

Anything else

No response

Are you willing to submit a PR?

  • [x] Yes I am willing to submit a PR!

YennyQ avatar Jun 27 '22 03:06 YennyQ