开发者

Send mail from a BASH Script and how to configure mail servers for Ubuntu

开发者 https://www.devze.com 2023-04-06 15:05 出处:网络
I have multiple (read 10s) MySQL slaves running in a LAN. Obviously, I cannot monitor them automatically from an external systems.

I have multiple (read 10s) MySQL slaves running in a LAN. Obviously, I cannot monitor them automatically from an external systems.

So, I thought of setting up local BASH scripts that will send a mail alert when the replication fails. I got the BASH script for replication but now I am stuck at mailing part..

I installed mailutils in Ubuntu and tried to send a mail. But, I get the following error

"Your access to this mail system has been rejected due to the sending MTA's IP xx.xx.xx.xxx poor reputation"

I found out that I can overcome this by getting it out of the list. But, I have 10s of those IPs and may change over time. So, is there any other method to use some s开发者_开发问答erver to send mails without the worry of removing IPs from SPAMHaus list?


I'd recommend using a smarthost, e.g. your provider's email server, and forward over it. That is, configure your local mail server (in Debian exim is the default, and I guess it's the same for Ubuntu) to use a smarthost for mail delivery and configure it for rewriting such that all mail from your system is locally forwarded to the accounts of the people dealing with your MySQL slaves and these people are aliased to external addresses.

This can be done via the /etc/aliases file, if I remember correctly.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号