how to make amavis notify spam mail to sender

Discussion in 'Installation/Configuration' started by dewakomputer, Jun 10, 2015.

  1. dewakomputer

    dewakomputer New Member

    hello all
    Can you help me, I was desperate to find a solution to my problem, I've tried a variety of ways on the internet but I can not.

    i want amavis bounce back spam mail to sender, as notifications when email they send is considered spam.

    this log from /var/log/maillog
    Code:
    Jun 10 05:26:40 mx postfix/smtpd[2005]: connect from smtp.dnet.net.id[202.148.1.24]
    Jun 10 05:26:40 mx postfix/smtpd[2005]: NOQUEUE: client=smtp.dnet.net.id[202.148.1.24]
    Jun 10 05:26:41 mx amavis[2002]: (02002-01) Blocked SPAM {NoBounceInbound}, [202.148.1.24]:32222 [202.148.1.50] <akbar_ibnu@dnet.net.id> -> <jagoteksdno.com@jagotekno.com>, Message-ID: <5577CA91.2060101@dnet.net.id>, mail_id: fVIV7hSU0D2c, Hits: 39.289, size: 1257, Tests: [DNET_DEAR_WEBMAIL_USER_SUBJECT=20,DNET_DEAR_WINNER_RAWBODY=20,RCVD_IN_DNSWL_LOW=-0.7,SPF_PASS=-0.001,T_RP_MATCHES_RCVD=-0.01], 1410 ms
    Jun 10 05:26:41 mx postfix/smtpd[2005]: disconnect from smtp.dnet.net.id[202.148.1.24]
    and this config amavisd.conf
    Code:
    use strict;
    
    # a minimalistic configuration file for amavisd-new with all necessary settings
    #
    #   see amavisd.conf-default for a list of all variables with their defaults;
    #   for more details see documentation in INSTALL, README_FILES/*
    #   and at http://www.ijs.si/software/amavisd/amavisd-new-docs.html
    
    
    # COMMONLY ADJUSTED SETTINGS:
    
    # @bypass_virus_checks_maps = (1);  # controls running of anti-virus code
    # @bypass_spam_checks_maps  = (1);  # controls running of anti-spam code
    # $bypass_decode_parts = 1;         # controls running of decoders&dearchivers
    
    $max_servers = 2;            # num of pre-forked children (2..30 is common), -m
    $daemon_user  = 'amavis';    # (no default;  customary: vscan or amavis), -u
    $daemon_group = 'amavis';    # (no default;  customary: vscan or amavis), -g
    
    $mydomain = 'jagotekno.com';   # a convenient default for other settings
    
    $MYHOME = '/var/spool/amavisd';   # a convenient default for other settings, -H
    $TEMPBASE = "$MYHOME/tmp";   # working directory, needs to exist, -T
    $ENV{TMPDIR} = $TEMPBASE;    # environment variable TMPDIR, used by SA, etc.
    $QUARANTINEDIR = undef;      # -Q
    # $quarantine_subdir_levels = 1;  # add level of subdirs to disperse quarantine
    # $release_format = 'resend';     # 'attach', 'plain', 'resend'
    # $report_format  = 'arf';        # 'attach', 'plain', 'resend', 'arf'
    
    # $daemon_chroot_dir = $MYHOME;   # chroot directory or undef, -R
    
    $db_home   = "$MYHOME/db";        # dir for bdb nanny/cache/snmp databases, -D
    # $helpers_home = "$MYHOME/var";  # working directory for SpamAssassin, -S
    $lock_file = "/var/run/amavisd/amavisd.lock";  # -L
    $pid_file  = "/var/run/amavisd/amavisd.pid";   # -P
    #NOTE: create directories $MYHOME/tmp, $MYHOME/var, $MYHOME/db manually
    
    $log_level = 0;              # verbosity 0..5, -d
    $log_recip_templ = undef;    # disable by-recipient level-0 log entries
    $do_syslog = 1;              # log via syslogd (preferred)
    $syslog_facility = 'mail';   # Syslog facility as a string
               # e.g.: mail, daemon, user, local0, ... local7
    
    $enable_db = 1;              # enable use of BerkeleyDB/libdb (SNMP and nanny)
    # $enable_zmq = 1;           # enable use of ZeroMQ (SNMP and nanny)
    $nanny_details_level = 2;    # nanny verbosity: 1: traditional, 2: detailed
    $enable_dkim_verification = 1;  # enable DKIM signatures verification
    $enable_dkim_signing = 1;    # load DKIM signing code, keys defined by dkim_key
    
    @local_domains_maps = ( [".$mydomain"] );  # list of all local domains
    
    @mynetworks = qw( 127.0.0.0/8 [::1] [FE80::]/10 [FEC0::]/10
                      10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 );
    
    $unix_socketname = "$MYHOME/amavisd.sock";  # amavisd-release or amavis-milter
                   # option(s) -p overrides $inet_socket_port and $unix_socketname
    
    $inet_socket_port = 10024;   # listen on this local TCP port(s)
    # $inet_socket_port = [10024,10026];  # listen on multiple TCP ports
    
    $policy_bank{'MYNETS'} = {   # mail originating from @mynetworks
      originating => 1,  # is true in MYNETS by default, but let's make it explicit
      os_fingerprint_method => undef,  # don't query p0f for internal clients
    };
    
    # it is up to MTA to re-route mail from authenticated roaming users or
    # from internal hosts to a dedicated TCP port (such as 10026) for filtering
    $interface_policy{'10026'} = 'ORIGINATING';
    
    $policy_bank{'ORIGINATING'} = {  # mail supposedly originating from our users
      originating => 1,  # declare that mail was submitted by our smtp client
      allow_disclaimers => 1,  # enables disclaimer insertion if available
      # notify administrator of locally originating malware
      virus_admin_maps => ["virusalert\@$mydomain"],
      spam_admin_maps  => ["virusalert\@$mydomain"],
      warnbadhsender   => 1,
      # forward to a smtpd service providing DKIM signing service
      forward_method => 'smtp:[127.0.0.1]:10027',
      # force MTA conversion to 7-bit (e.g. before DKIM signing)
      smtpd_discard_ehlo_keywords => ['8BITMIME'],
      bypass_banned_checks_maps => [1],  # allow sending any file names and types
      terminate_dsn_on_notify_success => 0,  # don't remove NOTIFY=SUCCESS option
    };
    
    $interface_policy{'SOCK'} = 'AM.PDP-SOCK'; # only applies with $unix_socketname
    
    # Use with amavis-release over a socket or with Petr Rehor's amavis-milter.c
    # (with amavis-milter.c from this package or old amavis.c client use 'AM.CL'):
    $policy_bank{'AM.PDP-SOCK'} = {
      protocol => 'AM.PDP',
      auth_required_release => 0,  # do not require secret_id for amavisd-release
    };
    
    $sa_tag_level_deflt  = undef;  # add spam info headers if at, or above that level
    $sa_tag2_level_deflt = 8.0;  # add 'spam detected' headers at that level
    $sa_kill_level_deflt = 8.1;  # triggers spam evasive actions (e.g. blocks mail)
    $sa_dsn_cutoff_level = 15.0;   # spam level beyond which a DSN is not sent
    $sa_crediblefrom_dsn_cutoff_level = 18; # likewise, but for a likely valid From
    # $sa_quarantine_cutoff_level = 25; # spam level beyond which quarantine is off
    $penpals_bonus_score = 8;    # (no effect without a @storage_sql_dsn database)
    $penpals_threshold_high = $sa_kill_level_deflt;  # don't waste time on hi spam
    $bounce_killer_score = 100;  # spam score points to add for joe-jobbed bounces
    
    $sa_mail_body_size_limit = 400*1024; # don't waste time on SA if mail is larger
    $sa_local_tests_only = 0;    # only tests which do not require internet access?
    
    # @lookup_sql_dsn =
    #   ( ['DBI:mysql:database=mail;host=127.0.0.1;port=3306', 'user1', 'passwd1'],
    #     ['DBI:mysql:database=mail;host=host2', 'username2', 'password2'],
    #     ["DBI:SQLite:dbname=$MYHOME/sql/mail_prefs.sqlite", '', ''] );
    # @storage_sql_dsn = @lookup_sql_dsn;  # none, same, or separate database
    # @storage_redis_dsn = ( {server=>'127.0.0.1:6379', db_id=>1} );
    # $redis_logging_key = 'amavis-log';
    # $redis_logging_queue_size_limit = 300000;  # about 250 MB / 100000
    
    # $timestamp_fmt_mysql = 1; # if using MySQL *and* msgs.time_iso is TIMESTAMP;
    #   defaults to 0, which is good for non-MySQL or if msgs.time_iso is CHAR(16)
    
    $virus_admin               = "virusalert\@$mydomain";                    # notifications recip.
    
    $mailfrom_notify_admin     = "virusalert\@$mydomain";                    # notifications sender
    $mailfrom_notify_recip     = "virusalert\@$mydomain";                    # notifications sender
    $mailfrom_notify_spamadmin = "spam.police\@$mydomain";                    # notifications sender
    $mailfrom_to_quarantine = ''; # null return path; uses original sender if undef
    
    @addr_extension_virus_maps      = ('virus');
    @addr_extension_banned_maps     = ('banned');
    @addr_extension_spam_maps       = ('spam');
    @addr_extension_bad_header_maps = ('badh');
    # $recipient_delimiter = '+';  # undef disables address extensions altogether
    # when enabling addr extensions do also Postfix/main.cf: recipient_delimiter=+
    
    $path = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/usr/bin:/bin';
    # $dspam = 'dspam';
    
    $MAXLEVELS = 14;
    $MAXFILES = 3000;
    $MIN_EXPANSION_QUOTA =      100*1024;  # bytes  (default undef, not enforced)
    $MAX_EXPANSION_QUOTA = 500*1024*1024;  # bytes  (default undef, not enforced)
    
    $sa_spam_subject_tag = undef;
    $defang_virus  = 1;  # MIME-wrap passed infected mail
    $defang_banned = 1;  # MIME-wrap passed mail containing banned name
    # for defanging bad headers only turn on certain minor contents categories:
    $defang_by_ccat{CC_BADH.",3"} = 1;  # NUL or CR character in header
    $defang_by_ccat{CC_BADH.",5"} = 1;  # header line longer than 998 characters
    $defang_by_ccat{CC_BADH.",6"} = 1;  # header field syntax error
    
    
    # OTHER MORE COMMON SETTINGS (defaults may suffice):
    
    $myhostname = 'mx.jagotekno.com';  # must be a fully-qualified domain name!
    
    # $notify_method  = 'smtp:[127.0.0.1]:10025';
    # $forward_method = 'smtp:[127.0.0.1]:10025';  # set to undef with milter!
    
    $final_virus_destiny      = D_REJECT; #D_DISCARD;
    $final_banned_destiny     = D_REJECT; #D_BOUNCE;
    $final_spam_destiny       = D_BOUNCE; #D_REJECT; #D_DISCARD;  #!!!  D_DISCARD / D_REJECT
    $final_bad_header_destiny = D_REJECT; #D_BOUNCE;
    # $bad_header_quarantine_method = undef;
    
    $spam_quarantine_to  = undef;
    
    
    please help me
     
  2. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    $warnspamsender = 0;

    I would NEVER bounce spam-mails.
     
  3. dewakomputer

    dewakomputer New Member

    hai florian thnks for answer... my porblem solved now :D

    solved => http : // www200 . pair . com/mecham/spam/bypassing.html
     

Share This Page