Postfix configuration: GMail bounces my mail as spam, but not always

Discussion in 'Server Operation' started by Locutus, Sep 25, 2015.

  1. Locutus

    Locutus New Member

    Hey everyone,
    I'm using a ubuntu 14.04 LTS server with Apache, Postfix and ISPConfig 3.
    I did the "Perfect Server" setup to configure my server.
    Postfix is configured to support multiple domains.

    Let's say I have 2 Domains: My main domain is example.net and my virtual-domain is mydomain.com

    My problem is, that whenever I write an email from a virtual-domain (e.g. mydomain.com) to a gmail-address, it bounces with the following message:
    Code:
    550-5.7.1 Our system has
    550-5.7.1 detected that this message is likely unsolicited mail. To reduce the
    550-5.7.1 amount of spam sent to Gmail, this message has been blocked. Please
    550-5.7.1 visit
    550 5.7.1  https://support.google.com/mail/answer/188131 for more information.


    This is my main.cf
    Code:
    masquerade_domains = $mydomain
    masquerade_exceptions = root, mailer-daemon
    smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
    #myhostname = mail.example.net
    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 = $myhostname, localhost.$mydomain, mail.example.net, localhost, localhost.localdomain
    mydomain = example.net
    myhostname = mail.$mydomain
    mynetworks_style = host
    myorigin = $mydomain
    #smpt_banner = $myhostname ESMTP $mail_name
    relayhost =
    mynetworks = 127.0.0.0/8 [::1]/128
    mailbox_command = procmail -a "$EXTENSION"
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = 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 = static:5000
    virtual_gid_maps = static:5000
    inet_protocols = all
    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_clients = yes
    smtpd_sasl_authenticated_header = yes
    
    The strange thing is: when I add the virtual-domain (mydomain.com) to "mydestination", the mail gets delivered to gmail, but I can't receive any new mail on that domain. If I remove that domain again, my mails get rejected again.

    What am I doing wrong here?

    Thanks,
    Locutus
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    First, virtual domains shall not be listed in mydestination, so please don't add it there as this makes the domain a system domain.

    To your problem:

    1) Check the reverse dns record of your server IP and ensure that it matches the server hostname and that the server hostname is a subdomain and the same subdomain is used for myhostname and myorgin in postfix main.cf.
    2) Add a spf record for your domain.
    3) Add Dkim: http://blog.schaal-24.de/ispconfig/ispconfig-dkim-patch/?lang=en
     
  3. Locutus

    Locutus New Member

    Could you explain a bit more about DKIM? What is that and why do I need it.
    I don't have an own DNS Server configured. Is DKIM still usefull for me?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

  5. Locutus

    Locutus New Member

    Thanks,
    Gmail works now. But Outlook.com still makes some trouble:

    Code:
    550 5.7.1 Service unavailable; Client host [MY_IP_ADDRESS] blocked using FBLW15; To request removal from this list please forward this message to [email protected] (in reply to RCPT TO command))
    do you have any idea on that as well?
     
  6. florian030

    florian030 ISPConfig Developer ISPConfig Developer

  7. Locutus

    Locutus New Member

    I just got a mail from Microsoft. I'm off the Blacklist now. Thanks :)
     

Share This Page