Problem beim E-Mail-Versand und SSL

Status
Für weitere Antworten geschlossen.

Frank70

Benutzer
Mitglied seit
17. Feb 2012
Beiträge
61
Punkte für Reaktionen
0
Punkte
6
Meine E-Mails werden ja nun endlich versendet und kommen auch an. Aber eines stört mich noch: Ich bekomme wenn ich "tail -f /var/log/messages" eingebe das hier angezeigt wenn ich eine Mail versende
Code:
Aug 17 12:49:11 postfix/smtpd[26145]: connect from localhost[127.0.0.1]
Aug 17 12:49:11 postfix/smtpd[26145]: 67BEE104A95: client=localhost[127.0.0.1]
Aug 17 12:49:11 postfix/cleanup[26149]: 67BEE104A95: message-id=<zarafa.502e21a7.661f.3b889bf80408fa81@DiskStation>
Aug 17 12:49:11 postfix/qmgr[26132]: 67BEE104A95: from=<testa@[COLOR="#B22222"]meinedomain[/COLOR].de>, size=1838, nrcpt=1 (queue active)
Aug 17 12:49:11 postfix/smtpd[26145]: disconnect from localhost[127.0.0.1]
Aug 17 12:49:11 postfix/smtp[26150]: certificate verification failed for smtp.1und1.de[212.227.15.183]:587: untrusted issuer /C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting cc/OU=Certification Services Division/CN=Thawte Premium Server CA/emailA
Aug 17 12:49:12 postfix/smtp[26150]: 67BEE104A95: to=<[COLOR="#B22222"]xxx[/COLOR]@gmx.net>, relay=smtp.1und1.de[212.227.15.183]:587, delay=0.94, delays=0.2/0.16/0.39/0.19, dsn=2.0.0, status=sent (250 Message 0Lj2nG-1TXp732tNm-00dCsj accepted by mrbap3.kundenserver.
Aug 17 12:49:12 postfix/qmgr[26132]: 67BEE104A95: removed
Was mich stört ist die Meldung certificate verification failed for...untrusted issuer... . Wie bekomme ich die weg, weiß da irgendwie keinen Ansatz wo ich suchen soll...:confused:
 
Zuletzt bearbeitet:

Frank70

Benutzer
Mitglied seit
17. Feb 2012
Beiträge
61
Punkte für Reaktionen
0
Punkte
6
Hmmm, Postfix ist doch beim Versenden für den 1&1-Server ein Client, also müsste ich doch dem smtp und nicht dem smtpd das Zertifikat "beibringen"? Die Fehlermeldung wird ja auch vom smtp generiert...
 

Frank70

Benutzer
Mitglied seit
17. Feb 2012
Beiträge
61
Punkte für Reaktionen
0
Punkte
6
Ich blicke das nicht :(

Hier mal das Ende meiner main.cf:
Code:
# ZARAFA ab hier

smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
default_privs = guest
#relayhost = [smtp.1und1.de]:submission
smtp_sasl_security_options = noanonymous
smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/usr/syno/mailstation/etc/sender_relay
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/usr/syno/mailstation/etc/sasl_passwd
smtp_use_tls = yes
smtp_tls_enforce_peername = no
smtp_tls_CAfile =  /etc/zarafa/gateway/cert.pem
smtp_tls_CApath = /etc/zarafa/gateway/
tls_append_default_CA = no
smtpd_sasl_type=cyrus

Ich habe mal nach dieser Anleitung von Axel-Berlin Zertifikat angelegt und dann in der main.cf verwiesen (s.o.). Allerdings bringt das keine Änderung. Ich bin völlig verwirrt! Wer muss denn da jetzt wem und überhaupt ein Zertifikat geben und wer muss es akzeptieren?

p.s. mir ist gerade sauheiß hier *schwitz* :(
 

jahlives

Benutzer
Mitglied seit
19. Aug 2008
Beiträge
18.275
Punkte für Reaktionen
4
Punkte
0
was genau hast du denn in cert.pem drin? Dort drin müssen verschiedene Certs rein: 1. dein Server Cert 2. jenes Cert, das dein Cert signiert hat und 3. jedes weitere Cert welches 2. signiert hat. Sagen wir du hast ein client.pem, dann das intermediate.pem (hat client signiert) und ein root.pem (welches intermediate signiert hat)
Code:
cat client.pem intermediate.pem root.pem > allesZusammen.pem
dieses File müsstest du dann postfix via CAfile zugänglich machen. Postfix braucht die gesamte Kette der Zertifikate und nicht nur einfach deines :)
 

Frank70

Benutzer
Mitglied seit
17. Feb 2012
Beiträge
61
Punkte für Reaktionen
0
Punkte
6
vielen Dank für deine Mühe, aber sorry, ich verstehe nun überhaupt nix mehr. Ich habe mir ein Zertifikat angelegt:
Code:
vi /usr/syno/ssl/openssl.cnf

[ req ]
default_bits = 1024
distinguished_name = req_DN
string_mask = nombstr

[ req_DN ]
countryName = "1. Staat (2 Buchstaben)"
countryName_default = DE
countryName_min = 2
countryName_max = 2
stateOrProvinceName = "2. Bundesland "
localityName = "3. Ort "
0.organizationName = "4. Name der Organisation "
organizationalUnitName = "5. Name der Organisationseinheit "
commonName = "6. Common Name (Synology Station) "
commonName_max = 64
commonName_default = Synology Station
emailAddress = "7. Email Adresse "
emailAddress_max = 40

Zertifikat erstellen

openssl genrsa -out /etc/zarafa/gateway/privkey.pem 2048
openssl req -new -x509 -key /etc/zarafa/gateway/privkey.pem -out /etc/zarafa/gateway/cert.pem -days 3650
Ich habe also im Ordner gateway zwei files: privkey.pem und cert.pem. Jetzt soll ich aus drei .pem ein einziges machen?! Habe ja nur zwei, woher soll ich denn das dritte nehmen??
 

jahlives

Benutzer
Mitglied seit
19. Aug 2008
Beiträge
18.275
Punkte für Reaktionen
4
Punkte
0
es müssen nicht unbedingt drei oder mehr sein. Mindestens aber zwei, nämlich dein Cert und jenes welches dein Cert signiert hat. zudem ist es "schlecht" den Private und den Public Key deines Certs in dasselbe File zu packen. Postfix braucht nur die Zertifikate (Public Key) für CAfile und nicht auch den Private Key.
Generier dir erstmal dein root-Cert (wenn du selber signieren willst)
Code:
openssl req -new -x509 -keyout cakey.pem -out cacert.pem -days 3650
so hast du den Key und das Cert getrennt
dann
Code:
openssl genrsa -out serverkey.pem 2048
openssl req -new -x509 -key serverkey.pem -out servercert.pem
 

Frank70

Benutzer
Mitglied seit
17. Feb 2012
Beiträge
61
Punkte für Reaktionen
0
Punkte
6
Ich habe jetzt erstmal einen Ordner test angelegt, bin dort rein und habe
Code:
DiskStation> pwd
/etc/zarafa/test
DiskStation> openssl req -new -x509 -keyout cakey.pem -out cacert.pem -days 3650
Generating a 1024 bit RSA private key
..............................++++++
..............++++++
writing new private key to 'cakey.pem'
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
1. Staat (2 Buchstaben) [DE]:problems making Certificate Request
DiskStation>
problems making Certificate Request: Eine ziemlich allgemeine Fehlermeldung... Weiß nicht warum das nun nicht funktioniert. Falls es hilft, ich bin als root angemeldet.
 

Frank70

Benutzer
Mitglied seit
17. Feb 2012
Beiträge
61
Punkte für Reaktionen
0
Punkte
6
Diese Seite sieht auch vielversprechend aus bzgl. Zertifikaterstellung. Leider komme ich beim letzten Schritt
Code:
openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 365
wieder zur leidvollen Fehlermeldung :mad:

Hier hat noch jemand das Problem mit dem Abbruch, leider aber auch keine Lösung dabei. Über Google konnte ich bisher auch keine Lösung finden... :(
 

jahlives

Benutzer
Mitglied seit
19. Aug 2008
Beiträge
18.275
Punkte für Reaktionen
4
Punkte
0
hast du denn das openssl.conf File manuell angepasst? Ich würde es mal mit der Originalversion aus dem Netz probieren
 

Frank70

Benutzer
Mitglied seit
17. Feb 2012
Beiträge
61
Punkte für Reaktionen
0
Punkte
6
Ich habe mir nun diese openssl.cnf gezogen aber es ändert sich auch damit nichts an der Fehlermeldung
Code:
DiskStation> openssl req -new -x509 -keyout cakey.pem -out cacert.pem -days 3650
Generating a 1024 bit RSA private key
.++++++
..........++++++
writing new private key to 'cakey.pem'
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:problems making Certificate Request
DiskStation>

Wie sieht denn deine openssl.cnf aus? Vielleicht klappts ja damit...
 

jahlives

Benutzer
Mitglied seit
19. Aug 2008
Beiträge
18.275
Punkte für Reaktionen
4
Punkte
0
Code:
#
# OpenSSL example configuration file.
# This is mostly being used for generation of certificate requests.
#
# This definition stops the following lines choking if HOME isn't
# defined.
HOME            = .
RANDFILE        = $ENV::HOME/.rnd

# Extra OBJECT IDENTIFIER info:
#oid_file        = $ENV::HOME/.oid
oid_section        = new_oids


[ new_oids ]


# We can add new OIDs in here for use by 'ca' and 'req'.
# Add a simple OID like this:
# testoid1=1.2.3.4
# Or use config file substitution like this:
# testoid2=${testoid1}.5.6


####################################################################
[ ca ]
default_ca    = CA_default        # The default ca section


####################################################################
[ CA_default ]


dir        = ./demoCA        # Where everything is kept
certs        = $dir/certs        # Where the issued certs are kept
crl_dir        = $dir/crl        # Where the issued crl are kept
database    = $dir/index.txt    # database index file.
#unique_subject    = no            # Set to 'no' to allow creation of
                    # several ctificates with same subject.
new_certs_dir    = $dir/newcerts        # default place for new certs.


certificate    = $dir/cacert.pem     # The CA certificate
serial        = $dir/serial         # The current serial number
crlnumber    = $dir/crlnumber    # the current crl number
                    # must be commented out to leave a V1 CRL
crl        = $dir/crl.pem         # The current CRL
private_key    = $dir/private/cakey.pem# The private key
RANDFILE    = $dir/private/.rand    # private random number file


x509_extensions    = usr_cert        # The extentions to add to the cert


# Comment out the following two lines for the "traditional"
# (and highly broken) format.
name_opt     = ca_default        # Subject Name options
cert_opt     = ca_default        # Certificate field options


# Extension copying option: use with caution.
# copy_extensions = copy


# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
# so this is commented out by default to leave a V1 CRL.
# crlnumber must also be commented out to leave a V1 CRL.
# crl_extensions    = crl_ext


default_days    = 365            # how long to certify for
default_crl_days= 30            # how long before next CRL
default_md    = sha1            # which md to use.
preserve    = no            # keep passed DN ordering


# A few difference way of specifying how similar the request should look
# For type CA, the listed attributes must be the same, and the optional
# and supplied fields are just that :-)
policy        = policy_match


# For the CA policy
[ policy_match ]
countryName        = match
stateOrProvinceName    = match
organizationName    = match
organizationalUnitName    = optional
commonName        = supplied
emailAddress        = optional


# For the 'anything' policy
# At this point in time, you must list all acceptable 'object'
# types.
[ policy_anything ]
countryName        = optional
stateOrProvinceName    = optional
localityName        = optional
organizationName    = optional
organizationalUnitName    = optional
commonName        = supplied
emailAddress        = optional


####################################################################
[ req ]
default_bits        = 1024
default_keyfile     = privkey.pem
distinguished_name    = req_distinguished_name
attributes        = req_attributes
x509_extensions    = v3_ca    # The extentions to add to the self signed cert


# Passwords for private keys if not present they will be prompted for
# input_password = secret
# output_password = secret


# This sets a mask for permitted string types. There are several options. 
# default: PrintableString, T61String, BMPString.
# pkix     : PrintableString, BMPString.
# utf8only: only UTF8Strings.
# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
# MASK:XXXX a literal mask value.
# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
# so use this option with caution!
string_mask = nombstr


# req_extensions = v3_req # The extensions to add to a certificate request


[ req_distinguished_name ]
countryName            = Country Name (2 letter code)
countryName_default        = AU
countryName_min            = 2
countryName_max            = 2


stateOrProvinceName        = State or Province Name (full name)
stateOrProvinceName_default    = Some-State


localityName            = Locality Name (eg, city)


0.organizationName        = Organization Name (eg, company)
0.organizationName_default    = Internet Widgits Pty Ltd


# we can do this but it is not needed normally :-)
#1.organizationName        = Second Organization Name (eg, company)
#1.organizationName_default    = World Wide Web Pty Ltd


organizationalUnitName        = Organizational Unit Name (eg, section)
#organizationalUnitName_default    =


commonName            = Common Name (eg, YOUR name)
commonName_max            = 64


emailAddress            = Email Address
emailAddress_max        = 64


# SET-ex3            = SET extension number 3


[ req_attributes ]
challengePassword        = A challenge password
challengePassword_min        = 4
challengePassword_max        = 20


unstructuredName        = An optional company name


[ usr_cert ]


# These extensions are added when 'ca' signs a request.


# This goes against PKIX guidelines but some CAs do it and some software
# requires this to avoid interpreting an end user certificate as a CA.


basicConstraints=CA:FALSE


# Here are some examples of the usage of nsCertType. If it is omitted
# the certificate can be used for anything *except* object signing.


# This is OK for an SSL server.
# nsCertType            = server


# For an object signing certificate this would be used.
# nsCertType = objsign


# For normal client use this is typical
# nsCertType = client, email


# and for everything including object signing:
# nsCertType = client, email, objsign


# This is typical in keyUsage for a client certificate.
# keyUsage = nonRepudiation, digitalSignature, keyEncipherment


# This will be displayed in Netscape's comment listbox.
nsComment            = "OpenSSL Generated Certificate"


# PKIX recommendations harmless if included in all certificates.
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid,issuer


# This stuff is for subjectAltName and issuerAltname.
# Import the email address.
# subjectAltName=email:copy
# An alternative to produce certificates that aren't
# deprecated according to PKIX.
# subjectAltName=email:move


# Copy subject details
# issuerAltName=issuer:copy


#nsCaRevocationUrl        = http://www.domain.dom/ca-crl.pem
#nsBaseUrl
#nsRevocationUrl
#nsRenewalUrl
#nsCaPolicyUrl
#nsSslServerName


[ v3_req ]


# Extensions to add to a certificate request


basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment


[ v3_ca ]




# Extensions for a typical CA




# PKIX recommendation.


subjectKeyIdentifier=hash


authorityKeyIdentifier=keyid:always,issuer:always


# This is what PKIX recommends but some broken software chokes on critical
# extensions.
#basicConstraints = critical,CA:true
# So we do this instead.
basicConstraints = CA:true


# Key usage: this is typical for a CA certificate. However since it will
# prevent it being used as an test self-signed certificate it is best
# left out by default.
# keyUsage = cRLSign, keyCertSign


# Some might want this also
# nsCertType = sslCA, emailCA


# Include email address in subject alt name: another PKIX recommendation
# subjectAltName=email:copy
# Copy issuer details
# issuerAltName=issuer:copy


# DER hex encoding of an extension: beware experts only!
# obj=DER:02:03
# Where 'obj' is a standard or added object
# You can even override a supported extension:
# basicConstraints= critical, DER:30:03:01:01:FF


[ crl_ext ]


# CRL extensions.
# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.


# issuerAltName=issuer:copy
authorityKeyIdentifier=keyid:always,issuer:always


[ proxy_cert_ext ]
# These extensions should be added when creating a proxy certificate


# This goes against PKIX guidelines but some CAs do it and some software
# requires this to avoid interpreting an end user certificate as a CA.


basicConstraints=CA:FALSE


# Here are some examples of the usage of nsCertType. If it is omitted
# the certificate can be used for anything *except* object signing.


# This is OK for an SSL server.
# nsCertType            = server


# For an object signing certificate this would be used.
# nsCertType = objsign


# For normal client use this is typical
# nsCertType = client, email


# and for everything including object signing:
# nsCertType = client, email, objsign


# This is typical in keyUsage for a client certificate.
# keyUsage = nonRepudiation, digitalSignature, keyEncipherment


# This will be displayed in Netscape's comment listbox.
nsComment            = "OpenSSL Generated Certificate"


# PKIX recommendations harmless if included in all certificates.
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid,issuer:always


# This stuff is for subjectAltName and issuerAltname.
# Import the email address.
# subjectAltName=email:copy
# An alternative to produce certificates that aren't
# deprecated according to PKIX.
# subjectAltName=email:move


# Copy subject details
# issuerAltName=issuer:copy


#nsCaRevocationUrl        = http://www.domain.dom/ca-crl.pem
#nsBaseUrl
#nsRevocationUrl
#nsRenewalUrl
#nsCaPolicyUrl
#nsSslServerName


# This really needs to be in place for it to be a proxy certificate.
proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
 

Frank70

Benutzer
Mitglied seit
17. Feb 2012
Beiträge
61
Punkte für Reaktionen
0
Punkte
6
Danke Dir für den Code :)
Leider auch damit der gleiche Fehler. Liegt es evt. an der openssl-Version? Bei mir wird das angezeigt:
Code:
DiskStation> openssl version
OpenSSL 1.0.0h 12 Mar 2012
Oder liegt es evtl. an Rechten der openssl.cnf?!? Sieht bei mir so aus:
Code:
-rw-r--r--    1 root     root          9695 Aug 22 15:03 openssl.cnf

p.s. OpenSSL Version 1.0.1c ist zur Zeit wohl aktuell. Sollte/kann man das updaten? Habe nix gefunden wie man das macht... Falls nötig/möglich mache ich hierfür aber einen neuen thread auf, das schweift hier sonst zu sehr vom eigentlichen Thema ab...
 
Status
Für weitere Antworten geschlossen.
 

Kaffeautomat

Wenn du das Forum hilfreich findest oder uns unterstützen möchtest, dann gib uns doch einfach einen Kaffee aus.

Als Dankeschön schalten wir deinen Account werbefrei.

:coffee:

Hier gehts zum Kaffeeautomat