Mailgun - Issue when trying to add additional parameters
See original GitHub issue📣 Notification Service(s) Impacted Mailgun
🐞 Describe the bug Regarding the apprise wiki, I’ve tried to add a “From” parameter to my mail but always got errors. Several trials :
mailgun://postmaster@{sandboxid.mailgun.org}/{apikey}/mymail@gmail.com
will work Mailgun log :
{ “tags”: null, “timestamp”: 1666430709.990572, “storage”: { “url”: “https://storage-us-west1.api.mailgun.net/v3/domains/sandboxid.mailgun.org/messages/xxx==”, “region”: “us-west1”, “key”: “xxx==”, “env”: “production” }, “envelope”: { “sender”: “postmaster@sandboxid.mailgun.org”, “transport”: “smtp”, “targets”: “mymail@gmail.com” }, “recipient-domain”: “gmail.com”, “event”: “accepted”, “method”: “HTTP”, “user-variables”: {}, “flags”: { “is-authenticated”: true, “is-test-mode”: false }, “log-level”: “info”, “originating-ip”: “myip”, “message”: { “headers”: { “to”: “mymail@gmail.com”, “message-id”: “xxx@sandboxid.mailgun.org”, “from”: “postmaster@sandboxid.mailgun.org”, “subject”: “ChangeDetection Notification - Change Detection” }, “size”: 604 }, “recipient”: “mymail@gmail.com”, “id”: “xxx” }
mailgun://postmaster@{sandboxid.mailgun.org}/{apikey}/?From=Luke%20Skywalker/mymail@gmail.com
(using the same exact example as the wiki) will not work Mailgun log :
{ “tags”: null, “timestamp”: 1666430944.9932263, “storage”: {}, “event”: “rejected”, “campaigns”: null, “flags”: { “is-authenticated”: true }, “reject”: { “reason”: “Sandbox subdomains are for test purposes only. Please add your own domain or add the address to authorized recipients in Account Settings.”, “description”: “” }, “message”: { “headers”: { “to”: “postmaster@sandboxid.mailgun.org”, “message-id”: “xxx@sandboxid.mailgun.org”, “from”: “postmaster@sandboxid.mailgun.org”, “subject”: “ChangeDetection Notification - Change Detection” } }, “id”: “xxx” }
mailgun://postmaster@{sandboxid.mailgun.org}/{apikey}/mymail@gmail.com/?From=Luke%20Skywalker
will work but not with a custom “From” Mailgun log :
{ “tags”: null, “timestamp”: 1666431713.4832542, “storage”: { “url”: “https://storage-us-west1.api.mailgun.net/v3/domains/sandboxid.mailgun.org/messages/xxx==”, “region”: “us-west1”, “key”: “xxx==”, “env”: “production” }, “envelope”: { “sender”: “postmaster@sandboxid.mailgun.org”, “transport”: “smtp”, “targets”: “mymail@gmail.com” }, “recipient-domain”: “gmail.com”, “event”: “accepted”, “method”: “HTTP”, “user-variables”: {}, “flags”: { “is-authenticated”: true, “is-test-mode”: false }, “log-level”: “info”, “originating-ip”: “myip”, “message”: { “headers”: { “to”: “mymail@gmail.com”, “message-id”: “xxx@sandboxid.mailgun.org”, “from”: “postmaster@sandboxid.mailgun.org”, “subject”: “ChangeDetection Notification - Change Detection” }, “size”: 604 }, “recipient”: “mymail@gmail.com”, “id”: “xxx” }
mailgun://postmaster@{sandboxid.mailgun.org}/{apikey}/?From=Luke%20Skywalker&to=mailgmail%40gmail.com
will work but not with a custom “From”
Regarding the mailgun log, it seems that into the 2nd example it uses the sender as the recipient what causes this reject error
💡 Screenshots and Logs
💻 Your System Details:
- OS: W10
- Python Version: Python v3.10.8
🔮 Additional context I’m using apprise via changedetection.io from @dgtlmoon (installed into a docker container on my QNAP nas) I post the issue here because I think it’s more appropriate to analyze it.
My initial goal was to adding a custom “From” with user & mail like this (mailgun log from a notification launched by urlwatch :
{ “tags”: null, “timestamp”: 1666427644.0839264, “storage”: { “url”: “https://storage-us-west1.api.mailgun.net/v3/domains/sandboxid.mailgun.org/messages/xxx==”, “region”: “us-west1”, “key”: “xxx==”, “env”: “production” }, “envelope”: { “sender”: “postmaster@sandboxid.mailgun.org”, “transport”: “smtp”, “targets”: “mymail+urlwatch@gmail.com” }, “recipient-domain”: “gmail.com”, “event”: “accepted”, “method”: “HTTP”, “user-variables”: {}, “flags”: { “is-authenticated”: true, “is-test-mode”: false }, “log-level”: “info”, “originating-ip”: “xxx”, “message”: { “headers”: { “to”: “mymail+urlwatch@gmail.com”, “message-id”: “xxx@sandboxid.mailgun.org”, “from”: “urlwatch mymail@gmail.com”, “subject”: “3 changes: Newly Added, Something Changed, Error Reporting” }, “size”: 4270 }, “recipient”: “mymail+urlwatch@gmail.com”, “id”: “xxx” }
Issue Analytics
- State:
- Created a year ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
Glad to hear! Thanks also @amotl for chiming in!
Thanks for the fix @amotl 👍 Regarding the PR, it seems to work now @caronc ! Here is the mailgun log with the tested branch :
The header part of the mail :
I let you close if you have finished with this issue, many thanks !