I heartily recommend Exim4. I find it to be BY FAR the easiest/best email server for “send only” operations. It is a full MTA so you don’t need to rely on outside relays (gmail is commonly used with things like phpsendmail). Being a full MTA means that it can do a lot more but I haven’t ventured into using it for that and it is outside of the scope of this short article.
It should be noted that I am working on Ubuntu 14.04 LTS Server, however this will probably work on any debian variant of linux.
RHEL, Centos, Slackware, etc… go elsewhere.
So, if you need direct, send-only mail operations from your server, then here is a quick one liner for installing AND CONFIGURING Exim4:
First elevate yourself to root (okay, this is one EXTRA command…)
I wrote that myself because I got really tired of manually configuring Exim every time I needed to install it. That command makes a backup of the default config file and then writes in the stuff to the active config file that makes it good for “send only” operations. It also locks it down so that only the local server can send email and you don’t end up with an open relay which is a bad thing.
Emails sent by your server will end up in JUNK by default for most providers. Additional setup of other stuff is needed to keep that from happening. This is really for Server Administrators and people that need to get alerts and whatnot from their box. You can whitelist in your receiving inbox to make sure emails don’t go to junk.
Pingback: OpenVPN Access Server – BASH Script to Email an Access Report « KiloRoot
Pingback: Linux Server Boot Partitions Get Full – Simple Script to Email an Alert « KiloRoot
Pingback: DKIM and SPF with Exim4 – Better Mail Delivery « KiloRoot
Hi. Thanks for the this. I was looking for somthing like this. i also followed your post on BASH Script to Email an Access Report .
I need some help.
I have installed exim4 on a server at home behind my router, i have followed your intruction to the T , but no email are send. Must i do some firewall config on my server our open a port on my router?
sorry for my poor english.
Port 25 is going to have to be open outbound. Furthermore, if you are trying to do this on a system at your house, most likely your home internet provider is blocking outbound port 25 traffic. 🙁 – I ran into this same issue while testing a few weeks ago. If that is the case, most likely you will need to do something else. You best bet in that scenario is, if you have a gmail account, then use Google’s SMTP servers to forward/relay email and connect to them on a different port. I don’t have the exact instructions handy but if you do a bit of web searching you should come across something that should explain the process.