Mailversand an externe E-Mail nicht möglich

Discussion in 'Installation/Configuration' started by racor, Jan 20, 2019.

  1. racor

    racor New Member

    Hallo zusammen,

    ich habe mich heute daran gemacht meinen Server neu aufzusetzen. Dabei habe ich mich nach dem "Perfect Server Tutorial für Debian 9" gerichtet.

    Ich kann aktuell Mails von Externen Anbietern empfangen, allerdings keine versenden.

    Leider kenne ich mich mit Postfix nicht so gut aus, wie ich es gerne würde und stehe aktuell ziemlich auf dem Schlauch.

    Ich poste hier einfach mal meine 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 (Debian/GNU)
    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


    # fresh installs.
    compatibility_level = 2

    # TLS parameters
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.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.

    smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
    myhostname = server1.reacts.de
    alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
    alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
    myorigin = /etc/mailname
    mydestination = server1.reacts.de, localhost, localhost.localdomain
    relayhost =
    mynetworks = 127.0.0.0/8 [::1]/128
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    inet_protocols = all
    html_directory = /usr/share/doc/postfix/html
    virtual_alias_domains =
    virtual_alias_maps = hash:/var/lib/mailman/data/virtual-mailman, proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, proxy:mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_mailbox_base = /var/vmail
    virtual_uid_maps = mysql:/etc/postfix/mysql-virtual_uids.cf
    virtual_gid_maps = mysql:/etc/postfix/mysql-virtual_gids.cf
    sender_bcc_maps = proxy:mysql:/etc/postfix/mysql-virtual_outgoing_bcc.cf
    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_clients = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_restriction_classes = greylisting
    greylisting = check_policy_service inet:127.0.0.1:10023
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_rbl_client zen.spamhaus.org, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, check_recipient_access mysql:/etc/postfix/mysql-virtual_policy_greylist.cf
    smtpd_tls_security_level = may
    transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
    relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
    smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql-virtual_sender_login_maps.cf
    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $sender_bcc_maps $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $smtpd_sender_login_maps
    smtpd_helo_required = yes
    smtpd_helo_restrictions = permit_sasl_authenticated, permit_mynetworks, check_helo_access regexp:/etc/postfix/helo_access, reject_invalid_hostname, reject_non_fqdn_hostname, reject_invalid_helo_hostname, reject_unknown_helo_hostname, check_helo_access regexp:/etc/postfix/blacklist_helo
    smtpd_sender_restrictions = check_sender_access regexp:/etc/postfix/tag_as_originating.re , permit_mynetworks, permit_sasl_authenticated, check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf, check_sender_access regexp:/etc/postfix/tag_as_foreign.re
    smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf
    smtpd_client_message_rate_limit = 100
    maildrop_destination_concurrency_limit = 1
    maildrop_destination_recipient_limit = 1
    virtual_transport = dovecot
    header_checks = regexp:/etc/postfix/header_checks
    mime_header_checks = regexp:/etc/postfix/mime_header_checks
    nested_header_checks = regexp:/etc/postfix/nested_header_checks
    body_checks = regexp:/etc/postfix/body_checks
    owner_request_special = no
    smtp_tls_security_level = may
    smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
    smtpd_tls_protocols = !SSLv2,!SSLv3
    smtp_tls_protocols = !SSLv2,!SSLv3
    smtpd_tls_exclude_ciphers = RC4, aNULL
    smtp_tls_exclude_ciphers = RC4, aNULL
    dovecot_destination_recipient_limit = 1
    smtpd_sasl_type = dovecot
    smtpd_sasl_path = private/auth
    content_filter = amavis:[127.0.0.1]:10024
    receive_override_options = no_address_mappings
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    You should write in english.
    Check first your postfix setup is what the Perfect Server Tutorial shows.
    Then see in mail log why the sending of e-mail fails. If I understood your german correctly, it is sending that is the problem. So look in /var/log/mail.log after you try sending.
    There are lots of discussions in this forum about e-mail problems when sending. Try finding those.
    And another thing: post logs and files in CODE tags! That way they are more readable.
     
  3. racor

    racor New Member

    Hi, sorry for posting in german. My english is not the best, but i will try to explain my problem in english.

    I can send emails to mail-addresses on the same server, but i can't sent them to external Mail-Adresse e.g. gmail.
    My knowledge about Postfix is not as good as i wish. I have no idea where to start to fix this problem. When i send an email to my gmail-address, i get the following message:
    Code:
    This is the mail system at host server1.reacts.de.
    
    I'm sorry to have to inform you that your message could not
    be delivered to one or more recipients. It's attached below.
    
    For further assistance, please send mail to postmaster.
    
    If you do so, please include this problem report. You can
    delete your own text from the attached returned message.
    
                      The mail system
    
    <[email protected]>: host
       gmail-smtp-in.l.google.com[2a00:1450:400c:c06::1b] said: 550-5.7.1
       [2a01:4f8:120:64e5::2] Our system has detected that this message does
       550-5.7.1 not meet IPv6 sending guidelines regarding PTR records and
       550-5.7.1 authentication. Please review 550-5.7.1
       https://support.google.com/mail/?p=IPv6AuthError for more information 550
       5.7.1 . i131si35588181wmg.144 - gsmtp (in reply to end of DATA command)
    Reporting-MTA: dns; server1.reacts.de
    X-Postfix-Queue-ID: 8A9C823017E3
    X-Postfix-Sender: rfc822; [email protected]
    Arrival-Date: Sun, 20 Jan 2019 14:53:12 +0100 (CET)
    
    Final-Recipient: rfc822; [email protected]
    Original-Recipient: rfc822;[email protected]
    Action: failed
    Status: 5.7.1
    Remote-MTA: dns; gmail-smtp-in.l.google.com
    Diagnostic-Code: smtp; 550-5.7.1 [2a01:4f8:120:64e5::2] Our system has detected
       that this message does 550-5.7.1 not meet IPv6 sending guidelines regarding
       PTR records and 550-5.7.1 authentication. Please review 550-5.7.1
       https://support.google.com/mail/?p=IPv6AuthError for more information 550
       5.7.1 . i131si35588181wmg.144 - gsmtp
    
    Von: XXX XXX <[email protected]>
    Betreff: test
    Datum: 20. Januar 2019 um 14:53:11 MEZ
    An: XXX XXX <[email protected]>
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Are you using IPv6? Do you have network connectivity with IPv6?
    Anyway, that error shows PTR records, the reverse Name Service is not set up correctly. At least according to Google.
    I'm testing IPV4 here:
    Code:
    $ host reacts.de
    reacts.de has address 78.46.91.70
    reacts.de mail is handled by 10 mail.reacts.de.
    [email protected] /home/tale
    $ host 78.46.91.70
    70.91.46.78.in-addr.arpa domain name pointer reacts.de.
    [email protected] /home/tale
    
    You should set up PTR so that host 78.46.91.70 returns the name of your mail server, that is mail.reacts.de.
    There is tutorial trying to explain this: https://www.howtoforge.com/tutorial...vice-with-ispconfig/#nbspreverse-name-service
     
  5. racor

    racor New Member

    Hello Taleman,

    thanks for the fast response.

    Are you using IPv6? Do you have network connectivity with IPv6?
    I'm don't want to use IPv6. I've got both, IPv4 and IPv6 from my server hoster. Is this a problem for Postfix?

    You should set up PTR so that host 78.46.91.70 returns the name of your mail server, that is mail.reacts.de.
    I've set up the Reverse DNS Entry at my Server Hoster. Obviously the change is not working correct. Maybe i have to wait a little longer to see any effect.
     
  6. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    IPv6 is not a problem for Postfix, unless your IPv6 setup is not working. If you do not want to use IPv6, disable it in Postfix or maybe in the operating system. Use Internet Search Engines to find out how.
    Before starting to wait, make sure your authoritative name servers do have the correct info. Test the name servers they do show your desired PTR and other records. Then when that is verified, it is just a matter of waiting for the DNS info to travel around the globe.
     
  7. racor

    racor New Member

    Hi Taleman,

    thank you for your help.

    I've checked the DNS Records and try to send an email to my gmail account this afternoon. And it's working fine, actually.

    Thanks again for your help!
     

Share This Page