SchumacherFM / mailout

mailout - a https://caddyserver.com/ V1 SMTP client email middleware with PGP encryption
https://caddyserver.com/docs
Apache License 2.0
78 stars 13 forks source link

Failed client side request (CORS) still sends mail #11

Closed stp-ip closed 5 years ago

stp-ip commented 7 years ago

When doing a cross site request CORS plays a role. In my setup I have CORS enabled for select domains. This works perfectly. During testing I ran into the issue on a test domain, that CORS was not enabled so the request sort of failed on the client side. What doesn't make sense for me is, that the mail was still send. Probably shouldn't happen, that mails are send, even so the request actually failed due to CORS.

SchumacherFM commented 7 years ago

Hmmm, how can I reproduce that? Also the endpoint makes no assumptions about any other middleware added to Caddy. So maybe the bug is in Caddys CORS module which does not terminate the request and calls all next handlers ...

stp-ip commented 7 years ago

Haven't thought of it this way. Makes sense, that it might be an issue within the CORS module, which shouldn't call the next handler. Will check out the CORS module and report back.

stp-ip commented 7 years ago

Fixed in CORS middleware as far as my recent testing goes.

Thanks for making the project.

stp-ip commented 7 years ago

Sorry not fixed. Messed up the testing.