Relay mails from other (linux) servers through ispconfig server

Discussion in 'Server Operation' started by Christian COMMARMOND, Feb 23, 2018.

  1. Christian COMMARMOND

    Christian COMMARMOND New Member HowtoForge Supporter

    Hi,
    I have a working ispconfig 3 on centos 7. I can send and receive emails from roundcubemail (to gmail), and I can send mail from command line. I send my mail through my domainname provider (ovh) (DKIM is set up).

    My setup:
    My local server is 192.168.1.10 in domain example.com and server name is ispconfig (as I said, I send and receive mail, and websites works...).
    Now, I connect to server 192.168.1.20 (otherserver) and I want to send an email (the same that worked from server ispconfig). On otherserver, main.cf was modified, just to set relay to server ispconfig.
    I send email with this command:
    mailx -s test [email protected] </etc/postfix/main.cf # (just to have something to send)

    So, ispconfig get the email, but reject it with the log I give later (with the main.cf conf).

    The question is, what do I miss? I visited numerous websites and I think that it should work. After more than two days of tries (and failures), I come to ask to experts.

    Other comment: On lots of website, they talk about sasl authentication, this server is absolutely trusted, I don't want to do complex things. If there is a way to not authenticate and just let the mail go through. On otherserver, the sender is [email protected] and I would like to receive the email as coming from [email protected], even if I know that I will not be able to answer.

    I hope that someone can help.

    Christian COMMARMOND

    The log:
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: >>> START Recipient address RESTRICTIONS <<<
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: generic_checks: name=permit_mynetworks
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: permit_mynetworks: otherserver 192.168.1.20
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: match_hostname: otherserver ~? 127.0.0.0/8
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: match_hostaddr: 192.168.1.20 ~? 127.0.0.0/8
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: match_hostname: otherserver ~? [::1]/128
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: match_hostaddr: 192.168.1.20 ~? [::1]/128
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: match_list_match: otherserver: no match
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: match_list_match: 192.168.1.20: no match
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: generic_checks: name=permit_mynetworks status=0
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: generic_checks: name=permit_sasl_authenticated
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: generic_checks: name=permit_sasl_authenticated status=0
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: generic_checks: name=defer_unauth_destination
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: reject_unauth_destination: [email protected]
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: permit_auth_destination: [email protected]
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: ctable_locate: leave existing entry key [email protected]
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: NOQUEUE: reject: RCPT from otherserver[192.168.1.20]: 454 4.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<otherserver.example.com>
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: generic_checks: name=defer_unauth_destination status=2
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: >>> END Recipient address RESTRICTIONS <<<
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: > otherserver[192.168.1.20]: 454 4.7.1 <[email protected]>: Relay access denied
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: watchdog_pat: 0x55ef056f72c0
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: < otherserver[192.168.1.20]: DATA
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: > otherserver[192.168.1.20]: 554 5.5.1 Error: no valid recipients
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: watchdog_pat: 0x55ef056f72c0
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: < otherserver[192.168.1.20]: RSET
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: > otherserver[192.168.1.20]: 250 2.0.0 Ok
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: watchdog_pat: 0x55ef056f72c0
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: < otherserver[192.168.1.20]: QUIT
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: > otherserver[192.168.1.20]: 221 2.0.0 Bye
    Feb 23 15:41:02 ispconfig postfix/smtpd[7047]: match_hostname: otherserver ~? 127.0.0.0/8



    ISPCONFIG postconf -n
    postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_sender_restrictions
    postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_client_restrictions
    postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_helo_restrictions
    postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_sender_restrictions
    postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_client_restrictions
    postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_helo_restrictions
    alias_database = hash:/etc/aliases
    alias_maps = hash:/etc/aliases
    body_checks = regexp:/etc/postfix/body_checks
    broken_sasl_auth_clients = yes
    command_directory = /usr/sbin
    config_directory = /etc/postfix
    daemon_directory = /usr/libexec/postfix
    data_directory = /var/lib/postfix
    debug_peer_level = 2
    debug_peer_list = 192.168.1.20, otherserver.example.com, otherserver
    debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
    dovecot_destination_recipient_limit = 1
    greylisting = check_policy_service inet:127.0.0.1:10023
    header_checks = regexp:/etc/postfix/header_checks
    html_directory = no
    inet_interfaces = all
    inet_protocols = all
    mail_owner = postfix
    maildrop_destination_concurrency_limit = 1
    maildrop_destination_recipient_limit = 1
    mailq_path = /usr/bin/mailq.postfix
    manpage_directory = /usr/share/man
    mime_header_checks = regexp:/etc/postfix/mime_header_checks
    mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
    myhostname = ispconfig.example.com
    mynetworks = 127.0.0.0/8 [::1]/128
    nested_header_checks = regexp:/etc/postfix/nested_header_checks
    newaliases_path = /usr/bin/newaliases.postfix
    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $sender_bcc_maps $virtual_mailbox_maps $virtual_mailbox_domains $rel
    ay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $smtpd_sender_login_maps
    queue_directory = /var/spool/postfix
    readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
    relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
    relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
    sample_directory = /usr/share/doc/postfix-2.10.1/samples
    sender_bcc_maps = proxy:mysql:/etc/postfix/mysql-virtual_outgoing_bcc.cf
    sendmail_path = /usr/sbin/sendmail.postfix
    setgid_group = postdrop
    smtp_tls_exclude_ciphers = RC4, aNULL
    smtp_tls_protocols = !SSLv2,!SSLv3
    smtp_tls_security_level = may
    smtpd_client_message_rate_limit = 1000
    smtpd_client_restrictions = permit_mynetworks, check_client_access mysql:/etc/postfix/mysql-virtual_client.cf
    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_ho
    stname, reject_invalid_helo_hostname, check_helo_access regexp:/etc/postfix/blacklist_helo
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, check_recipient_acc
    ess mysql:/etc/postfix/mysql-virtual_policy_greylist.cf
    smtpd_restriction_classes = greylisting
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_sasl_path = private/auth

    OTHERSERVER postconf -n
    alias_database = hash:/etc/aliases
    alias_maps = hash:/etc/aliases
    command_directory = /usr/sbin
    config_directory = /etc/postfix
    daemon_directory = /usr/libexec/postfix
    data_directory = /var/lib/postfix
    debug_peer_level = 2
    debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
    html_directory = no
    ignore_mx_lookup_error = yes
    inet_interfaces = localhost
    inet_protocols = all
    lmtp_host_lookup = native
    mail_owner = postfix
    mailq_path = /usr/bin/mailq.postfix
    manpage_directory = /usr/share/man
    mydestination = $myhostname, localhost.$mydomain, localhost
    myhostname = otherserver.example.com
    newaliases_path = /usr/bin/newaliases.postfix
    queue_directory = /var/spool/postfix
    readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
    relayhost = ispconfig.example.com
    sample_directory = /usr/share/doc/postfix-2.10.1/samples
    sendmail_path = /usr/sbin/sendmail.postfix
    setgid_group = postdrop
    smtp_host_lookup = native
    unknown_local_recipient_reject_code = 550
     

Share This Page