planka icon indicating copy to clipboard operation
planka copied to clipboard

SMTP no work

Open DeAlexPesh opened this issue 11 months ago • 21 comments

When should letters send? No error, but and no letters...

SMTP_HOST=smtp.yandex.ru
SMTP_PORT=465
SMTP_SECURE=true
[email protected]
SMTP_PASSWORD=PaSsWoRd
[email protected]

DeAlexPesh avatar Mar 22 '24 08:03 DeAlexPesh

For now, emails are sent if you are subscribed to a card and that card has been moved to another list or a comment has been left on it. No other notification have been added yet, but we plan to finalize them.

meltyshev avatar Mar 22 '24 14:03 meltyshev

I was testing this for a while until I realized they wouldn't send when you're commenting on your own cards. Impersonated another user to test and all was well.

tomlyo avatar Mar 22 '24 15:03 tomlyo

but we plan to finalize them.

  • create,block,remove user (and over)
  • create task for user (for not register same as invite)

DeAlexPesh avatar Mar 25 '24 05:03 DeAlexPesh

Impersonated another user to test and all was well.

hm. no work for another user...

DeAlexPesh avatar Mar 25 '24 05:03 DeAlexPesh

It's not working for me either. I can see in the planka logs the following whenever I comment on a card: 2024-03-27 22:41:17 [E] undefined

casem avatar Mar 27 '24 22:03 casem

It's not working for me either. I can see in the planka logs the following whenever I comment on a card: 2024-03-27 22:41:17 [E] undefined

Hm, that's weird, for some reason Nodemailer doesn't throw an error in your case, but when I'm trying with wrong settings, the error is displayed correctly.

try {
  const info = await transporter.sendMail({
    ...inputs,
    from: sails.config.custom.smtpFrom,
  });

  sails.log.info('Email sent: %s', info.messageId);
} catch (error) {
  sails.log.error(error); // <- Here
}

meltyshev avatar Mar 27 '24 23:03 meltyshev

Hm, that IS weird. I believe I have it set up correctly by using the docker compose in the repo as an example but since I’m not getting a detailed error, I can’t tell what’s wrong.

casem avatar Mar 28 '24 00:03 casem

Have same issue. I am trying to play with notifications, but no single was sent. I am using 1.16.3 (no docker)

2024-04-11 10:40:44 [E] undefined
2024-04-11 10:52:05 [E] undefined

sabbath88 avatar Apr 11 '24 11:04 sabbath88

I'll try testing again to catch this undefined error.

meltyshev avatar Apr 11 '24 11:04 meltyshev

After a bit of testing, I've been able to send an email using SendGrid's SMTP server but not the Google Workspace SMTP server. I've tried using the Google Workspace SMTP server as well as their SMTP Relay and both give the [E] undefined error.

casem avatar Apr 11 '24 19:04 casem

I faced same error in docker and tested with Google workspace, yandex, SendGrid smtp services. Docker container error log for each action shows: 2024-04-11 20:34:51 [E] undefined 2024-04-11 20:34:52 [E] undefined

shakibait avatar Apr 11 '24 20:04 shakibait

I tried running Planka in docker with SMTP settings and got the same error. According to this answer we need to add another environment variable SMTP_NAME, so that the hostname can be specified when running via docker.

meltyshev avatar Apr 11 '24 21:04 meltyshev

I managed to get Google Workspaces working without any docker changes. I had to make a chance to my Google Account Security and turned on "less secure app access".

casem avatar Apr 11 '24 23:04 casem

Adding SMTP_NAME doesn't seem to change anything.

For some reason, the settings that I tested before and everything worked, now don't work and the same error occurs. But it seems to be a problem related to the specified SMTP_HOST, maybe they're just blocking connections because of frequent attempts.

Also found why undefined is output, for some reason logging in sails works differently in production (probably it's a bug). I changed the logging messages a bit and the error is displayed the same everywhere. I'll make a release with this fix.

meltyshev avatar Apr 12 '24 10:04 meltyshev

Please try upgrading to 1.16.4 and you'll see a normal error message instead of undefined.

meltyshev avatar Apr 12 '24 12:04 meltyshev

I did something and start to get email notifications without any problem, BUT i'm not sure it's correct or not to set SMTP_SECURE=false. Kindy request to know if help contributers to solve it in better way maybe. Right now i'm using Google workspace and also tested yandex mail without any problem and notifications are coming.

shakibait avatar Apr 12 '24 19:04 shakibait

I was testing this for a while until I realized they wouldn't send when you're commenting on your own cards. Impersonated another user to test and all was well.

Wow, this would have been nice to know, spent hours trying to troubleshoot this!

I am also having issues with SMTP, I do have an error:

planka-1 | 2024-04-13 14:14:16 [E] Error sending email: Error: D809414AB67F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:354:

I am using google workspace- - SMTP_HOST=smtp.gmail.com (i've tried smtp-relay.gmail.com as well) - SMTP_PORT=587 - SMTP_SECURE=true - [email protected] - SMTP_PASSWORD=application password - SMTP_FROM="Planka" [email protected]

As @shakibait mentioned, I also disabled SMTP_SECURE=false and it sends email without any issues.

mostdcoa avatar Apr 13 '24 14:04 mostdcoa

Wow, this would have been nice to know, spent hours trying to troubleshoot this!

I am also having issues with SMTP, I do have an error:

planka-1 | 2024-04-13 14:14:16 [E] Error sending email: Error: D809414AB67F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:354:

I am using google workspace- - SMTP_HOST=smtp.gmail.com (i've tried smtp-relay.gmail.com as well) - SMTP_PORT=587 - SMTP_SECURE=true - SMTP_USER=[email protected] - SMTP_PASSWORD=application password - SMTP_FROM="Planka" [email protected]

As @shakibait mentioned, I also disabled SMTP_SECURE=false and it sends email without any issues.

The reason why it's working with SMTP_SECURE=false and not with it set to true is because of port 587 which does not accept SSL. Changing the port to 465 should solve the issue. I highly recommend also setting the name in nodemailer as mentioned previously:

I tried running Planka in docker with SMTP settings and got the same error. According to this answer we need to add another environment variable SMTP_NAME, so that the hostname can be specified when running via docker.

DrPersico avatar Apr 19 '24 14:04 DrPersico

@DrPersico

Thanks, this solved my issue.

For anybody else looking at this in the future: - SMTP_HOST=smtp.gmail.com (this would likely work as smpt-relay.gmail.com too, but not my current usecase, im internal domain emails only right now) - SMTP_PORT=465 - SMTP_SECURE=true - [email protected] - SMTP_PASSWORD=secretpassword - SMTP_FROM="Planka" [email protected] - SMTP_NAME="domain.com"

mostdcoa avatar Apr 20 '24 11:04 mostdcoa

This has been working well, but I've been getting complaints about not being able to turn off the email notifications on the end user side. I will have to disable the feature entirely I think.

tomlyo avatar Apr 25 '24 13:04 tomlyo

This has been working well, but I've been getting complaints about not being able to turn off the email notifications on the end user side. I will have to disable the feature entirely I think.

Thanks for the idea, should be easy to implement.

meltyshev avatar Apr 25 '24 19:04 meltyshev