sdf
[debienna.git] / LittleMailserver / index.mdwn
index a453e4e..ba18916 100644 (file)
-= Postfix Dovecot Pam =\r
-\r
-''' master.cf '''\r
-\r
-# xxx.xxx.xxx.xxx = ipadresse; um den smtp server auf eine ip zu binden\r
-{{{\r
-xxx.xxx.xxx.xxx:smtp        inet  n       -       -       -       -       smtpd\r
-\r
-dovecot unix    -       n       n       -       -      pipe\r
-  flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient}\r
-}}}\r
-\r
-''' virtual_domains '''\r
-\r
-{{{\r
-example.net ACCEPT\r
-domain.com  ACCEPT\r
-}}}\r
-\r
-postmap /etc/postfix/virtual_domains\r
-\r
-\r
-''' main.cf '''\r
-\r
-{{{\r
-myhostname = mail.example.net\r
-myorigin = /etc/mailname\r
-\r
-virtual_mailbox_domains         = hash:/etc/postfix/virtual_domains\r
-virtual_mailbox_base            = /srv/vmail\r
-\r
-virtual_uid_maps                = static:8\r
-virtual_gid_maps                = static:8\r
-\r
-virtual_transport               = dovecot\r
-\r
-dovecot_destination_recipient_limit = 1\r
-\r
-mydestination = localhost\r
-mynetworks = 127.0.0.0/8,\r
-\r
-smtpd_banner = $myhostname ESMTP Mailserver\r
-\r
-mailbox_size_limit = 512000000\r
-message_size_limit = 10240000\r
-\r
-smtpd_sender_restrictions = reject_unknown_address\r
-smtpd_client_restrictions = reject_invalid_hostname\r
-\r
-smtpd_helo_required = yes\r
-smtpd_helo_restrictions = reject_invalid_hostname,\r
-        reject_non_fqdn_hostname,\r
-        reject_invalid_hostname,\r
-        permit\r
-\r
-smtpd_recipient_restrictions =\r
-        reject_invalid_hostname,\r
-        reject_non_fqdn_hostname,\r
-        reject_non_fqdn_sender,\r
-        reject_non_fqdn_recipient,\r
-        reject_unknown_sender_domain,\r
-        reject_unknown_recipient_domain,\r
-        reject_unauth_destination,\r
-        permit_mynetworks,\r
-        reject_rbl_client list.dsbl.org,\r
-        reject_rbl_client sbl-xbl.spamhaus.org,\r
-        reject_rbl_client cbl.abuseat.org,\r
-        reject_rbl_client dul.dnsbl.sorbs.net,\r
-        permit\r
-\r
-strict_rfc821_envelopes = yes\r
-\r
-home_mailbox = mails/\r
-\r
-#smtpd_tls_cert_file = /etc/postfix/mail.csr\r
-#smtpd_tls_key_file = /etc/postfix/mail.key\r
-\r
-smtpd_use_tls = yes\r
-smtpd_enforce_tls = no\r
-smtpd_tls_auth_only = no\r
-\r
-smtpd_error_sleep_time = 1s\r
-smtpd_soft_error_limit = 10\r
-smtpd_hard_error_limit = 20\r
-\r
-# http://www.mailscanner.info\r
-header_checks = regexp:/etc/postfix/header_checks\r
-body_checks surf to http://www.malware.com.br\r
-\r
-}}}\r
-\r
-''' /etc/postfix/header_checks '''\r
-\r
-{{{\r
-/^Received:/ HOLD\r
-/^X-Spam-Level: (\*){8,}/   REDIRECT sa-spam\r
-}}}\r
-\r
-''' dovecot.cf '''\r
-{{{\r
-base_dir = /var/run/dovecot/\r
-#log_path = /var/log/dovecot.log\r
-protocols = imap\r
-ssl_disable = no\r
-verbose_proctitle = yes\r
-#first_valid_uid = 3000\r
-#last_valid_uid = 3000\r
-#first_valid_gid = 8\r
-#last_valid_gid = 8\r
-#valid_chroot_dirs = /var/mail\r
-mail_location = maildir:~/Maildir\r
-maildir_copy_with_hardlinks = yes\r
-\r
-#protocol imap {\r
-#}\r
-\r
-auth_verbose = yes\r
-\r
-auth default {\r
-        socket listen {\r
-                master {\r
-                path = /var/run/dovecot/auth-master\r
-                mode = 0600\r
-                user = vmail\r
-                }\r
-        }\r
-        mechanisms = plain login\r
-        passdb pam {\r
-        }\r
-        userdb static {\r
-          args = uid=vmail gid=vmail home=/srv/vmail/%u\r
-        }\r
-}\r
-\r
-protocol lda {\r
-        postmaster_address = host@example.net\r
-}\r
-\r
-}}}\r
-''' addmailuser.sh ''' \r
-{{{\r
-#!/bin/sh -x\r
-\r
-echo "usage: $0 <newusername>"\r
-\r
-mkdir /srv/vmail/$1\r
-maildirmake /srv/vmail/$1/Maildir\r
-chown vmail:vmail /srv/vmail/$1 -R\r
-\r
-htpasswd /etc/dovecot/dovecot.passwd $1\r
-}}}\r
-\r
-''' pam.d/dovecot '''\r
-\r
-aptitude install libpam_pwdfile\r
-\r
-{{{\r
-#%PAM-1.0\r
-\r
-auth required pam_pwdfile.so pwdfile=/etc/dovecot/dovecot.passwd debug\r
-\r
-session sufficient pam_permit.so\r
-account sufficient pam_permit.so\r
-\r
-#@include common-auth\r
-#@include common-account\r
-#@include common-session\r
-}}}\r
-\r
-{{{\r
-aptitude install policyd-weight\r
-}}}\r
-\r
-[[http://rikman.mtb-news.de/archives/2005/12/13/postgrey-unter-debian-einrichten/|postgrey-unter-debian-einrichten]]\r
-\r
-[[http://packages.debian.org/etch/mailscanner|MailScanner Debian-package]]\r
-\r
-[[http://www.delodder.be/index.php/2007/10/18/mailscanner-with-postfix-on-etch/#more-86|MailScanner With Postfix on Etch]]\r
-\r
-[[http://www.delodder.be/index.php/2007/10/22/add-anti-virus-support-to-mailscanner/#more-88|Add Anti-Virus support to MailScanner]]\r
-\r
-\r
-\r
-Um noch den Usern zu ermöglichen ihre Mails über den Server zu relayen sollte man eine SMTP Authentifizierung benutzen. Falls die Clients statisce IPs besitzen kann man diese natürlich auch in der main.cf unter my_networks eintragen. Wie eine mögliche SMTP Auth ausehen kann findet sich unter [[LittleMailserverSMTP]]\r
-\r
-----\r
-CategoryCodeSnippets CategoryTipsAndTricks
\ No newline at end of file
+
+
+# Postfix Dovecot Pam
+
+** master.cf **
+
+# xxx.xxx.xxx.xxx = ipadresse; um den smtp server auf eine ip zu binden
+[[!format txt """
+xxx.xxx.xxx.xxx:smtp        inet  n       -       -       -       -       smtpd
+
+dovecot unix    -       n       n       -       -      pipe
+  flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient}
+"""]]
+** virtual_domains **
+
+
+[[!format txt """
+example.net ACCEPT
+domain.com  ACCEPT
+"""]]
+postmap /etc/postfix/virtual_domains
+
+** main.cf **
+
+
+[[!format txt """
+myhostname = mail.example.net
+myorigin = /etc/mailname
+
+virtual_mailbox_domains         = hash:/etc/postfix/virtual_domains
+virtual_mailbox_base            = /srv/vmail
+
+virtual_uid_maps                = static:8
+virtual_gid_maps                = static:8
+
+virtual_transport               = dovecot
+
+dovecot_destination_recipient_limit = 1
+
+mydestination = localhost
+mynetworks = 127.0.0.0/8,
+
+smtpd_banner = $myhostname ESMTP Mailserver
+
+mailbox_size_limit = 512000000
+message_size_limit = 10240000
+
+smtpd_sender_restrictions = reject_unknown_address
+smtpd_client_restrictions = reject_invalid_hostname
+
+smtpd_helo_required = yes
+smtpd_helo_restrictions = reject_invalid_hostname,
+        reject_non_fqdn_hostname,
+        reject_invalid_hostname,
+        permit
+
+smtpd_recipient_restrictions =
+        reject_invalid_hostname,
+        reject_non_fqdn_hostname,
+        reject_non_fqdn_sender,
+        reject_non_fqdn_recipient,
+        reject_unknown_sender_domain,
+        reject_unknown_recipient_domain,
+        reject_unauth_destination,
+        permit_mynetworks,
+        reject_rbl_client list.dsbl.org,
+        reject_rbl_client sbl-xbl.spamhaus.org,
+        reject_rbl_client cbl.abuseat.org,
+        reject_rbl_client dul.dnsbl.sorbs.net,
+        permit
+
+strict_rfc821_envelopes = yes
+
+home_mailbox = mails/
+
+#smtpd_tls_cert_file = /etc/postfix/mail.csr
+#smtpd_tls_key_file = /etc/postfix/mail.key
+
+smtpd_use_tls = yes
+smtpd_enforce_tls = no
+smtpd_tls_auth_only = no
+
+smtpd_error_sleep_time = 1s
+smtpd_soft_error_limit = 10
+smtpd_hard_error_limit = 20
+
+# http://www.mailscanner.info
+header_checks = regexp:/etc/postfix/header_checks
+body_checks surf to http://www.malware.com.br
+
+"""]]
+** /etc/postfix/header_checks **
+
+
+[[!format txt """
+/^Received:/ HOLD
+/^X-Spam-Level: (\*){8,}/   REDIRECT sa-spam
+"""]]
+** dovecot.cf **
+[[!format txt """
+base_dir = /var/run/dovecot/
+#log_path = /var/log/dovecot.log
+protocols = imap
+ssl_disable = no
+verbose_proctitle = yes
+#first_valid_uid = 3000
+#last_valid_uid = 3000
+#first_valid_gid = 8
+#last_valid_gid = 8
+#valid_chroot_dirs = /var/mail
+mail_location = maildir:~/Maildir
+maildir_copy_with_hardlinks = yes
+
+#protocol imap {
+#}
+
+auth_verbose = yes
+
+auth default {
+        socket listen {
+                master {
+                path = /var/run/dovecot/auth-master
+                mode = 0600
+                user = vmail
+                }
+        }
+        mechanisms = plain login
+        passdb pam {
+        }
+        userdb static {
+          args = uid=vmail gid=vmail home=/srv/vmail/%u
+        }
+}
+
+protocol lda {
+        postmaster_address = host@example.net
+}
+
+"""]]
+** addmailuser.sh **
+[[!format txt """
+#!/bin/sh -x
+
+echo "usage: $0 <newusername>"
+
+mkdir /srv/vmail/$1
+maildirmake /srv/vmail/$1/Maildir
+chown vmail:vmail /srv/vmail/$1 -R
+
+htpasswd /etc/dovecot/dovecot.passwd $1
+"""]]
+** pam.d/dovecot **
+
+aptitude install libpam_pwdfile
+
+
+[[!format txt """
+#%PAM-1.0
+
+auth required pam_pwdfile.so pwdfile=/etc/dovecot/dovecot.passwd debug
+
+session sufficient pam_permit.so
+account sufficient pam_permit.so
+
+#@include common-auth
+#@include common-account
+#@include common-session
+"""]]
+
+[[!format txt """
+aptitude install policyd-weight
+"""]]
+[[postgrey-unter-debian-einrichten|http://rikman.mtb-news.de/archives/2005/12/13/postgrey-unter-debian-einrichten/]]
+
+[[MailScanner Debian-package|http://packages.debian.org/etch/mailscanner]]
+
+[[MailScanner With Postfix on Etch|http://www.delodder.be/index.php/2007/10/18/mailscanner-with-postfix-on-etch/#more-86]]
+
+[[Add Anti-Virus support to MailScanner|http://www.delodder.be/index.php/2007/10/22/add-anti-virus-support-to-mailscanner/#more-88]]
+
+Um noch den Usern zu ermöglichen ihre Mails über den Server zu relayen sollte man eine SMTP Authentifizierung benutzen. Falls die Clients statisce IPs besitzen kann man diese natürlich auch in der main.cf unter my_networks eintragen. Wie eine mögliche SMTP Auth ausehen kann findet sich unter [[LittleMailserverSMTP|LittleMailserverSMTP]]
+
+
+
+ [[!tag CategoryCodeSnippets]] [[!tag CategoryTipsAndTricks]]