Email failed to deliver

Hi Team,

We are facing issue while email trigger , Below are the logs Please help to resolve this
we are already map TLS email-smtp-host: smtp.gmail.com, email-smtp-port: “587”
Kernel Version: kernel-notification-service:1.2.0.1-B1

2023-05-19 12:49:15,381 [http-nio-8083-exec-4] INFO [i.m.k.a.d.h.ValidateTokenHelper].buildMosipUser.274 : user (offline verification done): service-account-mosip-prereg-client
2023-05-19 12:49:15,385 [http-nio-8083-exec-4] INFO [i.m.k.e.s.i.EmailNotificationServiceImpl].sendEmail.77 : To Request : demokenya1111@gmail.com
{“@timestamp”:“2023-05-19T12:49:15.388Z”,“level”:“ACCESS”,“level_value”:70000,“traceId”:“51f540bdc359d3b2dff5f112fc0f9443”,“statusCode”:200,“req.requestURI”:“/v1/notifier/email/send”,“bytesSent”:166,“timeTaken”:0.014,“appName”:“kernel-notification-service”,“req.userAgent”:“Apache-HttpClient/4.5.6 (Java/11.0.16)”,“req.xForwardedFor”:“-”,“req.referer”:“-”,“req.method”:“POST”,“req.remoteHost”:“127.0.0.6”}
2023-05-19 12:49:16,841 [SimpleAsyncTaskExecutor-2] ERROR [i.m.k.l.l.i.Slf4jLoggerImpl].error.27 : - ERROR-CODE -

  • Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. de14-20020a1709069bce00b00965ddf2e221sm2273708ejc.93 - gsmtp

Hi Jayanth,

We use the Spring JavaMailSender. You can configure the following.

spring.mail.host=smtp.gmail.com
spring.mail.port=587
spring.mail.username=<login user to smtp server>
spring.mail.password=<login password to smtp server>
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true

The above is referred from

According to MOSIP java code, we need to set, in a file in config-server repository “mosip-config/kernel-default.properties”, mosip.kernel.mail.proxy-mail to false to trigger the sendMail function.

Solution: in file kernel-default.properties in config-sever repository:

mosip.kernel.mail.proxy-mail=false

and then , in Rancher UI or using helm command, redeploy Config-Server pod (namespace config-server) & Notifier pod (namespace kernel).
Link to Java code: https://github.com/mosip/commons/blob/b04faa5b68be555d7e48fada48faa596df4b5a82/kernel/kernel-notification-service/src/main/java/io/mosip/kernel/emailnotification/service/impl/EmailNotificationServiceImpl.java#L52

1 Like

Hi @panharith2023

If you need any support you can reach out to us in the same thread or initiate a new one.

Best Regards,
Team MOSIP