Sh4yy / cloudflare-email

This is a simple proxy server that can be used for sending free transactional emails through Cloudflare workers.
MIT License
1.45k stars 338 forks source link

Is this still working though? #6

Open savokiss opened 1 year ago

savokiss commented 1 year ago

I have deploy my this worker into production.

And added a SPF record and a _mailchannels record to my domainA.

And added a custom domainB to my worker.

Then try to POST https://domainB/api/email the body below:

{
    "to": "myown@gmail.com",
    "from": "support@domainA",
    "subject": "Hello World",
    "text": "Hello World"
}

But it always showed Internal Server Error.

Is there anything I missing to use this email sender?

Sh4yy commented 1 year ago

Have you set up the new _mailchannels DNS record?

https://github.com/Sh4yy/cloudflare-email#setup-spf

savokiss commented 1 year ago

Yes, I have set up this record too. But it is still not working, just respond the Internal Server Error message.

andreresende commented 1 year ago

Same error here. Error 500

V-ed commented 1 year ago

It happened to me too. I initially used the Deploy with Workers button and that never worked. Upon inspecting the code on cloudflare quick edits feature, I noticed the worker deployed was actually the default hello world. Maybe I configured it badly, dunno.

I then tried to use the 4 steps of cloning the repo locally to deploy it with wrangler and after properly setting up the SPF record as well as the now required TXT Domain Lockdown error (and since I was already using cloudflare to redirect my domain's email, I had to merge them so it looked at the end like this : v=spf1 a mx include:relay.mailchannels.net include:_spf.mx.cloudflare.net ~all), and after setting up both it seems to work fine for me!

Make sure to also always use a from mail coming from your domain, for some reason I thought I could send emails with the from field as any email, obviously that doesn't work haha


So yeah, maybe the Deploy with Workers button is broken, that I can't confirm, but it works for me after passing by and upvoting this issue initially.

andreresende commented 1 year ago

Yes, it working here after configuring domain lockdown. I think it is mandatory now.

V-ed commented 1 year ago

Confirmed mandatory for Cloudflare workers (from Domain Lockdown error) :

image