Postfix
Zur Navigation springen
Zur Suche springen
vorarbeiten
- mkdir -p /etc/skel/Maildir/{cur,new,tmp}
installation
- apt-get install postfix dovecot-core dovecot-imapd
spätere grundkonfiguration
- dpkg-reconfigure -p low postfix
wir wählen Internet-Site
/etc/postfix/main.cf
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no append_dot_mydomain = no readme_directory = no 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:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination myhostname = maria.xinux.org alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = maria.xinux.org, localhost.xinux.org, , localhost relayhost = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all inet_protocols = ipv4
Maildirformat
home_mailbox=Maildir/ mailbox_command =
auswahl der postfix kommandos
- postfix status
- postfix start
- postfix stop
- postfix reload
- postfix check
logging
- tail -f /var/log/mail.log
Dec 11 13:20:55 maria postfix/smtpd[7513]: connect from cardassia.xinux.org[192.168.244.1] Dec 11 13:20:55 maria postfix/smtpd[7513]: improper command pipelining after EHLO from cardassia.xinux.org[192.168.244.1]: MAIL FROM: <technik@xinux.de>\nRCPT TO: <mario@maria.xinux.org>\nDATA\nFrom: <technik@xinux.de>\nTo: <ma Dec 11 13:20:55 maria postfix/smtpd[7513]: 3B56724046: client=cardassia.xinux.org[192.168.244.1] Dec 11 13:20:55 maria postfix/cleanup[7518]: 3B56724046: message-id=<> Dec 11 13:20:55 maria postfix/qmgr[7280]: 3B56724046: from=<technik@xinux.de>, size=315, nrcpt=1 (queue active) Dec 11 13:20:55 maria postfix/smtpd[7513]: disconnect from cardassia.xinux.org[192.168.244.1] Dec 11 13:20:55 maria postfix/local[7519]: 3B56724046: to=<mario@maria.xinux.org>, relay=local, delay=0.14, delays=0.13/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox) Dec 11 13:20:55 maria postfix/qmgr[7280]: 3B56724046: removed
installieren von mailutis
- apt-get install mailutils
lokales lesen der mails
mario@maria:~$ mail
"/var/mail/mario": 5 messages 5 unread >U 1 technik@xinux.de Do Dez 11 11:48 14/433 test1 U 2 technik@xinux.de Do Dez 11 11:49 13/408 test1 U 3 technik@xinux.de Do Dez 11 13:19 13/431 Do 11. Dez 13:19:42 CET 2 U 4 technik@xinux.de Do Dez 11 13:20 13/431 Do 11. Dez 13:20:00 CET 2 U 5 technik@xinux.de Do Dez 11 13:20 13/431 Do 11. Dez 13:20:55 CET 2 ? 5Return-Path: <technik@xinux.de> X-Original-To: mario@maria.xinux.org Delivered-To: mario@maria.xinux.org Received: from cardassia (cardassia.xinux.org [192.168.244.1]) by maria.xinux.org (Postfix) with ESMTP id 3B56724046 for <mario@maria.xinux.org>; Thu, 11 Dec 2014 13:20:55 +0100 (CET) From: <technik@xinux.de> To: <mario@maria.xinux.org> Subject: Do 11. Dez 13:20:55 CET 2014 Status: O X-UID: 5 Do 11. Dez 13:20:55 CET 2014 ? q
sasl
- Wir nutzen dovecot für SASL
- vi /etc/dovecot/conf.d/10-master.conf
service auth { } # Postfix smtp-auth unix_listener /var/spool/postfix/private/auth { mode = 0660 user = postfix group = postfix } ... }
- vi /etc/dovecot/conf.d/10-auth.conf
auth_mechanisms = plain login
Postfix Änderung
- vi /etc/postfix/main.cf
smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth smtpd_sasl_auth_enable = yes
Dienste neustarten
- systemctl restart postfix
- systemctl restart dovecot
ssl
- mkdir /etc/postfix/ssl
- cp /root/xin-ca.crt /etc/postfix/ssl
- cp /root/xin-ca-maria.xinux.org.crt /etc/postfix/ssl
- cp /root/xin-ca-maria.xinux.org.key /etc/postfix/ssl
Nun muß TLS noch aktiviert werden. Hierzu werden folgende Einträge in der main.cf benötigt
# aktiviert STARTTLS wenn Postfix Server ist: smptd_use_tls = yes # Loggt (nicht) in den Received-Zeilen: smtpd_tls_received_header = no smtpd_tls_key_file = /etc/postfix/ssl/xin-ca-maria.xinux.org.key smtpd_tls_cert_file = /etc/postfix/ssl/xin-ca-maria.xinux.org.crt smtpd_tls_CA_file = /etc/postfix/ssl/xin-ca.crt # Aktiviert STARTTLS wenn Postfix ausliefert: smtp_use_tls = yes smtp_tls_key_file = /etc/postfix/ssl/xin-ca-maria.xinux.org.key smtp_tls_cert_file = /etc/postfix/ssl/xin-ca-maria.xinux.org.crt smtp_tls_CA_file = /etc/postfix/ssl/xin-ca.crt