In addition to my previous article about installing PostfixAdmin, I am now summing up my findings that I picked up along the way of installing Postfix, Dovecot and and Roundcube on my Bitnami LAMP stack.
To get it all working I had to go over a dozen of articles and tutorials, and a few days and some headaches later I was finally able to send and receive mail, although there
First and foremost, if you have followed some sort of tutorial, and haven’t got it working, I suggest you start from scratch. But even removing Postfix and Dovecot can be troublesome.
How to remove APT packages completely
When I was trying to remove and reinstall Dovecot I got the following kind of error messages:
Not replacing deleted config file /etc/dovecot/dovecot.conf
sudo apt-get remove dovecot-core dovecot-imapd
sudo dpkg -P dovecot-core
sudo dpkg -P dovecot-imapd
sudo rm -rf /etc/dovecot
sudo rm -rf /var/lib/dovecot
sudo apt-get --purge autoremove
sudo apt-get --purge autoclean
Then finally reinstalling with the following command:
sudo apt-get install dovecot-core dovecot-imapd
You will see the following kind of messages when it finally works:
Creating config file /etc/dovecot/dovecot.conf with new version
Basically, there is not much to it, however the configuration of Postfix is where the finetuning goes. First of all execute the following command to install it:
sudo apt-get install postfix
sudo postconf -e 'smtpd_sasl_local_domain ='
sudo postconf -e 'smtpd_sasl_auth_enable = yes'
sudo postconf -e 'smtpd_sasl_security_options = noanonymous'
sudo postconf -e 'broken_sasl_auth_clients = yes'
sudo postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination'
sudo postconf -e 'inet_interfaces = all'
sudo postconf -e 'smtp_tls_security_level = may'
sudo postconf -e 'smtpd_tls_security_level = may'
sudo postconf -e 'smtpd_tls_auth_only = no'
sudo postconf -e 'smtp_tls_note_starttls_offer = yes'
sudo postconf -e 'smtpd_tls_key_file = /opt/bitnami/apache2/conf/server.key'
sudo postconf -e 'smtpd_tls_cert_file = /opt/bitnami/apache2/conf/server.crt'
sudo postconf -e 'smtpd_tls_CAfile = /etc/ssl/certs/ca-certificates.crt'
sudo postconf -e 'smtpd_tls_loglevel = 1'
sudo postconf -e 'smtpd_tls_received_header = yes'
sudo postconf -e 'smtpd_tls_session_cache_timeout = 3600s'
sudo postconf -e 'tls_random_source = dev:/dev/urandom'
sudo postconf -e 'myhostname = yourdomain.com'