-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trigger email extension stuck when using Gmail/Gsuite to send emails #41
Comments
Hi @aq2 - Would you be able to check the Firebase Functions logs to see if any error is occurring? |
okay thanks, i'm just testing this with a simple button on my website that adds a document to my 'mail' collection i press the button, see the new doc in the collection, but it stays at 'processing' - no errors shown in 'delivery' field - just says 'null' and 0 attempts logs don't seem to give any obvious error messages, but it eventually times out |
@aq2 Hello :) |
@rphlmr It's omitted as it's a sensitive field. I'll try this out myself using my own Gmail account as the SMTP provider. My initial thinking is that @aq2 would you be able to try |
hi - thanks for your inputs, I have managed to get it working using a different email provider, but am still unable to use with gmail, whether using smtp or smtps I have heard that gmail are quite a large email company and i am surprised that i can't get the extension working with them. @Ehesp did you manage to get gmail working? |
Could you try setting the |
sorry, not quite sure what you mean i've been using the same email address in 'from' and smtp URI - ie my gmail address or are you suggesting that i use gmail URI, but with a different from address - like 'send as'? |
sorry - pressed the wrong button - didn't mean to close - whoops |
That's ok then, I believe Gmail has restrictions around the from sender address having to be the same as the SMTP user. Let me try and get Gmail sync'd up and I'll get back to you on whether I can get it working. |
I have came across the same issue as the op. However, I tried with my gmail and it worked. (example@gmail.com). But I tried with a GSuite email (example@customdomain.com) and it did not work for that email. The delivery state is stuck on PROCESSING and the cloud function is timing out after one minute. Any suggestion is appreciated. |
So, I don't think this is an issue with the email provider. I knocked up a quick and dirty nodemailer app and it worked perfectly with the same account details. |
What Firebase plan are you on? Trying to replicate in the same environment. |
Blaze |
Hi @Ehesp - thanks for helping me with this. Further info - I've set up a custom function, triggered from the same collection, that uses nodeMailer to send the required emails and it works fine using my email account details that weren't working with the ready-made email trigger. I've had a look at the source of the ready-made one and nothing jumps out at me. Could it be to do with the way the smtp url string is being parsed? I notice that the collection document gets updated with attempts: 0, whatever config etc I tried and even when errors were reported. |
I had the same issue - my challenge was that my email was a GSuite account and I needed to allow access from Less Secure Apps. I had to go into my GSuite account, Security allows Users to Set own Less Secure Apps. Then set it for my email. It was a bit of a struggle but I hope that helps someone. |
I couldn't do that with my initial email account as it has 2FA. However, I followed the various instructions for that, including an app-specific password and didn't have any joy. Then I set up another GMail account without 2FA and followed the allow-less-secure and recaptcha settings - still didn't work. It's the latter account that I have working fine, now, with my own cloud function. It's weird how this seems to work for some users and not for others. |
If it helps, what I did for GMAIL account: I didn't manage to use my GSuite account tho yet. |
Thanks - and I'm glad you got it working. I've found that my custom cloud function does everything I need it to do, so I've moved on to other areas of functionality. |
For all fighting with the correct connection URL, it might help to consult nodemailer documentation. https://nodemailer.com/smtp/ The extension just passes the connection URL as is to nodemailer. I stopped trying with gmail cause of 2FA. Testing can be better done with mailservices like sendgrid or mailgun. They have free plans and offer a SMTP gateway which one can use. |
Isn't it the idea of the extension to handle this without extra impediments? |
For those who are still struggling with GSuite emails for the Email Trigger Extension. I think I may have found a solution. As the OP says I was stuck at the However when I used a password without any special characters it worked.
@ctwhome pls try this and find out whether it worked for you or not. |
I URL encoded the special characters in my password and that worked fine. Have it working with
NB. from email same as auth email although idk if that is necessary |
@MatteoStohlman yeah, I did the same. It's working fine for me. |
Hi guys, any update about this issue? |
Had the same issue until I encoded the password - you can check it here to make sure https://www.urlencoder.org/ |
Hi @shaisa, I had not only encoded the password but also changed to a simple password, without special character. I believe google functions has some problem to execute Nodemailer with a provider different than Google. When I try to send an email with my email provider anything works. I have tried locally with Firebase Functions Emulator and in a vanilla Node.js. The code works fine in a vanilla node.js application but doesn't work with Firebase Function. |
Mmmm.... You know what - I couldn't make the extension to work with my g-suite smtp-relay as well... If only someone from google was here to help ;)... |
I wouldn't recommend using GMail or G Suite to send email for an
application. They are designed to be personal / business email accounts,
not automated mass mailers. There are a variety of providers like SendGrid,
Mailgun, etc. that are designed more for the purpose and work well with the
extension. That being said, I'm not opposed to figuring out what's going on
here, but it's not at the top of our priority list at the moment.
…On Mon, Dec 16, 2019, 5:37 AM shaisa ***@***.***> wrote:
Mmmm.... You know what - I couldn't make the extension to work with my
g-suite smtp-relay as well...
I guess gmail is the only one working right now. And the logs are
worthless to understand why.
If only someone from google was here to help ;)...
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#41?email_source=notifications&email_token=AAAAH7UPDW4HECZS6SYXOF3QY577ZA5CNFSM4JAGYQTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG6XJAI#issuecomment-566064257>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAH7RGYXNYNKKAXGQXJUDQY577ZANCNFSM4JAGYQTA>
.
|
Of course - at least on my end this is not the case - this is a part of evaluating the extension in terms of usability and limitations (btw, not all use cases are for mass mailing so I wouldn't dismiss this issue because of that). |
Hi! After all the services that firebase provides to create extremely fast, complex, realtime applications... Having to use a third party like sendgrid to handle emails seems odd to me. I mean, for an application sending emails to customers is fundamental, why is this not being part of the core functionalities of firebase? Maybe firebase hosting? |
Hi, we are not planning to offer an email service within Firebase in the forseeable future. It seems like the workaround in #41 (comment) is the best approach. Perhaps we can document this more clearly. |
I don't think it's a gmail/gsuite specific issue. I am getting an indefinite PROCESSING status with Postmark. My smtp URI looks like I tried this smtp URI with nodemailer in a node repl locally and I was able to send an email successfully so it doesn't seem to be Postmark. I previously was using SendGrid with this extension and I had emails working. Complicating my debug data is I upgraded the extension from node 8 to node 10, but I'm not sure that has anything to do with seeing this issue since I never tried Postmark on node 8. Nor have I tried SendGrid on node 10. Trying to reactivate my SendGrid account to see if I can get that working again (they deactivated me without notice (I'm thinking due to low volume), which is what sent me on this goose chase in the first place). |
Trying to debug the function. Upon the create of the initial document the cloud function updates Looking at the switch statement for PENDING, it sets extensions/firestore-send-email/functions/src/index.ts Lines 325 to 337 in b9b4d6f
However, if These observations match with earlier reports: The original post shows Is there something with @Ehesp can we reopen? |
@Ehesp , do you want me to file a new bug? Node 10 simply won't send an email for me. |
Also had this problem and removing the special characters from the password worked for me as well! Thanks 🙏🏽 |
I also had the same issue, trying to send with a gmail account (not G-Suite). What worked:
The above 2 steps did the trick. |
Hi - not sure if this is the right place for support, but here goes...
My emails are stuck in 'PROCESSING' mode
i'm using gmail to send my mails, using smtp://me@gmail.com:password@smtp.gmail.com:465
what am i doing wrong?
thanks in advance
The text was updated successfully, but these errors were encountered: