Postfix - Virtual Domains
Z wiki linux-user
Linia 221: | Linia 221: | ||
Tworzymy certyfikaty dla dovecot | Tworzymy certyfikaty dla dovecot | ||
− | Jak to zrobić opisane jest | + | Jak to zrobić opisane jest [http://linux-user.eu/wiki/index.php/Postfix#Certyfikaty_TLS postfix#TLS] |
Przenosząc certyfikaty w odpowiednie miejsca | Przenosząc certyfikaty w odpowiednie miejsca | ||
− | ssl_cert_file = /etc/pki/dovecot/certs/myserver.example.com.crt | + | ''ssl_cert_file = /etc/pki/dovecot/certs/myserver.example.com.crt'' |
− | ssl_key_file = /etc/pki/dovecot/private/myserver.example.com.key | + | ''ssl_key_file = /etc/pki/dovecot/private/myserver.example.com.key'' |
− | ssl_ca_file = /etc/pki/dovecot/certs/ca-bundle.crt | + | ''ssl_ca_file = /etc/pki/dovecot/certs/ca-bundle.crt'' |
− | Tworzymy plik /etc/dovecot/sql.conf i edytujemy go, aby wyglądał w następujący sposób: | + | Tworzymy plik ''/etc/dovecot/sql.conf'' i edytujemy go, aby wyglądał w następujący sposób: |
− | driver = mysql | + | driver = mysql |
− | default_pass_scheme = md5 | + | default_pass_scheme = md5 |
− | connect = host=localhost dbname=postfix user=dovecot password=dovecot | + | connect = host=localhost dbname=postfix user=dovecot password=dovecot |
− | user_query = SELECT concat('/var/vmail/', maildir) as home, concat('maildir:/var/vmail/', maildir) as mail, 101 AS uid, 12 AS gid, / | + | user_query = SELECT concat('/var/vmail/', maildir) as home, concat('maildir:/var/vmail/', maildir) as mail, 101 AS uid, 12 AS gid, / |
− | concat('maildir:storage=', quota) AS quota FROM mailbox WHERE username = '%u' AND active = '1' | + | concat('maildir:storage=', quota) AS quota FROM mailbox WHERE username = '%u' AND active = '1' |
− | # fast but now so nice:-) | + | # fast but now so nice:-) |
− | #user_query = SELECT '/var/vmail/%d/%n' as home, 'maildir:/var/vmail/%d/%n' as mail, 101 AS uid, 12 AS gid, / | + | #user_query = SELECT '/var/vmail/%d/%n' as home, 'maildir:/var/vmail/%d/%n' as mail, 101 AS uid, 12 AS gid, / |
− | concat('dirsize:storage=', quota) AS quota FROM mailbox WHERE username = '%u' AND active = '1' | + | concat('dirsize:storage=', quota) AS quota FROM mailbox WHERE username = '%u' AND active = '1' |
− | # Just in case you are using postfix the delimiter char "+", the above query will probably fail for the username / | + | # Just in case you are using postfix the delimiter char "+", the above query will probably fail for the username / |
− | '%n' or '%u' and result in a "5.5.1 user unknown" error | + | '%n' or '%u' and result in a "5.5.1 user unknown" error |
− | #in this case, you will probalby want to use a separate user and domain part, whilst searching only / | + | #in this case, you will probalby want to use a separate user and domain part, whilst searching only / |
− | for the destination user part (user_query only): | + | for the destination user part (user_query only): |
− | # SELECT ... WHERE username = substring_index('%n','+',1) AND userrealm = '%d' | + | # SELECT ... WHERE username = substring_index('%n','+',1) AND userrealm = '%d' |
− | password_query = SELECT username as user, password, concat('/var/vmail/', maildir) as userdb_home, / | + | password_query = SELECT username as user, password, concat('/var/vmail/', maildir) as userdb_home, / |
− | concat('maildir:/var/vmail/', maildir) as userdb_mail, 101 as userdb_uid, 12 as userdb_gid FROM mailbox / | + | concat('maildir:/var/vmail/', maildir) as userdb_mail, 101 as userdb_uid, 12 as userdb_gid FROM mailbox / |
− | WHERE username = '%u' AND active = '1' | + | WHERE username = '%u' AND active = '1' |
− | # fast but now so nice:-) | + | # fast but now so nice:-) |
− | #password_query = SELECT username as user, password, '/var/vmail/%d/%n' as userdb_home, / | + | #password_query = SELECT username as user, password, '/var/vmail/%d/%n' as userdb_home, / |
'maildir:/var/vmail/%d/%n' as userdb_mail, 101 as userdb_uid, 12 as userdb_gid FROM mailbox / | 'maildir:/var/vmail/%d/%n' as userdb_mail, 101 as userdb_uid, 12 as userdb_gid FROM mailbox / | ||
− | WHERE username = '%u' AND active = '1' | + | WHERE username = '%u' AND active = '1' |
− | UWAGA !! linie ze znakiem / są przełamane jeśli będziesz robił kopiuj wklej pamiętaj o połączeniu tych lini | + | UWAGA !! linie ze znakiem ''/'' są przełamane jeśli będziesz robił kopiuj wklej pamiętaj o połączeniu tych lini |
Jeśli zachodzi potrzeba to dostrajamy go do swoich potrzeb. | Jeśli zachodzi potrzeba to dostrajamy go do swoich potrzeb. | ||
− | Kolejny plik który tworzymy to /etc/dovecot/trash.conf i dodajemy do niego | + | Kolejny plik który tworzymy to ''/etc/dovecot/trash.conf'' i dodajemy do niego |
− | 1 Spam | + | 1 Spam |
− | 2 Trash | + | 2 Trash |