routing email question
I just set up a dedicated linode for handling my email for all my domains. However, now I have a problem: If an application on one of my other servers (say apache or cron) wants to send an email, it can't (as far as I know) because it is not on the email server. Is there any way around this? I would like to forward email from these other two servers I have, both running apache, and some running other services to my email server.
Any help is appreciated.
Thanks,
-Michael.
6 Replies
I believe nginx is capable of such, but I'm not sure what else is.. probably even postfix if you configured it right.
If you do not want to run mailservers on your other servers, you could also use something like msmtp
I am using postfix on my main mailserver, and hope to use postfix on my other servers as well, just for consistancy. Any idea how I could do that with this configuration?
Thanks,
-Michael.
Hopefully they are of some help, let us know how it goes.
I will call your server with the main mailserver Linode M, and your other servers Linode 1, Linode 2, Linode 3…
On Linode M, edit your Postfix main.cf to include:
mynetworks = 127.0.0.0/8, Linode M IP, Linode 1 IP, Linode 2 IP, Linode 3 IP...
This
Set up Linodes 1, 2, 3… as null clients
relayhost = Linode M hostname or IP
inet_interfaces = loopback-only
local_transport = error:local delivery is disabled
This configures these machines to relay all mail through Linode M. You could set myorigin
Note that if you want this mail to be transferred over the private network (assuming all your Linodes are in the same datacenter), you can specify private IP addresses above instead of the public ones.
You may also have to set up a non-local alias (edit /etc/aliases and run newaliases) on Linodes 1, 2, 3… for root so that delivery of cron and system messages isn't attempted locally.
That last message works like a charm – Thanks!
-Michael.