by jiggy2011 · 14y ago · 0 comments
This would certainly be useful to me. Earlier this week I attempted to setup of a Linux mailserver from scratch using postfix,dovecot,spamassasin,clamav,sasl etc.
Wow, what a pain in the ass that was, trying to get all the pieces to talk to each other correctly and trying to think of possible security holes.
Most of the help online was either lengthy manuals that were pretty difficult to digest or somebody posting a tutorial basically saying "run these commands and paste this into your config".
Not really ideal.
What I really want to do is:
sudo apt-get install a-working-mail-server-with-sensible-defaults
The idea is to give people a way to express to one another best practices in a way where it can be used directly (so no need for a human to translate that wiki page into automation.. its done). Then it can be measured, refined, and shared.
Debain/Ubuntu have a tasksel for a mail server but I haven't tried it yet. (https://help.ubuntu.com/community/Tasksel) > sudo tasksel install mail-server
I plan on trying some other semi-automated installers like iRedMail (http://www.iredmail.org/) in a VM first.
Use Sendgrid, MailGun, or some other managed email provider and let them deal with the headaches of running mail servers. It's seriously not an industry you want to try and understand or deal with. Setup an account, pay the service usage fees, and know that you're saving yourself a lot of headaches.
All of these services now have good APIs, callback hooks, and statistics to help you track the behavior of your mail traffic without having to write your own parsing pipeline.
Trade money for time when appropriate. Believe me that the time involved to deploy, run, secure, and maintain a flexible and stable mail infrastructure really isn't worth the time better used building a good application.
Howto Forge has some good tutorials (http://www.howtoforge.com/howtos/email).
Its all a question of why you are doing it. If your aiming to learn, then I would recommend using a howto and installing different components. If your running a business... seriously look at just using Google Apps or some other similar system. If you need sending capability then SendGrid and such are suitable for low volume (sub multi-million messages / month).
The biggest problem you are going to face in running your own server is keeping the design up to date.... every year Spam detection methods change, and you need to keep on top of that. Thats what eventually made me pack it in and move my hosting to google. I'm a RHCE and administer and support mail server for a some quite large national brands. But I can't be bothered for my own domain.
If your are or are looking to be a systems guy then LEARN EMAIL (SMTP, POP, IMAP), its one of the core competencies. If your a dev you should know it, but outsourcing the running of it can make sense. Just don't be a fool and outsource it if its the core of your business. If your sending (or recieving) above a certain threshold its almost always cheaper to do it yourself.
It would be quite difficult to write a decent guide in a short space (also I have not quite got my setup correct yet), but make sure you RTFM before you start.
Depending on how many users you have, if you are using postfix it may be easier to just map the users mail accounts to unix accounts rather than use virtual mailhosts (these allow you to designate a single account to store mail which will be divided into seperate folders for different domains/accounts, so useful if you are running many domains/users as you don't have to update main.cnf and change unix settings for each account) .
here is a basic guide (assuming you are not using virtual mailhosts):
http://rimuhosting.com/support/settingupemail.jsp?mta=postfi...
and one on integrating spamassasin:
http://www.akadia.com/services/postfix_spamassassin.html
Of course make extra sure you are not running an open SMTP relay (best way to check for sure is with telnet)!
Also you can setup fail2ban to watch your mail server logs for failed logins and automatically update your firewall rules to keep them out.
http://flurdy.com/docs/postfix/index.html
I actually followed the guide (not just read it) and got a working mail server in a few hours.
For your use case, not really. Installing software on server is a job for configuration management (e.g. puppet, chef). What juju seems to be about is managing the relationships between services, or service orchestration.
http://askubuntu.com/questions/52840/differentiator-between-...