AWS lambda for processing emails recieved for Discourse
Перейти к файлу
Sven Marnach 17caea2697
Merge pull request #1 from bkochendorfer/reject-subject
feat: Reject certain subjects
2023-05-05 15:30:52 +02:00
src Clean up code and dependencies. 2023-05-04 16:44:38 +02:00
.gitignore add some basic logging 2019-08-30 11:05:10 +01:00
CODE_OF_CONDUCT.md add code of conduct 2019-08-27 13:09:28 +01:00
Cargo.lock Clean up code and dependencies. 2023-05-04 16:44:38 +02:00
Cargo.toml Clean up code and dependencies. 2023-05-04 16:44:38 +02:00
LICENSE add LICENSE 2019-08-27 13:00:58 +01:00
README.md FEATURE: allow filtering emails based on recipients 2019-09-19 17:11:24 +01:00

README.md

discourse-email-in-lambda

Building

rustup target install x86_64-unknown-linux-musl

cargo build --release --features vendored --target x86_64-unknown-linux-musl

zip -j lambda.zip ./target/x86_64-unknown-linux-musl/release/bootstrap

Setting up

This lambda takes 4 environment variables:

  • DISCOURSE_EMAIL_IN_BUCKET: name of s3 bucket raw emails are placed in
  • DISCOURSE_URL: base url of Discourse, without a trailing slash, eg: "https://discourse.mozilla.org"
  • DISCOURSE_API_KEY
  • DISCOURSE_API_USERNAME
  • REJECTED_RECIPIENTS: comma separated list of recipients to not process email for

Logging

This lambda uses env_logger for logging, meaning you can change the logging level and style with environment variables.

By default:

  • RUST_LOG=info
  • RUST_LOG_STYLE=never