Answer the question
In order to leave comments, you need to log in
Do not accept mail if spam server (exim-dspam) is not available?
There is a bunch of exim mail servers (its booty sticks out into the world and receives mail), dspam (it's on the internal network), excahnge (users' mailboxes). The mail route is exim - dspam - exchange.
How to explain to exim that it would not accept mail (beat off) or forward it to exchange if dspam is not available?
Answer the question
In order to leave comments, you need to log in
Check the cron process every minute, and if it is not available, shut down Exim with a notification to the admin by any means, Exim is not available, mail is stored on transit servers or sender servers, everything is fixed, Exim is started - mail has arrived to recipients.
Нашел элегантное решение.
Макросы команд (10 мс на команду; проверил для проверки порта нужно минимум 6мс):
-- Создал переменные с командами, 10.10.10.3 - dspam server, 10.10.10.4 - database
CHECK_DSPAM_COMMAND1 = "/usr/bin/timeout 0.01s /bin/nc 10.10.10.3 25 -z -w1"
CHECK_DSPAM_COMMAND2 = "/usr/bin/timeout 0.01s /bin/nc 10.10.0.4 5432 -z -w1"
--
Добавил правило в транспорте:
--
transport = ${if and { \
{eq {${run{/bin/sh -c CHECK_DSPAM_COMMAND1}{true}{false}}}{true}} \
{eq {${run{/bin/sh -c CHECK_DSPAM_COMMAND2}{true}{false}}}{true}} \
}\
{dspam_spamcheck_transport}{remote_smtp_smarthost}\
}
Логика такая. Если ни одно из условий не выполняется, транспортом выбирается remote_smtp_smarthost и письмо идет на Exchange.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question