J'écris rapidement ces lignes dans le but de résumer mon installation postfix + imap.

apt-get install postfix courier-imap libsasl2 libauthen-sasl-cyrus-perl sasl2-bin postfix-tls libsasl2-modules postgrey

/etc/postfix/main.cf

# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
# myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = nom machine.mondomaine.tld
#domaine 1

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = localhost.fr, localhost
relayhost = home_mailbox = Maildir/
mynetworks = 127.0.0.0/8, ipdomicile, localhost
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual_alias_domains = domaine 2
virtual_maps = hash:/etc/postfix/virtual
virtual_alias_maps = dbm:/etc/postfix/virtual
virtual_alias_maps = hash:/etc/postfix/virtual
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination,
reject_rbl_client relays.ordb.org,
reject_rbl_client opm.blitzed.org,
reject_rbl_client sbl-xbl.spamhaus.org,
reject_rbl_client bl.spamcop.net,
reject_invalid_hostname,
check_policy_service inet:127.0.0.1:60000

/etc/default/saslauthd

START=yes 
MECHANISMS="shadow"
PARAMS="-r -m /var/spool/postfix/var/run/saslauthd"
Puis tapez :
mkdir -p /var/spool/postfix/var/run/saslauthd 
chown postfix:sasl /var/spool/postfix/var/run/saslauthd
/etc/init.d/saslauthd start

/etc/postfix/virtual

pseudo@domain.tld  localuser
pseudo2@domain.tld mail@mail.com

Puis tapez postmap /etc/postfix/virtual afin d'actualiser les alias

/etc/postfix/sasl/smtpd.conf

pwcheck_method: saslauthd
mech_list: plain login
/etc/init.d/postfix reload

imap

Avec la commande maildirmake, créez votre dossier Maildir à la racine de votre compte.

Le but de ce sujet n'est pas de décrire complétement l'installation mais de résumer les étapes. A savoir qu'avec ça, on a un serveur imap et smtp permettant l'envoi de messages depuis une liste de domaines définis donc pas open relay et d'avoir vos mails dans vos comptes.