Problem
- I want to have my own email server and have my server send emails automatically to me.
- I don't like the preinstalld sendmail because it didn't work as it was supposed to and I gave up configuring it.
- Right now I do not want any encryption / spam protection etc. since this is not a big public server that hosts mailinglists or so.
- These options might be added later.
- If you are (like me) a normal ADSL (in Germany called TDSL) user you need to have your server setup with for example dyndns so you have a nice URL that is always the same.
- I am on a Free BSD 5.3 machine.
- This is quick and dirty ...
Solution
- be sure to have the newest portstree, type:
- cvsup -g yourPortsSupFile
- go to /usr/ports/mail/postfix by writing:
- cd /usr/ports/mail/postfix
- start installation by:
- make install clean
- add the SSL and TLS configuration and (for later use) SAS Lv 2?
- note: Here we do not use a database because I am not planning on having lots of users
- after installation has finished, go to your /etc/rc.conf and add the following lines:
- postfix_enable="YES"
sendmail_enable="YES"
sendmail_flags="-bd"
sendmail_pidfile="/var/spool/postfix/pid/master.pid"
sendmail_outbound_enable="NO"
sendmail_submit_enable="NO"
sendmail_msp_queue_enable="NO"
- Now we need to tell postfix our domain name, by adding the following lines in the /usr/local/etc/postfix/main.cf
- mydomain = rso.mine.nu
- myhostname = rso.mine.nu (where you have to substitute rso.mine.nu with your dyndns address of course)
- Then type
- postfix start
- Then we'll get a couple of errors because it cannot find aliases, type:
- newaliases
- make sure that you have only one newaliases which is the one from postfix, by typing
- which newaliases
- That's it for now, I am not able to restart my server now since I am not at home, so perhaps the rc.conf entries are not working, if so change sendmail_enable=\"YES\" to sendmail_enable=\"NO\" or sendmail_enable=\"NONE\"
How to test if Postfix is working:
- type
- mail your@email.com
- Add the subject
- type your body
- press ctrl+d to send the mail
- Check the inbox of your mail address, if it is not there you might look for errors under
- /var/log/maillog
References
- too many... just google