Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watchdog fails to send email if first MX record is down #6200

Open
ScrumpyJack opened this issue Dec 5, 2024 · 0 comments
Open

Watchdog fails to send email if first MX record is down #6200

ScrumpyJack opened this issue Dec 5, 2024 · 0 comments
Labels

Comments

@ScrumpyJack
Copy link

ScrumpyJack commented Dec 5, 2024

This one is a bit long winded, so apologies for the editing mess.

watchdog.sh starts up and resolves MX with dig +short ${RCPT_DOMAIN} mx

If dig returns an mx record, it then sends an email with smtp-cli

smtp-cli then looks up MX records as well with Net::DNS::mx and always returns the first element of the array which is the first MX record in the order of priority (so it will always return the same MX record)

If that mx is down, you'll never get emails as smtp-cli does not try another mx record.

smtp-cli is unmaintained, so it might be better to fix it in watchdog.sh by checking each $mx returned by dig (in MX priority order) using smtp-cli --server $mx, then when the first that responds is found, pass it to smtp-cli --host

@ScrumpyJack ScrumpyJack added the bug label Dec 5, 2024
@ScrumpyJack ScrumpyJack changed the title Watchdog fails to send email if highest MX priority record is down Watchdog fails to send email if MX record is down Dec 5, 2024
@ScrumpyJack ScrumpyJack changed the title Watchdog fails to send email if MX record is down Watchdog fails to send email if one MX record is down Dec 5, 2024
@ScrumpyJack ScrumpyJack changed the title Watchdog fails to send email if one MX record is down Watchdog fails to send email if first MX record is down Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant