Postfix Issues - ISPConfig 3.1.15p3

Discussion in 'ISPConfig 3 Priority Support' started by Jean-Francois Leblanc, Jun 30, 2020.

  1. I applied an update to the ISPConfig last night, and I'm now having issues with postfix.
    I'm getting an error in my "mail.err" log,
    Code:
    Jun 30 10:00:48 loosestring-designs postfix/smtp[29544]: fatal: open dictionary: expecting "type:name" form instead of "="
    
    When I look at the mail queue, I saw some errors like,
    Code:
    delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10026: Connection refused
    which I can confirm that amavis doesn't look like it's running.
    Code:
    [email protected]:/var/log# netstat -tap | grep 100
    tcp        0      0 localhost:10025         0.0.0.0:*               LISTEN      2540/master
    tcp        0      0 localhost:10027         0.0.0.0:*               LISTEN      2540/master
    Code:
    [email protected]:/var/log# amavisd-new debug
    Jun 30 10:10:49.831 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: logging initialized, log level 0, syslog: amavis.mail
    Jun 30 10:10:49.831 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: sd_notify (no socket): STATUS=Config files have been read, modules loaded.
    Jun 30 10:10:49.832 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: starting. /usr/sbin/amavisd-new at loosestring-designs.ca amavisd-new-2.11.0 (20160426), Unicode aware, LANG="en_US.UTF-8"
    Jun 30 10:10:49.832 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: perl=5.026001, user=, EUID: 119 (119);  group=, EGID: 125 125 (125 125)
    Jun 30 10:10:49.876 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: INFO: no optional modules: unicore::lib::Nt::De.pl Unix::Getrusage
    Jun 30 10:10:49.876 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: SpamControl: attempting to load scanner SpamAssassin, module Amavis::SpamControl::SpamAssassin
    Jun 30 10:10:49.876 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: SpamControl: scanner SpamAssassin, module Amavis::SpamControl::SpamAssassin
    Jun 30 10:10:50.035 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: INFO: SA version: 3.4.2, 3.004002, no optional modules: Encode::Detect Razor2::Client::Agent Image::Info Image::Info::GIF Image::Info::JPEG Image::Info::PNG Image::Info::BMP Image::Info::TIFF
    Jun 30 10:10:50.036 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: SpamControl: init_pre_chroot on SpamAssassin done
    Jun 30 10:10:50.036 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: socket module IO::Socket::IP, protocol families available: INET, INET6
    Jun 30 10:10:50.036 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: will bind to /var/lib/amavis/amavisd.sock|unix, 127.0.0.1:10024/tcp, [::1]:10024/tcp, 127.0.0.1:10026/tcp, [::1]:10026/tcp
    Jun 30 10:10:50.036 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: sd_notify (no socket): STATUS=Transferring control to Net::Server.
    Jun 30 10:10:50.037 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: sd_notify (no socket): STATUS=Preparing to bind sockets.
    Jun 30 10:10:50.037 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: Net::Server: 2020/06/30-10:10:50 Amavis (type Net::Server::PreForkSimple) starting! pid(22082)
    Jun 30 10:10:50.040 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: Net::Server: Binding to UNIX socket file "/var/lib/amavis/amavisd.sock"
    Jun 30 10:10:50.040 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: Net::Server: Binding to TCP port 10024 on host 127.0.0.1 with IPv4
    Jun 30 10:10:50.040 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: Net::Server: Binding to TCP port 10024 on host ::1 with IPv6
    Jun 30 10:10:50.041 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: (!)Net::Server: 2020/06/30-10:10:50 Can't connect to TCP port 10024 on ::1 [Cannot assign requested address]\n  at line 64 in file /usr/share/perl5/Net/Server/Proto/TCP.pm
    Jun 30 10:10:50.041 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: sd_notify (no socket): STOPPING=1\nSTATUS=Server rundown, notifying child processes.
    Jun 30 10:10:50.041 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: Net::Server: 2020/06/30-10:10:50 Server closing!
    Jun 30 10:10:50.041 loosestring-designs.ca /usr/sbin/amavisd-new[22082]: sd_notify (no socket): STATUS=Child processes have been stopped.
    
    I've tried re-downloading the installer from the ISPConfig website, and re-ran the update, but I still have the issue of emails queuing up.
    Any ideas?
     
  2. main.cf config
    Code:
    # 
    # 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 (Ubuntu)
    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
    
    # See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
    # 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 = mail.loosestring-designs.ca
    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
    mydomain = loosestring-designs.ca
    mydestination = localhost, localhost.localdomain, mail.loosestring-designs.ca
    mynetworks = 127.0.0.0/8 [::1]/128
    mailbox_size_limit = 0
    recipient_delimiter = +
    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
    receive_override_options = no_address_mappings
    message_size_limit = 0
    minimal_backoff_time = 120s
    queue_run_delay = 120s
    mynetworks_style = subnet
    hopcount_limit = 100
    smtputf8_enable = yes
    disable_vrfy_command = yes
    inet_protocols = all
    smtp_sender_dependent_authentication = yes
    smtp_sasl_security_options = noanonymous
    sender_dependent_relayhost_maps = hash:/etc/postfix/bysender
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd = all
    content_filter = amavis:[127.0.0.1]:10024
    inet_interfaces = all
    
     
  3. master.cf file
    Code:
    #
    # Postfix master process configuration file.  For details on the format
    # of the file, see the master(5) manual page (command: "man 5 master" or
    # on-line: http://www.postfix.org/master.5.html).
    #
    # Do not forget to execute "postfix reload" after editing this file.
    #
    # ==========================================================================
    # service type  private unpriv  chroot  wakeup  maxproc command + args
    #               (yes)   (yes)   (no)    (never) (100)
    # ==========================================================================
    smtp    inet    n    -    y    -    0    smtpd
    555    inet    n    -    n    -    0    smtpd
    #smtp      inet  n       -       y       -       1       postscreen
    #smtpd     pass  -       -       y       -       -       smtpd
    #dnsblog   unix  -       -       y       -       0       dnsblog
    #tlsproxy  unix  -       -       y       -       0       tlsproxy
    submission inet n       -       y       -       -       smtpd
      -o syslog_name=postfix/submission
      -o smtpd_tls_security_level=encrypt
      -o smtpd_sasl_auth_enable=yes
      -o smtpd_client_restrictions=permit_sasl_authenticated,reject 
    #  -o smtpd_tls_auth_only=yes
    #  -o smtpd_reject_unlisted_recipient=no
    #  -o smtpd_client_restrictions=$mua_client_restrictions
    #  -o smtpd_helo_restrictions=$mua_helo_restrictions
    #  -o smtpd_sender_restrictions=$mua_sender_restrictions
    #  -o smtpd_recipient_restrictions=
    #  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
    #  -o milter_macro_daemon_name=ORIGINATING
    smtps     inet  n       -       y       -       -       smtpd
      -o syslog_name=postfix/smtps
      -o smtpd_tls_wrappermode=yes
      -o smtpd_sasl_auth_enable=yes
      -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    #  -o smtpd_reject_unlisted_recipient=no
    #  -o smtpd_client_restrictions=$mua_client_restrictions
    #  -o smtpd_helo_restrictions=$mua_helo_restrictions
    #  -o smtpd_sender_restrictions=$mua_sender_restrictions
    #  -o smtpd_recipient_restrictions=
    #  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
    #  -o milter_macro_daemon_name=ORIGINATING
    #628       inet  n       -       y       -       -       qmqpd
    pickup    unix  n       -       y       60      1       pickup
    cleanup   unix  n       -       y       -       0       cleanup
    qmgr      unix  n       -       n       300     1       qmgr
    #qmgr     unix  n       -       n       300     1       oqmgr
    tlsmgr    unix  -       -       y       1000?   1       tlsmgr
    rewrite   unix  -       -       y       -       -       trivial-rewrite
    bounce    unix  -       -       y       -       0       bounce
    defer     unix  -       -       y       -       0       bounce
    trace     unix  -       -       y       -       0       bounce
    verify    unix  -       -       y       -       1       verify
    flush     unix  n       -       y       1000?   0       flush
    proxymap  unix  -       -       n       -       -       proxymap
    proxywrite unix -       -       n       -       1       proxymap
    smtp      unix  -       -       y       -       -       smtp
    relay     unix  -       -       y       -       -       smtp
            -o syslog_name=postfix/$service_name
    #       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
    showq     unix  n       -       y       -       -       showq
    error     unix  -       -       y       -       -       error
    retry     unix  -       -       y       -       -       error
    discard   unix  -       -       y       -       -       discard
    local     unix  -       n       n       -       -       local
    virtual   unix  -       n       n       -       -       virtual
    lmtp      unix  -       -       y       -       -       lmtp
    anvil     unix  -       -       y       -       1       anvil
    scache    unix  -       -       y       -       1       scache
    #
    # ====================================================================
    # Interfaces to non-Postfix software. Be sure to examine the manual
    # pages of the non-Postfix software to find out what options it wants.
    #
    # Many of the following services use the Postfix pipe(8) delivery
    # agent.  See the pipe(8) man page for information about ${recipient}
    # and other message envelope options.
    # ====================================================================
    #
    # maildrop. See the Postfix MAILDROP_README file for details.
    # Also specify in main.cf: maildrop_destination_recipient_limit=1
    #
    maildrop  unix  -       n       n       -       -       pipe
      flags=DRhu user=vmail argv=/usr/bin/maildrop -d vmail ${extension} ${recipient} ${user} ${nexthop} ${sender}
    #
    # ====================================================================
    #
    # Recent Cyrus versions can use the existing "lmtp" master.cf entry.
    #
    # Specify in cyrus.conf:
    #   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
    #
    # Specify in main.cf one or more of the following:
    #  mailbox_transport = lmtp:inet:localhost
    #  virtual_transport = lmtp:inet:localhost
    #
    # ====================================================================
    #
    # Cyrus 2.1.5 (Amos Gouaux)
    # Also specify in main.cf: cyrus_destination_recipient_limit=1
    #
    #cyrus     unix  -       n       n       -       -       pipe
    #  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
    #
    # ====================================================================
    # Old example of delivery via Cyrus.
    #
    #old-cyrus unix  -       n       n       -       -       pipe
    #  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
    #
    # ====================================================================
    #
    # See the Postfix UUCP_README file for configuration details.
    #
    uucp      unix  -       n       n       -       -       pipe
      flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
    #
    # Other external delivery methods.
    #
    ifmail    unix  -       n       n       -       -       pipe
      flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
    bsmtp     unix  -       n       n       -       -       pipe
      flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
    scalemail-backend unix    -    n    n    -    2    pipe
      flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
    mailman   unix  -       n       n       -       -       pipe
      flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
      ${nexthop} ${user}
    
    dovecot   unix  -       n       n       -       -       pipe
      flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}
    
    
    amavis unix - - - - 2 smtp
            -o smtp_data_done_timeout=1200
            -o smtp_send_xforward_command=yes
            -o smtp_bind_address=
    
    
    127.0.0.1:10025 inet n - 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 smtpd_end_of_data_restrictions=
            -o mynetworks=127.0.0.0/8
            -o strict_rfc821_envelopes=yes
            -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
            -o smtp_send_xforward_command=yes
            -o disable_dns_lookups=yes
    
    
    127.0.0.1:10027 inet n - 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 smtpd_end_of_data_restrictions=
            -o mynetworks=127.0.0.0/8
            -o strict_rfc821_envelopes=yes
            -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
            -o smtp_send_xforward_command=yes
            -o milter_default_action=accept
            -o milter_macro_daemon_name=ORIGINATING
            -o disable_dns_lookups=yes
    
    
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Seems as if your system has an ipv6 problem, amavis tries to open that port on 12.0.0.1 ipv4 and ::1 ipv6 and it fails on ipv6.
     
  5. Is it possible to disable the ipv6 for amavis?
    After making the change on the previous post as you suggest, all my emails in queue now have the,
    Code:
    delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    That's because amavis can't start and not caused by the previous change.

    Try to remove

    [::1]

    inside the file /etc/amavis/conf.d/50-user wherever it occurs and then restart amavis.
    Back up the file /etc/amavis/conf.d/50-user before you change it in another directory (do not save it in the same directory!).
     
  7. Before
    Code:
    use strict;
    
    #
    # Place your configuration directives here.  They will override those in
    # earlier files.
    #
    # See /usr/share/doc/amavisd-new/ for documentation and examples of
    # the directives you can use in this file
    #
    
    @bypass_virus_checks_maps = (
       \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);
    
    @bypass_spam_checks_maps = (
       \%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);
    
    #
    # Database connection settings
    #
    
    @lookup_sql_dsn =
       ( ['DBI:mysql:database=dbispconfig;host=127.0.0.1;port=3306', 'ispconfig', '42d05dfe6a65869dc29291265737e4e4'] );
    
    # @storage_sql_dsn = @lookup_sql_dsn;  # none, same, or separate database
    #$sql_select_policy = 'SELECT "Y" as local FROM mail_domain WHERE CONCAT("@",domain) IN (%k)';
    # $banned_files_quarantine_method = 'sql';
    # $spam_quarantine_method         = 'sql';
    
    #
    # SQL Select statements
    #
    
    $sql_select_policy =
       'SELECT *,spamfilter_users.id'.
       ' FROM spamfilter_users LEFT JOIN spamfilter_policy ON spamfilter_users.policy_id=spamfilter_policy.id'.
       ' WHERE spamfilter_users.email IN (%k) ORDER BY spamfilter_users.priority DESC';
    
    
    $sql_select_white_black_list = 'SELECT wb FROM spamfilter_wblist'.
        ' WHERE (spamfilter_wblist.rid=?) AND (spamfilter_wblist.email IN (%k)) AND (spamfilter_wblist.active="y")' .
        ' ORDER BY spamfilter_wblist.priority DESC';
    
    #
    # Quarantine settings
    #
    
    $final_virus_destiny = D_BOUNCE;
    $final_spam_destiny = D_DISCARD;
    $final_banned_destiny = D_BOUNCE;
    $final_bad_header_destiny = D_PASS;
    
    # Default settings, we st this very high to not filter aut emails accidently
    $sa_spam_subject_tag = '***SPAM*** ';
    $sa_tag_level_deflt  = 20.0;  # add spam info headers if at, or above that level
    $sa_tag2_level_deflt = 60.0; # add 'spam detected' headers at that level
    $sa_kill_level_deflt = 60.0; # triggers spam evasive actions
    $sa_dsn_cutoff_level = 100;   # spam level beyond which a DSN is not sent
    
    #
    # Disable spam and virus notifications for the admin user.
    # Can be overridden by the policies in mysql
    #
    
    $virus_admin = undef;
    $spam_admin = undef;
    
    
    #
    # Enable Logging
    #
    
    $DO_SYSLOG = 1;
    $LOGFILE = "/var/log/amavis.log";  # (defaults to empty, no log)
    
    # Set the log_level to 5 for debugging
    $log_level = 0;                # (defaults to 0)
    
    $inet_socket_port = [10024,10026];
    
    # :* = send to incoming Port + 1
    $forward_method = 'smtp:127.0.0.1:*';
    $notify_method = 'smtp:127.0.0.1:*';
    $interface_policy{'10026'} = 'ORIGINATING';
    $policy_bank{'ORIGINATING'} = {
      originating => 1,
    };
    
    # IP-Addresses for internal networks => load policy MYNETS
    # - requires -o smtp_send_xforward_command=yes in postfix master.cf
    @mynetworks = qw(0.0.0.0/8 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 [::1] [FE80::]/10 [FEC0::]/10);
    
    # Allow SMTP access from IPs in @inet_acl to amvisd SMTP Port
    @inet_acl = qw( 127.0.0.1 [::1] 192.168.0.0/16 );
    
    # DKIM
    $enable_dkim_verification = 1;
    $enable_dkim_signing = 1; # load DKIM signing code
    $signed_header_fields{'received'} = 0;  # turn off signing of Received
    @dkim_signature_options_bysender_maps = (
    { '.' => { ttl => 21*24*3600, c => 'relaxed/simple' } } );
    
    #------------ Do not modify anything below this line -------------
    1;  # insure a defined return
    
    After
    Code:
    use strict;
    
    #
    # Place your configuration directives here.  They will override those in
    # earlier files.
    #
    # See /usr/share/doc/amavisd-new/ for documentation and examples of
    # the directives you can use in this file
    #
    
    @bypass_virus_checks_maps = (
       \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);
    
    @bypass_spam_checks_maps = (
       \%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);
    
    #
    # Database connection settings
    #
    
    @lookup_sql_dsn =
       ( ['DBI:mysql:database=dbispconfig;host=127.0.0.1;port=3306', 'ispconfig', '42d05dfe6a65869dc29291265737e4e4'] );
    
    # @storage_sql_dsn = @lookup_sql_dsn;  # none, same, or separate database
    #$sql_select_policy = 'SELECT "Y" as local FROM mail_domain WHERE CONCAT("@",domain) IN (%k)';
    # $banned_files_quarantine_method = 'sql';
    # $spam_quarantine_method         = 'sql';
    
    #
    # SQL Select statements
    #
    
    $sql_select_policy =
       'SELECT *,spamfilter_users.id'.
       ' FROM spamfilter_users LEFT JOIN spamfilter_policy ON spamfilter_users.policy_id=spamfilter_policy.id'.
       ' WHERE spamfilter_users.email IN (%k) ORDER BY spamfilter_users.priority DESC';
    
    
    $sql_select_white_black_list = 'SELECT wb FROM spamfilter_wblist'.
        ' WHERE (spamfilter_wblist.rid=?) AND (spamfilter_wblist.email IN (%k)) AND (spamfilter_wblist.active="y")' .
        ' ORDER BY spamfilter_wblist.priority DESC';
    
    #
    # Quarantine settings
    #
    
    $final_virus_destiny = D_BOUNCE;
    $final_spam_destiny = D_DISCARD;
    $final_banned_destiny = D_BOUNCE;
    $final_bad_header_destiny = D_PASS;
    
    # Default settings, we st this very high to not filter aut emails accidently
    $sa_spam_subject_tag = '***SPAM*** ';
    $sa_tag_level_deflt  = 20.0;  # add spam info headers if at, or above that level
    $sa_tag2_level_deflt = 60.0; # add 'spam detected' headers at that level
    $sa_kill_level_deflt = 60.0; # triggers spam evasive actions
    $sa_dsn_cutoff_level = 100;   # spam level beyond which a DSN is not sent
    
    #
    # Disable spam and virus notifications for the admin user.
    # Can be overridden by the policies in mysql
    #
    
    $virus_admin = undef;
    $spam_admin = undef;
    
    
    #
    # Enable Logging
    #
    
    $DO_SYSLOG = 1;
    $LOGFILE = "/var/log/amavis.log";  # (defaults to empty, no log)
    
    # Set the log_level to 5 for debugging
    $log_level = 0;                # (defaults to 0)
    
    $inet_socket_port = [10024,10026];
    
    # :* = send to incoming Port + 1
    $forward_method = 'smtp:127.0.0.1:*';
    $notify_method = 'smtp:127.0.0.1:*';
    $interface_policy{'10026'} = 'ORIGINATING';
    $policy_bank{'ORIGINATING'} = {
      originating => 1,
    };
    
    # IP-Addresses for internal networks => load policy MYNETS
    # - requires -o smtp_send_xforward_command=yes in postfix master.cf
    @mynetworks = qw(0.0.0.0/8 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 [FE80::]/10 [FEC0::]/10);
    
    # Allow SMTP access from IPs in @inet_acl to amvisd SMTP Port
    @inet_acl = qw( 127.0.0.1 192.168.0.0/16 );
    
    # DKIM
    $enable_dkim_verification = 1;
    $enable_dkim_signing = 1; # load DKIM signing code
    $signed_header_fields{'received'} = 0;  # turn off signing of Received
    @dkim_signature_options_bysender_maps = (
    { '.' => { ttl => 21*24*3600, c => 'relaxed/simple' } } );
    
    #------------ Do not modify anything below this line -------------
    1;  # insure a defined return
    
     
  8. Still the same issue when running the debug.
    Code:
    Jun 30 10:37:41.095 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: logging initialized, log level 0, syslog: amavis.mail
    Jun 30 10:37:41.095 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: sd_notify (no socket): STATUS=Config files have been read, modules loaded.
    Jun 30 10:37:41.095 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: starting. /usr/sbin/amavisd-new at loosestring-designs.ca amavisd-new-2.11.0 (20160426), Unicode aware, LANG="en_US.UTF-8"
    Jun 30 10:37:41.095 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: perl=5.026001, user=, EUID: 119 (119);  group=, EGID: 125 125 (125 125)
    Jun 30 10:37:41.140 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: INFO: no optional modules: unicore::lib::Nt::De.pl Unix::Getrusage
    Jun 30 10:37:41.140 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: SpamControl: attempting to load scanner SpamAssassin, module Amavis::SpamControl::SpamAssassin
    Jun 30 10:37:41.140 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: SpamControl: scanner SpamAssassin, module Amavis::SpamControl::SpamAssassin
    Jun 30 10:37:41.295 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: INFO: SA version: 3.4.2, 3.004002, no optional modules: Encode::Detect Razor2::Client::Agent Image::Info Image::Info::GIF Image::Info::JPEG Image::Info::PNG Image::Info::BMP Image::Info::TIFF
    Jun 30 10:37:41.295 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: SpamControl: init_pre_chroot on SpamAssassin done
    Jun 30 10:37:41.295 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: socket module IO::Socket::IP, protocol families available: INET, INET6
    Jun 30 10:37:41.296 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: will bind to /var/lib/amavis/amavisd.sock|unix, 127.0.0.1:10024/tcp, [::1]:10024/tcp, 127.0.0.1:10026/tcp, [::1]:10026/tcp
    Jun 30 10:37:41.296 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: sd_notify (no socket): STATUS=Transferring control to Net::Server.
    Jun 30 10:37:41.296 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: sd_notify (no socket): STATUS=Preparing to bind sockets.
    Jun 30 10:37:41.297 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: Net::Server: 2020/06/30-10:37:41 Amavis (type Net::Server::PreForkSimple) starting! pid(26940)
    Jun 30 10:37:41.300 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: Net::Server: Binding to UNIX socket file "/var/lib/amavis/amavisd.sock"
    Jun 30 10:37:41.300 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: Net::Server: Binding to TCP port 10024 on host 127.0.0.1 with IPv4
    Jun 30 10:37:41.301 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: Net::Server: Binding to TCP port 10024 on host ::1 with IPv6
    Jun 30 10:37:41.301 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: (!)Net::Server: 2020/06/30-10:37:41 Can't connect to TCP port 10024 on ::1 [Cannot assign requested address]\n  at line 64 in file /usr/share/perl5/Net/Server/Proto/TCP.pm
    Jun 30 10:37:41.301 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: sd_notify (no socket): STOPPING=1\nSTATUS=Server rundown, notifying child processes.
    Jun 30 10:37:41.301 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: Net::Server: 2020/06/30-10:37:41 Server closing!
    Jun 30 10:37:41.301 loosestring-designs.ca /usr/sbin/amavisd-new[26940]: sd_notify (no socket): STATUS=Child processes have been stopped.
    
     
  9. Code:
    [email protected]:/etc/amavis/conf.d# /etc/init.d/amavis restart
    [ ok ] Restarting amavis (via systemctl): amavis.service.
    [email protected]:/etc/amavis/conf.d# /etc/init.d/amavis stop
    [ ok ] Stopping amavis (via systemctl): amavis.service.
    [email protected]:/etc/amavis/conf.d# /etc/init.d/amavis start
    [ ok ] Starting amavis (via systemctl): amavis.service.
    [email protected]:/etc/amavis/conf.d# netstat -tap | grep 100
    tcp        0      0 localhost:10025         0.0.0.0:*               LISTEN      21847/master
    tcp        0      0 localhost:10027         0.0.0.0:*               LISTEN      21847/master
    tcp6       0      0 loosestring-design:http ip196.ip-54-36-24:60100 TIME_WAIT   -
    
     
  10. Can I disable email content filtering for the moment to allow email to flow while I work on this? I use an external spam filtering solution before email arrives to my host.
    Is it as simple as removing the "content_filter = amavis:[127.0.0.1]:10024" line from my main.cf file?
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    amavis is also responsible for dkim signing and it's an integral part of the setup, so it's not that easy to remove it, especially as the queued mails won't get delivered just by disabling it
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Try to add:

    $inet_socket_bind = '127.0.0.1';

    in the file at the end, but before the 1; line. then restart amavis.
     
  13. Ok.. I'm trying to reach paid business support now, but do you know of any companies in North America that would provide ISPConfig support? Any other thoughts, it's a production server?
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    No

    See post #12
     
  15. Adding $inet_socket_bind = '127.0.0.1'; at the end of the 50-user file seems to have done the trick.
    The mailqueue is starting to process.

    Code:
    [email protected]:/etc/amavis/conf.d# netstat -tap | grep 100
    
    tcp        0      0 localhost:10024         0.0.0.0:*               LISTEN      19225/amavisd-new (
    tcp        0      0 localhost:10025         0.0.0.0:*               LISTEN      20741/master
    tcp        0      0 localhost:10026         0.0.0.0:*               LISTEN      19225/amavisd-new (
    tcp        0      0 localhost:10027         0.0.0.0:*               LISTEN      20741/master
    tcp        0      0 localhost:38202         localhost:10025         TIME_WAIT   -
    tcp        0      0 localhost:53642         localhost:10024         TIME_WAIT   -
    tcp        0      0 localhost:35730         localhost:10026         TIME_WAIT   -
    
     
    ahrasis likes this.
  16. elmacus

    elmacus Active Member HowtoForge Supporter

    If you want to make IPv4 traffic prio, not sure if it fixes your problem, but your can easy try.
    Code:
    #Prio ipv4 when ipv6 exist:
    nano /etc/gai.conf
    # uncomment this line and save:
    precedence ::ffff:0:0/96  100
     
    ahrasis likes this.
  17. Th0m

    Th0m Active Member HowtoForge Supporter

    I always have this issue after a reboot, running
    Code:
    systemctl restart amavis
    always fixes it for me
     
  18. Thank you all for your input, but till's comment corrected the issue for me in post #12
    Tho0rn: Command I have to run on Ubuntu to restart the service is "/etc/init.d/amavis restart"
    elmacus: Thank you for the suggestion
     
  19. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Is that a very old version of Ubuntu? If memory serves me, Ubuntu 16.04 started using systemctl command, so you should use the command @Th0m wrote.
    https://wiki.ubuntu.com/SystemdForUpstartUsers
     

Share This Page