Hallo zusammen,
ich bin sonst nicht der Typ, der gleich rumheult und um Hilfe fragt, wenn er mal ins Stocken gerät, aber nachdem ich nun jahrelang nur passiver Mitleser war und meine Wehwehchen letztendlich immer selbst in den Griff bekommen konnte, sieht es so aus, als würde ich derzeit scheitern, weshalb ich um Eure Unterstützung bitte.
Ich versuche, auf dem Server eines Freundes Postfix so einzustellen, daß externer Mailversand über securesmtp.t-online.de möglich wird. Dieser soll dazu dienen, Warnungen von "smartd" und "mdadm" per eMail zu versenden, wenn der Server Bauchschmerzen bekommen sollte. Mailempfang ist dagegen nicht erforderlich. Ich hatte hier (letzter Beitrag ganz unten) bereits einen zunächst vielversprechend klingenden Lösungsansatz gefunden, aber bei mir will er auch nach Anpassung einiger Parameter einfach nicht funktionieren.
Um das zum Einsatz kommende Mail-Konto auf grundsätzliche Funktionalität hin zu prüfen, habe ich mit Hilfe dieser und dieser Seite einen erfolgreichen Test über telnet durchgeführt. Konkret sah das (leicht anonymisiert) so aus :
root@server:/etc/postfix# root@server:/etc/postfix# perl -MMIME::Base64 -e 'print encode_base64("\000mailprefix\@t-online.de\000kennwort")' gehashtes_ergebnis root@server:/etc/postfix# root@server:/etc/postfix# openssl s_client -starttls smtp -crlf -connect securesmtp.t-online.de:587 CONNECTED(00000003) depth=2 C = US, O = "VeriSign, Inc.", OU = VeriSign Trust Network, OU = "(c) 2006 VeriSign, Inc. - For authorized use only", CN = VeriSign Class 3 Public Primary Certification Authority - G5 verify error:num=20:unable to get local issuer certificate verify return:0 --- Certificate chain 0 s:/C=DE/ST=Hessen/L=Darmstadt/O=Deutsche Telekom AG/OU=P&I AM/DCS/CN=securesmtp.t-online.de i:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=Terms of use at https://www.verisign.com/rpa (c)10/CN=VeriSign Class 3 International Server CA - G3 1 s:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=Terms of use at https://www.verisign.com/rpa (c)10/CN=VeriSign Class 3 International Server CA - G3 i:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2006 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G5 2 s:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2006 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G5 i:/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority --- Server certificate -----BEGIN CERTIFICATE----- MIIFZTCCBE2gAwIBAgIQKzwSKzN0Sp3Vur4H5kF28DANBgkqhkiG9w0BAQUFADCB vDELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTswOQYDVQQLEzJUZXJtcyBvZiB1c2Ug YXQgaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3JwYSAoYykxMDE2MDQGA1UEAxMt VmVyaVNpZ24gQ2xhc3MgMyBJbnRlcm5hdGlvbmFsIFNlcnZlciBDQSAtIEczMB4X DTEyMDkxNzAwMDAwMFoXDTE0MTAyMTIzNTk1OVowgYYxCzAJBgNVBAYTAkRFMQ8w DQYDVQQIEwZIZXNzZW4xEjAQBgNVBAcUCURhcm1zdGFkdDEcMBoGA1UEChQTRGV1 dHNjaGUgVGVsZWtvbSBBRzETMBEGA1UECxQKUCZJIEFNL0RDUzEfMB0GA1UEAxQW c2VjdXJlc210cC50LW9ubGluZS5kZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC AQoCggEBAKqgZXoWppciGbsy/mSNgZBckKdpgxBk8nsl6FxMHPi6V12SbNdmtzJ8 McXxZvAYGFdFfeDb7i4bRDSVXDfKBfktcTmIfmmbgHIih+0WOU97xN1mNqkCBFnz 4YpaDuH4upRagKLPO9yucDdNAubyAneDRGNSEYFHa8lhdjJrk11vw8ptf6aebF6g Dip4XQwJm+KissuOnzO4FfBKB00UonyFNRYQ4mnSSiczWmbBgTrnMuDYL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=Deutsche Telekom AG/OU=P&I AM/DCS/CN=securesmtp.t-online.de issuer=/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=Terms of use at https://www.verisign.com/rpa (c)10/CN=VeriSign Class 3 International Server CA - G3 --- No client certificate CA names sent --- SSL handshake has read 4787 bytes and written 587 bytes --- New, TLSv1/SSLv3, Cipher is DES-CBC3-SHA Server public key is 2048 bit Secure Renegotiation IS supported Compression: zlib compression Expansion: zlib compression SSL-Session: Protocol : TLSv1 Cipher : DES-CBC3-SHA Session-ID: F7AFE1EF461D03C3B11AD22BF92395A037DDA33B6B5B3E57533BE7C40C8F666C Session-ID-ctx: Master-Key: F7463BB8BBDC69A5B7A500BAE085EA8F07E546518BD8776CD5102B9F8E5E39132D6A722195219CD50AE72D3661565994 Key-Arg : None PSK identity: None PSK identity hint: None SRP username: None TLS session ticket: 0000 - 6e f5 a8 97 79 30 7a 4a-8f 47 b3 29 92 bb b3 37 n...y0zJ.G.)...7 0010 - a8 d2 75 fc be 6a 0f 15-4e d6 6a 15 a4 d5 15 5b ..u..j..N.j....[ 0020 - ae 5c e2 25 43 0c 42 a8-1b c9 26 7c 31 b3 eb 75 .\.%C.B...&|1..u 0030 - 8c 2f 75 43 f3 95 4d c1-8f 96 58 2f 55 81 57 0e ./uC..M...X/U.W. 0040 - 54 5e 46 b0 cd eb d6 2b-17 fb 8a 38 96 d4 0d 17 T^F....+...8.... 0050 - 80 7f ce 75 3b d8 01 a8-9d 23 b2 4d aa 4e a4 bb ...u;....#.M.N.. 0060 - 5d 62 44 b7 25 88 90 84-e3 fc 2e 1a 31 dd 96 cf ]bD.%.......1... 0070 - 4f b6 3e 78 ad 87 09 1e-0c 7b a5 8f 70 5d b0 41 O.>x.....{..p].A 0080 - 53 88 96 a7 45 9b 46 94-7e fc ff a8 6b 2b f9 4d S...E.F.~...k+.M 0090 - b8 2b 42 99 6b bd 64 b0-a5 c9 79 46 a3 cc c8 99 .+B.k.d...yF.... Compression: 1 (zlib compression) Start Time: 1362209488 Timeout : 300 (sec) Verify return code: 20 (unable to get local issuer certificate) --- 250 HELP auth plain gehashtes_ergebnis 235 2.5.0 Authentication successful. mail from:<mailprefix@t-online.de> 250 2.1.0 Sender accepted. rcpt to:<meine@mailadresse.de> 250 2.1.5 Recipient accepted. data 354 Ok, start with data. From: Server <mailprefix@t-online.de> To: Hammi <meine@mailadresse.de> Subject: Aua aua !!! Meine rechte untere Festplatte tut mir so weh. Hol mal den Arzt, bitte ! . 250 2.0.0 Message accepted. quit 221 2.0.0 fwd52.t-online.de closing. / Closing. closed root@server:/etc/postfix# root@server:/etc/postfix#
Nun muß "nur" noch Postfix so justiert werden, damit es sich genauso benimmt. Aber das kriege ich einfach nicht hin. In meinem /etc/postfix - Verzeichnis sieht's grad so aus :
root@server:/etc/postfix# root@server:/etc/postfix# ls -rtl insgesamt 132 drwxr-xr-x 2 root root 4096 Okt 23 12:10 sasl -rwxr-xr-x 1 root root 26498 Okt 23 12:10 post-install -rwxr-xr-x 1 root root 8729 Okt 23 12:10 postfix-script -rw-r--r-- 1 root root 19707 Okt 23 12:10 postfix-files -rw-r--r-- 1 root root 274 Jan 9 15:07 dynamicmaps.cf -rw-r--r-- 1 root root 5531 Jan 9 15:07 master.cf -rw-r--r-- 1 root root 30 Mär 1 15:17 sender_canonical -rw-r--r-- 1 root root 12288 Mär 1 15:17 sender_canonical.db -rw------- 1 root root 52 Mär 1 17:57 sasl_password -rw------- 1 root root 12288 Mär 1 17:57 sasl_password.db -rw-r--r-- 1 root root 1786 Mär 3 07:28 main.cf -rw-r--r-- 1 root root 41 Mär 3 07:30 generic -rw-r--r-- 1 root root 12288 Mär 3 07:31 generic.db root@server:/etc/postfix#
Der Inhalt der Konfigurationsdateien sieht (leicht anonymisiert) so aus :
root@server:/etc/postfix# root@server:/etc/postfix# cat 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 readme_directory = /usr/share/doc/postfix # 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:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_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 = server alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = selbstgewaehltername.local, localhost.localdomain, localhost relayhost = securesmtp.t-online.de:587 mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = loopback-only html_directory = /usr/share/doc/postfix/html inet_protocols = all smtp_use_tls = yes smtp_tls_security_level = encrypt smtp_sasl_security_options = smtp_sasl_mechanism_filter = login smtp_sasl_tls_security_options = noanonymous smtp_sasl_tls_verified_security_options = smtp_sasl_password_maps = hash:/etc/postfix/sasl_password tls_random_source = dev:/dev/urandom masquerade_domains = t-online.de sender_canonical_maps = hash:/etc/postfix/sender_canonical smtp_generic_maps = hash:/etc/postfix/generic root@server:/etc/postfix# root@server:/etc/postfix# cat sender_canonical root root@server.selbstgewaehltername.local root@server:/etc/postfix# root@server:/etc/postfix# cat sasl_password securesmtp.t-online.de mailprefix@t-online.de:kennwort root@server:/etc/postfix# root@server:/etc/postfix# cat generic @server.selbstgewaehltername.local mailprefix@t-online.de root@server:/etc/postfix# root@server:/etc/postfix# cat /etc/aliases # See man 5 aliases for format postmaster: root root@server:/etc/postfix# root@server:/etc/postfix# cat /etc/mailname t-online.de root@server:/etc/postfix#
Wenn man mit diesen Einstellungen mit dem Kommando
mailx -s Test meine@mailadresse.de </etc/hosts
eine Testnachricht verschicken will, dann erhält man in /var/log/mail.log diese Ausgaben :
Mar 3 07:31:43 server postfix/pickup[12269]: B1BE0381161: uid=0 from=<root> Mar 3 07:31:43 server postfix/cleanup[12273]: B1BE0381161: message-id=<20130303063143.B1BE0381161@server> Mar 3 07:31:43 server postfix/qmgr[12268]: B1BE0381161: from=<root@server.selbstgewaehltername.local>, size=569, nrcpt=1 (queue active) Mar 3 07:31:44 server postfix/smtp[12275]: B1BE0381161: to=<meine@mailadresse.de>, relay=sfwdallmx.t-online.de[194.25.134.110]:587, delay=0.71, delays=0.03/0.03/0.59/0.06, dsn=5.7.0, status=bounced (host sfwdallmx.t-online.de[194.25.134.110] said: 530 5.7.0 Authentication required. (in reply to MAIL FROM command)) Mar 3 07:31:44 server postfix/cleanup[12273]: 89FF73812C5: message-id=<20130303063144.89FF73812C5@server> Mar 3 07:31:44 server postfix/qmgr[12268]: 89FF73812C5: from=<>, size=2374, nrcpt=1 (queue active) Mar 3 07:31:44 server postfix/bounce[12277]: B1BE0381161: sender non-delivery notification: 89FF73812C5 Mar 3 07:31:44 server postfix/qmgr[12268]: B1BE0381161: removed Mar 3 07:31:45 server postfix/smtp[12275]: 89FF73812C5: to=<root@server.selbstgewaehltername.local>, relay=sfwdallmx.t-online.de[194.25.134.46]:587, delay=0.69, delays=0/0/0.61/0.07, dsn=5.7.0, status=bounced (host sfwdallmx.t-online.de[194.25.134.46] said: 530 5.7.0 Authentication required. (in reply to MAIL FROM command)) Mar 3 07:31:45 server postfix/qmgr[12268]: 89FF73812C5: removed
Könnt Ihr mir sagen, an welcher Stelle da der Wurm drin ist, sprich welche Postfix-Parameter geändert und/oder gelöscht werden müssen ?
Vielen Dank im Voraus und Schöne Grüße,
Hammi