Skip to content

Commit

Permalink
Merge branch 'fix-mailin-with-multiple-exception-to-addresses' into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
gbp committed Oct 7, 2024
2 parents 77ab702 + 0675212 commit 0b53d7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Highlighted Features

* Fix script/mailin when multiple EXCEPTION_NOTIFICATIONS_TO addresses are
specified (Graeme Porteous)
* Add example logrotate configuration (Graeme Porteous)
* Switch application server from Thin to Puma (Graeme Porteous)
* Fix rendering invoices page when there are discounted Pro subscription (Graeme
Expand Down
5 changes: 4 additions & 1 deletion script/mailin
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ then
SUBJ="Mail import error for $(bin/config DOMAIN)"
BODY="There was an error code $ERROR_CODE returned by the RequestMailer.receive command in script/mailin. See attached for details. This might be quite serious, such as the database was down, or might be an email with corrupt headers that Rails is choking on. We returned the email with an exit code 75, which for Exim at least instructs the MTA to try again later. A well configured installation of this code will separately have had Exim make a backup copy of the email in a separate mailbox, just in case."
FROM="$(bin/config BLACKHOLE_PREFIX)@$(bin/config INCOMING_EMAIL_DOMAIN)"
/usr/bin/mutt -e "set use_envelope_from" -e "set envelope_from_address=$FROM" -s "$SUBJ" -a "$OUTPUT" "$INPUT" -- "$(bin/config EXCEPTION_NOTIFICATIONS_TO)" <<<"$BODY"

for TO in $(bin/config EXCEPTION_NOTIFICATIONS_TO); do
/usr/bin/mutt -e "set use_envelope_from" -e "set envelope_from_address=$FROM" -s "$SUBJ" -a "$OUTPUT" "$INPUT" -- "$TO" <<<"$BODY"
done

# tell exim error was temporary, so try again later (no point bouncing message to authority)
rm -f "$INPUT" "$OUTPUT"
Expand Down

0 comments on commit 0b53d7a

Please sign in to comment.