Check package status
First of all, check the package status:
# emerge -pv mail-mta/postfix
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild N ] mail-mta/postfix-2.4.6-r2 USE="pam ssl -cdb -dovecot-sasl -hardened -ipv6 -ldap -mailwrapper -mbox -mysql -nis -postgres -sasl (-selinux) -vda" 2,867 kB
[blocks B ] mail-mta/ssmtp (is blocking mail-mta/postfix-2.4.6-r2)
[blocks B ] mail-mta/postfix (is blocking mail-mta/ssmtp-2.61-r2)
Total: 1 package (1 new, 2 blocks), Size of downloads: 2,867 kB
Fix the package blocking
The blocking is not funny. Check ssmtp package status:
# emerge -pv mail-mta/ssmtp
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild R ] mail-mta/ssmtp-2.61-r2 USE="ssl -ipv6 -mailwrapper -md5sum" 0 kbTotal: 1 package (1 reinstall), Size of downloads: 0 kB
We will have to unmerge ssmtp. Check its depencies before we unmerge:
# equery depends mail-mta/ssmtp
app-admin/sudo-1.6.8_p12-r1 (virtual/mta)
sys-process/vixie-cron-4.1-r10 (virtual/mta)
This shows that sudo and vixie-cron have virtual dependencies on ssmtp. It's fine to remove ssmtp for now.
Unmerge ssmtp:
# emerge --unmerge mail-mta/ssmtp
Check again to make sure postfix is not ok to install:
# emerge -pv postfix
Install postfix:
Add these lines to /etc/portage/package.use:
mail-mta/postfix cdb dovecot-sasl mysql sasl ldap
dev-libs/cyrus-sasl berkdb -gdbm mysql
net-nds/openldap -gdbm sasl
Then emerge
# emerge -v mail-mta/postfix
* An example file for tuning BDB backends with openldap is:
* /usr/share/doc/openldap-2.3.41/DB_CONFIG.fast.example.gz
*
* //etc/openldap/ssl/ldap.key: exists, skipping
* Some requested certificates were not generated
* Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]
* Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]
* add 'TLS_REQCERT never' if you want to use them.
* You must edit /etc/mail/aliases to suit your needs
* and then run /usr/bin/newaliases. Postfix will not
* work correctly without it.
Now let's see if postfix would fix the dependencies on ssmtp:
# equery d postfix
[ Searching for packages depending on postfix... ]
app-admin/sudo-1.6.8_p12-r1 (virtual/mta)
sys-process/vixie-cron-4.1-r10 (virtual/mta)
This is good. The broken depencies are fixed and we are now in business to move on.
Configure postfix
Follow Virtual Mailhosting System with Postfix Guide to make sure that postfix can run properly, before we proceed to Dovecot.
To install a console mail client to test out the postfix installation, you can try mutt.
#emerge -pv mutt
#emerge -v mutt
Then Read QuickStart Guide to Mutt E-Mail for getting started on using mutt.
Install dovecot
Add this line to /etc/portage/package.use:
net-mail/dovecot mysql ldap pop3d
Don't add vpopmail to the USE tag, as that's a qmail thing, which will block postfix again.
Now verify that it will install fine, and then install:
# emerge -pv dovecot
# emerge -v dovecot
* Messages for package net-mail/dovecot-1.1.1-r1:
* The Dovecot configuration has vastly changed since 0.99.
* You are encouraged to start afresh with a new configuration file.
* see http://wiki.dovecot.org/ for configuration examples.
* Dovecot requires DH SSL Parameters if you use SSL connections
* These take some time to make, and dovecot will create them before
* it allows any SSL connections.
* You can create them now before starting dovecot like so
* emerge --config =dovecot-1.1.1-r1
* GNU info directory index is up-to-date.