alash3al / smtp2http

A tiny software that receive a smtp request (email) and send it to the specified webhook as a http post request
Apache License 2.0
522 stars 81 forks source link

Pass all mail headers through #9

Closed skorokithakis closed 4 years ago

skorokithakis commented 4 years ago

A good feature would be adding a "headers" list to the webhook so we can get every raw header in the original email message.

alash3al commented 4 years ago

I think with the latest version (v3) we have all possible headers

skorokithakis commented 4 years ago

Very possible, when did that version come out? I compiled from master a few days ago and don't see the headers.

alash3al commented 4 years ago

ok, there are two 1- 3 days ago (latest: moved to JSON payload with base64 encoded attachments and embedded files if found, instead of the basic multipart/form-data) just for flexibility 2- 4 days ago

here are the compiled releases: https://github.com/alash3al/smtp2http/releases

skorokithakis commented 4 years ago

Fantastic, thank you! I will try those right away.

skorokithakis commented 4 years ago

The headers seem to work great, thanks! I've filed an issue with a small bug. The interface won't change past the current JSON interface, right? It would be nice if we could have a forward-compatibility guarantee.

alash3al commented 4 years ago

could you elaborate more?

skorokithakis commented 4 years ago

I'm wondering whether the webhook interface is stable now or whether you foresee it changing again in the future (like you moved from form/urlencoded to JSON).

alash3al commented 4 years ago

Ah, yes, I just moved to JSON to simplify any handler that will receive the data as well for future features, but let's say that we will move in the future to another method, I should make it as a CLI flag to be backward compatible.

skorokithakis commented 4 years ago

I don't know how sustainable it will be to backport all features to two interface, I think you should decide on an interface now and stick with it. It shouldn't be too hard, since SMTP is pretty standard in what it gives you and you can just pass all that as you do now.

alash3al commented 4 years ago

as I said, I moved to JSON, regarding your quote "It shouldn't be too hard since SMTP is pretty standard", the features aren't related to receiving the emails, some related spam checking, and others related to persisting the messages to some object store ... etc.

skorokithakis commented 4 years ago

Yes, but adding new fields is fine, removing/renaming old fields is where the problem is. Just keep those and you're set.

alash3al commented 4 years ago

Yup, but if I want to add some fields with boolean, object, .. values, the old-style won't be the best, so I selected JSON as the main format.

skorokithakis commented 4 years ago

Agreed, I mean JSON as well.

atymic commented 4 years ago

It seems like headers are no longer part of the json webhook?