Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/artyom/bouncehandler
Calls SQL queries on MySQL based on received SNS notifications about SQS bounces
https://github.com/artyom/bouncehandler
Last synced: about 11 hours ago
JSON representation
Calls SQL queries on MySQL based on received SNS notifications about SQS bounces
- Host: GitHub
- URL: https://github.com/artyom/bouncehandler
- Owner: artyom
- License: mit
- Created: 2016-11-03T11:19:18.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-17T19:29:31.000Z (almost 8 years ago)
- Last Synced: 2024-06-20T12:06:28.467Z (5 months ago)
- Language: Go
- Size: 5.86 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Given you have AWS SQS setup that routes bounce notifications to SNS topic,
bouncehandler can be used as a http endpoint subscriber for this SNS topic.
This program can run custom MySQL queries for received bounces to mark bad
emails in database.Usage of bouncehandler:
-addr string
address to listen at (default "localhost:8080")
-config string
configuration file (default "mapping.json")
-pass string
basic auth password
-user string
basic auth userConfiguration file should be in json format, it is a mapping between sender
emails and objects with two fields:dsn — MySQL Data Source Name in the following format:
[username[:password]@][protocol[(address)]]/dbname
sql — MySQL query with single ? placeholder that will be replaced by recipient's
email from the bounce notification.Example:
{
"[email protected]": {
"dsn": "user:password@tcp(192.168.0.1:3306)/news",
"sql": "delete from subscribers where email=?"
},
"[email protected]": {
"dsn": "user:password@tcp(192.168.0.1:3306)/forum",
"sql": "update users set notify=0 where email=?"
}
}You may also optionally have one "catch-all" record in a mapping with key value
"*": it would be used if sender listed in bounce notification did not match any
other records.