firestore-send-email sets document state to PROCESSING indefinitely
See original GitHub issue[REQUIRED] Step 2: Describe your configuration
- Extension name: firestore-send-email
- Extension version: v0.1.7
- Configuration values (redact info where appropriate):
- Cloud Functions location: us-central1
- SMTP connection URI: smtp://<POSTMARK_API_TOKEN>:<POSTMARK_API_TOKEN>@smtp.postmarkapp.com:25
- Email documents collection: emails
- Default FROM address: User user@example.com
- Default REPLY-TO address (Optional): Parameter not set
- Users collection (Optional): users
- Templates collection (Optional): emailTemplates
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
When adding a document to my emails collection, I am getting an indefinite state
of PROCESSING
.
Expected result
Expected the state
to move beyond PROCESSING
and send the mail.
Actual result
The document persists in the following state indefinitely.
createdAt: January 23, 2021 at 8:59:40 AM UTC-6
delivery:
attempts: 0
error: null
leaseExpireTime: January 23, 2021 at 9:00:45 AM UTC-6
startTime: January 23, 2021 at 8:59:44 AM UTC-6
state: "PROCESSING"
from: "Ben Example <user@example.com>"
message:
subject: "Example subject"
text: "Example message"
private: true
replyTo: "ben.example@gmail.com"
toUids:
0: "HkKeaL2MxJZkymy3g89OIBDDaYH3"
userId: "HkKeaL2MxJZkymy3g89OIBDDaYH3"
Details:
I am using Postmark. My smtp URI looks like smtp://<POSTMARK_API_TOKEN>:<POSTMARK_API_TOKEN>@smtp.postmarkapp.com:25
. Postmark uses an API key with only hex characters and dashes so special characters doesn’t seem like it would be the issue. The username and password for postmark are the same, the API token.
Debug:
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 the Postmark smtp URI.
I also dug into the extensions code a little bit. In the extension, upon the create of the initial document, the cloud function updates attempts
to 0 and state
to PENDING
. But what I see when observing the document in the firebase console is attempts
are 0 and state is PROCESSING
.
Looking at the switch statement for PENDING
, it sets state to PROCESSING
and then should call deliver()
.
However, if deliver()
was called at all, why would attempts
remain 0? My logs confirm that the “Attempting delivery…” message is not present either.
Is there something with await admin.firestore().runTransaction
where it might be hanging there (though update of state
to PROCESSING
goes through)? I see there is a comment in the code about issue #48. Not sure if the issues there are still causing issues with this firebase extension.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
Hello, chiming in from Postmark’s support perspective 👋
We offer ports
25
,2525
, and587
for outbound SMTP. This could suggest that Firebase started blocking port 25. Blocking that port is pretty common as an anti-abuse measure for a host.I couldn’t find a blocked port list in Firebase’s docs, but I see that Google Computer Engine blocks port 25 so it wouldn’t surprise me if they started to use a similar rule here.
Hi @russellwheatley , with
smtp
and587
it finished withSUCCESS
and I received the email. Thank you.I’ll notify Postmark support of this issue, as they believe port 25 should work.
Also, as I mentioned previously it does work on port 25 when sent via nodemailer in a node REPL. I’m wondering if there is an enhancement that could get it working in this extension, and at a minimum provide better debug messages vs timing out in the
PROCESSING
state.Thank you for looking this over and providing these suggestions.