Instalace Postfixu a Dovecot

apt-get install postfix

pozor na správné vyplnění myhostname, mydomain a myorigin

main.cf:

virtual_transport=lmtp:unix:private/dovecot-lmtp

autorizaci bude dělat dovecot

smtpd_sasl_type=dovecot

smtpd_sasl_path=private/auth

smtpd_sasl_auth_enable=yes

smtpd_tls_auth_only=yes

virtual_mailbox_domains=/etc/postfix/virtual_mailbox_domains – do souboru vyplnit domény, které budeme obsluhovat ve formátu doména OK

virtual_alias_maps=/etc/postfix/virtual_alias_maps – do souboru vyplnit adresy ve formátu alias@domain.com uzivatel@domain.com

zavolat postmap /etc/postfix/virtual_mailbox_domains, postmap /etc/postfix/virtual_alias_maps

master.cf

povolit řádek se submission a smtps (pouze první řádek)

apt-get install dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd

10-mail.conf

mail_location=maildir:/var/mail/vhosts/%d/%n

mkdir /var/mail/vhosts

groupadd –g 5000 vmail

useradd –r –g vmail –u 5000 vmail –d /var/mail/vhosts –c “Virtual mail user”

chown –R vmail:vmail /var/mail/vhosts

10-master.conf

service imap-login { inet_listener imap { #port = 143 } inet_listener imaps { port = 993 ssl = yes }

service pop3-login { inet_listener pop3 { #port = 110 } inet_listener pop3s { port = 995 ssl = yes } }

service lmtp { unix_listener /var/spool/postfix/private/dovecot-lmtp { mode = 0600 user = postfix group = postfix }

service auth { ….. # Postfix smtp-auth unix_listener /var/spool/postfix/private/auth { mode = 0666 user=postfix group=postfix }

10-auth.conf

disable_plaintext_auth=yes

auth_mechanisms=plain login

!include auth-passwdfile.conf.ext

/etc/dovecot/conf.d/auth-passwdfile.conf.ext

passdb { driver = passwd-file args = scheme=PLAIN username_format=%u /etc/dovecot/dovecot-users } userdb { driver = static # args = username_format=%u /etc/dovecot/dovecot-users args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n # Default fields that can be overridden by passwd-file #default_fields = quota_rule=*:storage=1G # Override fields from passwd-file #override_fields = home=/home/virtual/%u }

dovecot-users

nekdo@nekde.com:{plain}1234

generování hesel: doveadm pw –s MD5-CRYPT

10-ssl.conf

ssl=required

ssl_cert=…

ssl_key=…

10-logging.conf

log_path=/var/log/dovecot.log

/etc/logrotate.d/dovecot

/var/log/dovecot*.log { missingok notifempty delaycompress sharedscripts postrotate doveadm log reopen endscript }

Pokračovat ve čteníInstalace Postfixu a Dovecot