I've started monit manually, and that resulted in local mails, to root@localhost. I want to receive mails via my personal mail address. I have postfix installed, and other applications (like Wordpress) can send out mails.

Why doesn't that work, and how can I get it working?

@Zoredache suggests to forward the mail to root@localhost to my own address. That sounds like a good solution. Now I'm wondering how I can get that working.

Getting this setup right sounds good, but is there some reason why you couldn't just set an alias on the system to forward the mail from root@localhost to the address you prefer?
–
ZoredacheFeb 10 '12 at 21:54

Thank you. I just updated the question with your suggestion.
–
SPRBRNFeb 10 '12 at 22:48

2 Answers
2

To create an alias under most mail servers, and I believe postfix, just update the system alias file /etc/aliases. It almost certainly already exists, so you just have to go in and add or update a line.

I update this line, restarted monit, which results in a new mail sent. I don't login as root, but as user rxt. The mail is sent to this user, not to the root user. This confuses me a bit, because I start monit as root. So the mail doesn't arrive at the moment.
–
SPRBRNFeb 10 '12 at 23:22

You would have to look at your existing aliases. Perhaps monit is sending to some other address that is already getting aliased to rxt?
–
ZoredacheFeb 10 '12 at 23:28

The mailto address I used was on the same domain as the domain name for the machine. In the above example I used admin@abc.test, while abc.test pointed to this server, and admin was the username. The MX records for the mail for this domain points to a different server with a different provider, so I didn't consider that a problem. Now I've used a gmail address (root: abctest@gmail.com), and I reloaded the aliases with the command "newaliases". And voila! It works! :-)
–
SPRBRNFeb 11 '12 at 20:01