Just so everyone knows, linux systems are supposed to talk to you. They should at least tell you if something goes wrong with your system, or if a cron job fails (of course, this is very configurable). Unfortunately, the email system cannot be set up without human intervention.
There are many possible postfix configurations, but the easiest and most succinct I have seen (at least for a gentoo user) is right here. It uses your gmail account to give you access to google’s mail servers (which is very much like using KMail or Outlook to send messages). Alternatives exist (such as using your isp’s smtp server), but this setup is the best option for me.
In case you get an error like this “No such file or directory:bss_file.c:352:fopen(‘./demoCA/serial’,’r’)” while creating your certifier of server certificates (/etc/ssl/misc/CA.pl -newca), be smart, and read the error just above it. Don’t waste time trying to search for what to do about it, like me.
In my case, the error was “The commonName field needed to be supplied and was missing.” This means that I didn’t enter my name into the certificate, which makes a lot of sense.
I’m looking forward to spamming myself.
P.S. – I think that only two changes would be necessary to use this guide on any linux box – don’t use emerge to install postfix, and find out where CA.pl is on your system.
Also, don’t forget to make sure that postfix starts up on boot (using rc-update on gentoo, update-rc.d on debian-based systems).