Problem with mail alias not recognised

Discussion in 'Installation/Configuration' started by maxxer, Mar 10, 2016.

  1. maxxer

    maxxer Member

    Hi.
    I've problems creating a mail alias in ISPConfig 3.0.5.4p8 on CentOS7.
    Apparently everything is set up correctly. I checked postfix config and contains the virtual tables definition. I checked the file, the tables and everything which looks ok, but when I send the email to info@ the mail is rejected with user unknown error.
    Am I doing something wrong? How can I check what's bad?
    thanks
     

    Attached Files:

  2. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    You could check your /var/log/maillog for further informations, maybe some issue with the virtual alias configuration.
    do
    $tail -f /var/log/maillog
    then send a mail to info@ and check the new lines on display.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Beside ztk.me's suggestions, please check that the affected domain is nowhere listed in postfix main.cf.
     
  4. maxxer

    maxxer Member

    This is the full excerpt of maillog:
    Code:
    Mar 10 06:52:14 ganesha postfix/qmgr[6427]: 950145424B76: from=<[email protected]>, size=2898, nrcpt=1 (queue active)
    Mar 10 06:52:14 ganesha postfix/smtpd[6444]: disconnect from mail.domain.com[79.1.1.1]
    Mar 10 06:52:14 ganesha postfix/pipe[6456]: 950145424B76: to=<[email protected]>, relay=dovecot, delay=0.66, delays=0.06/0.01/0/0.59
    , dsn=5.1.1, status=bounced (user unknown)
    Mar 10 06:52:14 ganesha postfix/cleanup[6455]: 3F20F5424B78: message-id=<[email protected]>
    Mar 10 06:52:14 ganesha postfix/qmgr[6427]: 3F20F5424B78: from=<>, size=4790, nrcpt=1 (queue active)
    Mar 10 06:52:14 ganesha postfix/bounce[6461]: 950145424B76: sender non-delivery notification: 3F20F5424B78
    Mar 10 06:52:14 ganesha postfix/qmgr[6427]: 950145424B76: removed
    Mar 10 06:52:15 ganesha postfix/smtp[6463]: 3F20F5424B78: to=<[email protected]>, relay=mail.domain.com[79.1.1.1]:25, delay=0.99,
    delays=0/0.01/0.49/0.48, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 81AF8C00C6)
    
    From what it seems, postfix is NOT rewriting the address, so it's forwarded to dovecot which doesn't know the user.
    But main.cf seems ok:
    Code:
    $ grep alias main.cf
    newaliases_path = /usr/bin/newaliases.postfix
    virtual_alias_domains =
    virtual_alias_maps = hash:/etc/mailman/virtual-mailman, proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, proxy:mysql:/etc/postfix/mysql-virtual_email2email.cf
    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
    
     
  5. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    Hmm there has been a similar issue here. However I don't know if it really has been an issue with the version of clamav but checking all involved services would be a good option.
    Check wether the configuration files for clamav still is according to the suggested setup instructions for Centos, maybe run php update.php from ISPConfig.tar.gz download and reconfigure services.

    since your logfiles do contain a different hostname entry I don't think you accidently have the destination domain in your /etc/mailname or postfix config.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    I don't see the amavisd lines. Did you remove or disable amavisd? This would explain your error as rewriting happens after amavis scanned the mail, so by removing amavis you disabled aliases.

    Please post the complete main.cf file. comments stripped.
     
    ztk.me and maxxer like this.
  7. maxxer

    maxxer Member

    here it is.
    thanks

    Code:
    smtp      inet  n       -       n       -       -       smtpd
    smtp      inet  n       -       n       -       1       postscreen
    pickup    unix  n       -       n       60      1       pickup
    cleanup   unix  n       -       n       -       0       cleanup
    qmgr      unix  n       -       n       300     1       qmgr
    tlsmgr    unix  -       -       n       1000?   1       tlsmgr
    rewrite   unix  -       -       n       -       -       trivial-rewrite
    bounce    unix  -       -       n       -       0       bounce
    defer     unix  -       -       n       -       0       bounce
    trace     unix  -       -       n       -       0       bounce
    verify    unix  -       -       n       -       1       verify
    flush     unix  n       -       n       1000?   0       flush
    proxymap  unix  -       -       n       -       -       proxymap
    proxywrite unix -       -       n       -       1       proxymap
    smtp      unix  -       -       n       -       -       smtp
    relay     unix  -       -       n       -       -       smtp
    showq     unix  n       -       n       -       -       showq
    error     unix  -       -       n       -       -       error
    retry     unix  -       -       n       -       -       error
    discard   unix  -       -       n       -       -       discard
    local     unix  -       n       n       -       -       local
    virtual   unix  -       n       n       -       -       virtual
    lmtp      unix  -       -       n       -       -       lmtp
    anvil     unix  -       -       n       -       1       anvil
    scache    unix  -       -       n       -       1       scache
    maildrop  unix  -       n       n       -       -       pipe
      flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender}
    dovecot   unix  -       n       n       -       -       pipe
      flags=DROhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop}
    amavis unix - - - - 2 smtp
            -o smtp_data_done_timeout=1200
            -o smtp_send_xforward_command=yes
    127.0.0.1:10025 inet n - - - - smtpd
            -o content_filter=
            -o local_recipient_maps=
            -o relay_recipient_maps=
            -o smtpd_restriction_classes=
            -o smtpd_client_restrictions=
            -o smtpd_helo_restrictions=
            -o smtpd_sender_restrictions=
            -o smtpd_recipient_restrictions=permit_mynetworks,reject
            -o mynetworks=127.0.0.0/8
            -o strict_rfc821_envelopes=yes
            -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
    
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    That's master.cf, not main.cf.
     
  9. maxxer

    maxxer Member

    oups here it is
    Code:
    queue_directory = /var/spool/postfix
    command_directory = /usr/sbin
    daemon_directory = /usr/libexec/postfix
    data_directory = /var/lib/postfix
    mail_owner = postfix
    inet_interfaces = all
    inet_protocols = all
    mydestination = ganesha.domain.it, localhost, localhost.localdomain
    unknown_local_recipient_reject_code = 550
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
     
    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
    sendmail_path = /usr/sbin/sendmail.postfix
    newaliases_path = /usr/bin/newaliases.postfix
    mailq_path = /usr/bin/mailq.postfix
    setgid_group = postdrop
    html_directory = no
    manpage_directory = /usr/share/man
    sample_directory = /usr/share/doc/postfix-2.10.1/samples
    readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
    virtual_alias_domains =
    virtual_alias_maps = hash:/etc/mailman/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
    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_clients = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf
    smtpd_use_tls = yes
    smtpd_tls_security_level = may
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    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
    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $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_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf
    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
    smtp_tls_security_level = may
    smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
    smtpd_tls_protocols = !SSLv2,!SSLv3
    smtp_tls_protocols = !SSLv2,!SSLv3
    myhostname = ganesha.domain.it
    mynetworks = 127.0.0.0/8 [::1]/128
    dovecot_destination_recipient_limit = 1
    smtpd_sasl_type = dovecot
    smtpd_sasl_path = private/auth
    receive_override_options = no_address_mappings
    postscreen_greet_action = enforce
    smtpd_helo_required = yes
    smtpd_helo_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname
    
     
  10. maxxer

    maxxer Member

    You were right Till, I had temporarily commented out the amavisd scanning and left it disabled, so it was not performing this passage and rewrite.
    Re-enabling the line:
    Code:
    content_filter = amavis:[127.0.0.1]:10024
    in main.cf fixed. Thanks!
     
    ztk.me likes this.
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    maxxer likes this.

Share This Page