메뉴 건너뛰기

리눅스 관련 모음

본문시작

조회 수 62845 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

국산 통나무 수공예 남원제기, 남원목기

자료가 도움이 되셨다면
혼수용품제수용품 필요시
남원제기 공식 홈페이지 http://남원제기.kr
남원목기 공식 홈페이지 http://otchil.kr
에서 구매 해 주세요
정성껏 모시겠습니다.
 

What is Vipul's Razor?

Vipul's Razor is a distributed, collaborative, spam detection and filtering network. Through user contribution, Razor establishes a distributed and constantly updating catalogue of spam in propagation that is consulted by email clients to filter out known spam. Detection is done with statistical and randomized signatures that efficiently spot mutating spam content. User input is validated through reputation assignments based on consensus on report and revoke assertions which in turn is used for computing confidence values associated with individual signatures.

 

 

Install amavisd-new, SpamAssassin

 

  • apt-get install amavisd-new spamassassin clamav clamav-daemon zoo unzip bzip2 libnet-ph-perl libnet-snpp-perl libnet-telnet-perl nomarch lzop pax

  •  

     

    설치후 의존성 때문에 AppArmor가 설치되므로 처음에 했던데로 제거를한다:

    1. /etc/init.d/apparmor stop
      update-rc.d -f apparmor remove
      apt-get remove apparmor apparmor-utils

     

    amavisd-new의 설정은 /etc/amavis/conf.d 에 위치

    아래는 세 개의 주요 파일을 수정하지만, 해당 디렉토리의 설정 파일을 하나씩 살펴보길 바란다.

     

    vi /etc/amavis/conf.d/15-content_filter_mode

    @bypass_virus_checks_maps 와  @bypass_spam_checks_maps 의 커맨트를 푼다.

     

    vi /etc/amavis/conf.d/20-debian_defaults

     spam-/virus-mails을 위한 spam settings and the actions 을 살펴보고 필요하면 수정해 사용하다. 아래는 기본값이다.

    $QUARANTINEDIR = "$MYHOME/virusmails";

    $quarantine_subdir_levels = 1; # enable quarantine dir hashing
    $log_recip_templ = undef; # disable by-recipient level-0 log entries
    $DO_SYSLOG = 1; # log via syslogd (preferred)
    $syslog_ident = 'amavis'; # syslog ident tag, prepended to all messages
    $syslog_facility = 'mail';
    $syslog_priority = 'debug'; # switch to info to drop debug output, etc
    $enable_db = 1; # enable use of BerkeleyDB/libdb (SNMP and nanny)
    $enable_global_cache = 1; # enable use of libdb-based cache if $enable_db=1
    $inet_socket_port = 10024; # default listening socket
    $sa_spam_subject_tag = '***SPAM*** ';
    $sa_tag_level_deflt = 2.0; # add spam info headers if at, or above that level
    $sa_tag2_level_deflt = 6.31; # add 'spam detected' headers at that level
    $sa_kill_level_deflt = 6.31; # triggers spam evasive actions
    $sa_dsn_cutoff_level = 10; # spam level beyond which a DSN is not sent
    [...]
    $final_virus_destiny = D_DISCARD; # (data not lost, see virus quarantine)
    $final_banned_destiny = D_BOUNCE; # D_REJECT when front-end MTA
    $final_spam_destiny = D_BOUNCE;
    $final_bad_header_destiny = D_PASS; # False-positive prone (for spam)

     

     

     

    vi /etc/amavis/conf.d/50-user

    파일의 중간 쯤에 $pax='pax'; 를 추가한다.

     

    vi /etc/amavis/conf.d/05-node_id

    1. $myhostname = "your_domain";

     

     

    clamav사용자, 그룹 추가후 시작

    1. adduser clamav amavis
      /etc/init.d/amavis restart
      /etc/init.d/clamav-daemon restart
      /etc/init.d/clamav-freshclam restart

     

     

     

    Postfix에 추가

     

    Postfix to pipe incoming email through amavisd-new:

    1. postconf -e 'content_filter = amavis:[127.0.0.1]:10024'
      postconf -e 'receive_override_options = no_address_mappings'

     

    vi /etc/postfix/master.cf

    아래 라인을 추가해 준다.

    master.cf

    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
    -o smtpd_bind_address=127.0.0.1

     

     

     

    Postfix 를 재시동한다.

    1. /etc/init.d/postfix restart

     

     

    1. netstat -tap

     

    아래와 같이 Postfix (master) listening on port 25 (smtp) and 10025, and amavisd-new on port 10024:

    1. tcp        0      0 localhost:10024         *:*                     LISTEN      915/amavisd (master
      tcp        0      0 localhost:10025         *:*                     LISTEN      1993/master    
      tcp        0      0 gtko-ubuntu:mysql       *:*                     LISTEN      29433/mysqld   
      tcp        0      0 *:smtp                  *:*                     LISTEN      1993/master

     

     

    Testing amavisd host and port

    1. $ telnet localhost 10024

      220 [127.0.0.1] ESMTP amavisd-new service ready
      EHLO localhost
      250-[127.0.0.1]
      250-VRFY
      250-PIPELINING
      250-SIZE
      250-ENHANCEDSTATUSCODES
      250-8BITMIME
      250-DSN
      250 XFORWARD NAME ADDR PROTO HELO
      QUIT
      221 2.0.0 [127.0.0.1] amavisd-new closing transmission channel

     

     

    Testing the dedicated Postfix smtpd-daemon

    When Postfix was reloaded, the new, dedicated smtpd-daemon (127.0.0.1:10025) should have been activated. A successful connection looks like this:

    1. $ telnet 127.0.0.1 10025

      220 mail.example.com ESMTP Postfix (2.3.2)
      EHLO localhost
      250-mail.example.com
      250-PIPELINING
      250-SIZE 40960000
      250-ETRN
      250-STARTTLS
      250-AUTH PLAIN CRAM-MD5 LOGIN DIGEST-MD5
      250-AUTH=PLAIN CRAM-MD5 LOGIN DIGEST-MD5
      250-ENHANCEDSTATUSCODES
      250-8BITMIME
      250 DSN
      QUIT
      221 2.0.0 Bye

     

     

     

    test-messages/sample-nonspam.txt from the amavisd test-messages to send an e-mail:

    1. $ telnet localhost 10024

      220 [127.0.0.1] ESMTP amavisd-new service ready
      HELO localhost
      250 [127.0.0.1]
      MAIL FROM: <>
      250 2.1.0 Sender OK
      RCPT TO: <postmaster>
      250 2.1.5 Recipient postmaster OK
      DATA
      354 End data with <CR><LF>.<CR><LF>
      From: virus-tester
      To: undisclosed-recipients:;
      Subject: amavisd test - simple - no spam test pattern

      This is a simple test message from the amavisd-new test-messages.
      .
      250 2.6.0 Ok, id=30897-02, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 079474CE44
      QUIT
      221 2.0.0 [127.0.0.1] amavisd-new closing transmission channel

     

    The maillog shows the delivery path. Here's an excerpt from a successful delivery process:

    1. Nov 1 11:28:10 mail postfix/smtpd[30986]: connect from localhost[127.0.0.1] 1

      Nov 1 11:28:10 mail postfix/smtpd[30986]: 079474CE44: client=localhost[127.0.0.1]
      Nov 1 11:28:10 mail postfix/cleanup[30980]: 079474CE44: message-id=<20061101102810.079474CE44@mail.example.com>
      Nov 1 11:28:10 mail postfix/qmgr[20432]: 079474CE44: from=<>, size=822, nrcpt=1 (queue active)
      Nov 1 11:28:10 mail amavis[30897]: (30897-02) Passed BAD-HEADER, <> -> <postmaster>, quarantine: badh-le5gjszxowBk, mail_id: le5gjszxowBk, Hits: -1.76, queued_as: 079474CE44, 39505 ms 2
      Nov 1 11:28:10 mail postfix/smtpd[30986]: disconnect from localhost[127.0.0.1]
      Nov 1 11:28:10 mail postfix/local[30987]: 079474CE44: to=<postmaster@example.com>, relay=local, delay=0.27, delays=0.14/0.05/0/0.08, dsn=2.0.0, status=sent (delivered to mailbox: postmaster) 3
      Nov 1 11:28:10 mail postfix/qmgr[20432]: 079474CE44: removed

     

    1

    amavisd connects with Postfix dedicated smtpd-daemon and hands over the e-mail that had been sent during the telnet session. smtpd gives a queue-id of 079474CE44 that can be tracked throughout the maillog.

    2

    amavisd notices it has checked and sent an e-mail to <postmaster>.

    3

    Postfix' local-service logs it successfully delivered an e-mail with queue-id 079474CE44 to the mailbox of postmaster.

    If the test fails, the following questions may help to debug the problem:

    • Does amavisd-new log errors?

    • Does running amavisd-new in debug-mode report errors?

     

     

    Install Razor, Pyzor And DCC And Configure SpamAssassin

    Razor, Pyzor and DCC are spamfilters that use a collaborative filtering network.

     

    1. apt-get install razor pyzor

     

    DCC isn't available in the Ubuntu 8.10 repositories, so we install it as follows:

     

    1. cd /tmp
      wget http://www.dcc-servers.net/dcc/source/dcc-dccproc.tar.Z
      tar xzvf dcc-dccproc.tar.Z
      cd dcc-dccproc-1.3.104
      ./configure --with-uid=amavis
      make
      make install
      chown -R amavis:amavis /var/dcc
      ln -s /var/dcc/libexec/dccifd /usr/local/bin/dccifd

       

      cd /tmp

    2. wget http://launchpadlibrarian.net/11564361/dcc-server_1.3.42-5_i386.deb
      wget http://launchpadlibrarian.net/11564359/dcc-common_1.3.42-5_i386.deb
      dpkg -i dcc-common_1.3.42-5_i386.deb
      dpkg -i dcc-server_1.3.42-5_i386.deb

     

     

     

    SpamAssassin이 필터 프로그램, dcc, pyzor, razor을 사용하게 설정:

     

    vi /etc/spamassassin/local.cf

    아래를 local.cf 에 추가해 준다.

    1. #dcc

      use_dcc 1
      dcc_path /usr/local/bin/dccproc

      #pyzor
      use_pyzor 1
      pyzor_path /usr/bin/pyzor

      #razor
      use_razor2 1
      razor_config /etc/razor/razor-agent.conf

      #bayes
      use_bayes 1
      use_bayes_rules 1
      bayes_auto_learn 1

     


    SpamAssassin에서 dcc 플러그인을 사용 가능으로 변경

    vi /etc/spamassassin/v310.pre

    loadplugin Mail::SpamAssassin::Plugin::DCC 라인의 커맨트를 푼다.

    check SpamAssassin configuration:

    1. spamassassin --lint

     

    amavisd-new afterwards:

    1. /etc/init.d/amavis restart

     

    SpamAssassin rulesets 갱신:

    1. sa-update --no-gpg

     

    rulesets 갱신을 cron job에 추가 crontab -e

    이것은 룰셋을 4.23h 마다 갱신한다.

    1. sudo crontab -e

      23 4 */2 * * /usr/bin/sa-update --no-gpg &> /dev/null

    crontab -l

    1. m h dom mon dow command
      23 4 */2 * * /usr/bin/sa-update --no-gpg &> /dev/null

     

     

     

     

     

    Quota Exceedance Notifications

    If you want to get notifications about all the email accounts that are over quota, then do this:

    1. cd /usr/local/sbin/
      wget http://puuhis.net/vhcs/quota.txt
      mv quota.txt quota_notify
      chmod 755 quota_notify

    vi /usr/local/sbin/quota_notify

    이 파일의 아래쪽 두 라인에 %를 추가해 준다.

    1. [...] my $POSTFIX_CF = "/etc/postfix/main.cf"; my $MAILPROG = "/usr/sbin/sendmail -t"; my $WARNPERCENT = 80; my @POSTMASTERS = ('postmaster@yourdomain.tld'); my $CONAME = 'My Company';

      my $COADDR = 'postmaster@yourdomain.tld';

      my $SUADDR = 'postmaster@yourdomain.tld'; my $MAIL_REPORT = 1; my $MAIL_WARNING = 1; [...] print "Subject: WARNING: Your mailbox is $lusers{$luser}% full.n"; [...]

                 print "Your mailbox: $luser is $lusers{$luser}% full.nn"; [...]
                

    cron job에 쿼타 알림을 추가하려면

    crontab -e

    1. 0 0 * * * /usr/local/sbin/quota_notify &> /dev/null

     

    참조

    http://www.howtoforge.com/virtual-users-domains-postfix-courier-mysql-squirrelmail-ubuntu9.04-p3

    ClamAV Upgrade and db update

     

    http://www.freespamfilter.org/FC4.html

     

       

    List of Articles
    번호 분류 제목 글쓴이 날짜 조회 수
    190 설정 및 사용법 IPv6 비활성화 방법 햇빛소년 2023.04.01 683
    189 에러해결 기가인터넷 CAT.6 인터넷 속도 100Mb 인식 문제 해결 햇빛소년 2023.03.17 654
    188 에러해결 그누보드 영카트 대신택배 배송조회 깨짐 현상 정확한 URL 링크 주소. 햇빛소년 2022.08.23 666
    187 에러해결 httpd: undefined symbol: apr_procattr_perms_set_register 에러 해결 햇빛소년 2018.12.04 3701
    186 에러해결 PHP 7.2.1 configuration error 조치. 햇빛소년 2018.01.22 3349
    185 에러해결 yum install 시에 Transaction check error: 발생할 때 햇빛소년 2017.01.12 5330
    184 설정 및 사용법 firefox 재 시작시 특정 사이트만 자동로그인이 풀릴 때 file 햇빛소년 2016.07.11 1544
    183 설정 및 사용법 route 및 iptables를 이용한 리눅스 특정 IP 접속 차단하는 법 햇빛소년 2016.06.14 2733
    182 에러해결 bind ignoring out-of-zone data 에러에 대하여 햇빛소년 2016.05.30 1558
    181 설정 및 사용법 메일(mail) 인증 설정 및 발송 확인 테스트 햇빛소년 2016.05.26 1349
    180 설정 및 사용법 mqueue 설정 및 사용법 햇빛소년 2016.05.26 2044
    179 에러해결 selinux troubleshooting 해결 명령 햇빛소년 2016.02.28 1109
    178 설치관련 리눅스 메인보드 정보확인 명령어 햇빛소년 2016.02.28 2403
    177 CentOS 7 mariadb 소스설치시 Curses library not found. Please install appropriate package, 햇빛소년 2016.02.16 2439
    176 CentOS 7 RHEL 7 / CentOS 7 : Disable Firewalld and use iptables 햇빛소년 2016.02.15 1330
    175 에러해결 phpmyadmin 상위버전 설치시 "PHP 5.5+ is required" 에러 대처 방법 햇빛소년 2015.12.14 3519
    174 에러해결 configure: error: snmp.h not found. Check your SNMP installation. 햇빛소년 2015.12.01 1184
    173 에러해결 푸시 앱 연동과 카카오톡 링크 에러 해결을 마무리 하면서.. 햇빛소년 2015.09.18 1948
    172 에러해결 mysql root 및 사용자 계정 password(비밀번호) 변경 및 에러 대처. 햇빛소년 2015.08.11 3585
    171 에러해결 named error -> dumping master file: tmp-6bFrQDtE5l: open: permission denied 햇빛소년 2015.05.06 1372
    Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 Next
    / 10