Difference between revisions of "Instalasi MailScanner"

From OnnoWiki
Jump to navigation Jump to search
(New page: Sumber: http://www.mailscanner.info/ubuntu.html Setup MailScanner di Ubuntu tampaknya tidak jalan. Jika anda sudah menginstall-nya ada baiknya di delete terlebih dulu /etc/init.d/mailsc...)
 
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
Sumber: http://www.mailscanner.info/ubuntu.html
+
Sumber:
 +
* http://www.mailscanner.info/ubuntu.html
 +
* http://www.howforge.com/how-install-mailscanner-ubuntu-dapper
 +
 
  
 
Setup MailScanner di Ubuntu tampaknya tidak jalan.
 
Setup MailScanner di Ubuntu tampaknya tidak jalan.
Line 7: Line 10:
 
  apt-get remove mailscanner
 
  apt-get remove mailscanner
  
==Install MailScanner Dependencies==
 
  
apt-get install libconvert-tnef-perl libdbd-sqlite3-perl libfilesys-df-perl libmailtools-perl \
+
==Instalasi Postfix==
libmime-tools-perl libmime-perl libnet-cidr-perl libsys-syslog-perl libio-stringy-perl libfile-temp-perl
+
 
 +
install postfix
  
Install MailScanner dari Debian .deb Source
+
sudo apt-get install postfix
  
wget http://debian.intergenia.de/debian/pool/main/m/mailscanner/mailscanner_4.68.8-1_all.deb
+
Masukan di akhir /etc/postfix/main.cf
dpkg -i mailscanner_4.68.8-1_all.deb
 
  
Note that the 4.68.8-1 in the 2 commands above should be replaced by the version number you want to install.
+
vi /etc/postfix/main.cf
The version number of the latest distribution can be found on the Downloads page.
 
Configuring MailScanner and ClamAV
 
  
Stop Postfix:
+
header_checks = regexp:/etc/postfix/header_checks
  
postfix stop
+
Buat file /etc/postfix/header_checks
  
Install the ClamAV packages:
+
vi /etc/postfix/header_checks
  
  apt-get install clamav clamav-daemon
+
  /^Received:/ HOLD
Update the ClamAV virus definitions (only need to do this once)
+
 
 +
==Instalasi MailScanner==
 +
 
 +
Install Mailscanner dan teman temannya
 +
 
 +
sudo apt-get install mailscanner tnef unrar unzip pyzor razor
 +
 
 +
Update ClamAV database
  
 
  freshclam  
 
  freshclam  
Line 34: Line 41:
 
Make directory for SpamAssassin and set permissions
 
Make directory for SpamAssassin and set permissions
  
 +
mkdir /var/spool/MailScanner/incoming
 
  mkdir /var/spool/MailScanner/spamassassin
 
  mkdir /var/spool/MailScanner/spamassassin
  chown postfix /var/spool/MailScanner/spamassassin
+
  chown -Rf postfix /var/spool/MailScanner
  
 
Backup and edit MailScanner.conf
 
Backup and edit MailScanner.conf
Line 42: Line 50:
 
  vi /etc/MailScanner/MailScanner.conf  
 
  vi /etc/MailScanner/MailScanner.conf  
  
Set the following settings in MailScanner.conf
+
Set berikut ini di MailScanner.conf
  
 
  %org-name% = ORGNAME
 
  %org-name% = ORGNAME
 
  %org-long-name% = ORGFULLNAME
 
  %org-long-name% = ORGFULLNAME
 
  %web-site% = ORGWEBSITE
 
  %web-site% = ORGWEBSITE
  Run As User = postfix
+
  Run As User = postfix                             '''PERHATIKAN!'''
  Run As Group = postfix
+
  Run As Group = postfix                           '''PERHATIKAN!'''
  Incoming Queue Dir = /var/spool/postfix/hold
+
  Incoming Queue Dir = /var/spool/postfix/hold     '''PERHATIKAN!'''
  Outgoing Queue Dir = /var/spool/postfix/incoming
+
  Outgoing Queue Dir = /var/spool/postfix/incoming '''PERHATIKAN!'''
  MTA = postfix
+
  MTA = postfix                                     '''PERHATIKAN!'''
 
  Virus Scanners = clamav
 
  Virus Scanners = clamav
 
  Spam List = SBL+XBL
 
  Spam List = SBL+XBL
 
  SpamAssassin User State Dir = /var/spool/MailScanner/spamassassin  
 
  SpamAssassin User State Dir = /var/spool/MailScanner/spamassassin  
  
Postfix settings
+
Spam Actions = deliver header "X-Spam-Status: Yes"
 +
High Scoring Spam Actions = delete
  
  postconf -e "header_checks = regexp:/etc/postfix/header_checks"
+
  Syslog Facility = local0
 +
Log Spam = yes
 +
SpamAssassin User State Dir = /var/spool/MailScanner/spamassassin
  
Edir header_checks
 
  
vi /etc/postfix/header_checks
+
Matikan permission check oleh MailScanner pada /var
  
Add this line to the file, without it nothing will work:
+
vi /etc/rc2.d/S20mailscanner
  
/^Received:/ HOLD
+
Edit agar
  
Disable permission checks on MailScanner directories
+
# check_dir /var/spool/MailScanner       ${user:-mail} ${group:-mail}
 +
# check_dir /var/lib/MailScanner        ${user:-mail} ${group:-mail}
 +
# check_dir /var/run/MailScanner        ${user:-mail} ${group:-mail}
 +
# check_dir /var/lock/subsys/MailScanner ${user:-mail} ${group:-mail}
  
Comment out the lines that check directory permissions on /var/* in /etc/rc2.d/S20mailscanner
+
Set default mailscanner
  
Set MailScanner to start at boot time
+
vi /etc/default/mailscanner
 +
 
 +
pastikan
  
In the file /etc/default/mailscanner, make sure this is set to 1:
 
 
  run_mailscanner=1  
 
  run_mailscanner=1  
 +
 +
Buat Directory & Ubah Ijin / Permission
 +
 +
sudo cp /etc/MailScanner/MailScanner.conf /etc/MailScanner/conf.d/
 +
sudo mkdir /var/spool/MailScanner/spamassassin
 +
sudo mkdir /var/run/MailScanner
 +
sudo mkdir /var/lock
 +
sudo mkdir /var/lock/subsys
 +
sudo mkdir /var/lock/subsys/MailScanner
 +
sudo chown -R postfix:postfix /var/spool/MailScanner
 +
sudo chown -R postfix:postfix /var/lib/MailScanner
 +
sudo chown -R postfix:postfix /var/run/MailScanner
 +
sudo chown -R postfix:postfix /var/lock/subsys/MailScanner
 +
 +
Edit /etc/syslog.conf
 +
 +
vi /etc/syslog.conf
 +
 +
local0.* -/var/log/mailscanner.log
  
 
Start the system
 
Start the system
  
  /etc/init.d/mailscanner start
+
  sudo /etc/init.d/syslogd restart
  /etc/init.d/postfix start
+
sudo /etc/init.d/mailscanner restart
 +
  sudo /etc/init.d/postfix restart
  
 
==Perbaikan untuk Ubuntu 8.04==
 
==Perbaikan untuk Ubuntu 8.04==
Line 100: Line 134:
 
* http://www.mailscanner.info/install_guides.html
 
* http://www.mailscanner.info/install_guides.html
 
* http://www.mailscanner.info/ubuntu.html
 
* http://www.mailscanner.info/ubuntu.html
 +
* http://www.howforge.com/how-install-mailscanner-ubuntu-dapper
 +
* http://xmodulo.com/clam-antivirus-spamassassin-mailscanner-ubuntu-mail-server.html
  
 
==Pranala Menarik==
 
==Pranala Menarik==
Line 107: Line 143:
  
 
[[Category: Linux]]
 
[[Category: Linux]]
 +
[[Category: Network Security]]

Latest revision as of 07:33, 24 April 2016

Sumber:


Setup MailScanner di Ubuntu tampaknya tidak jalan. Jika anda sudah menginstall-nya ada baiknya di delete terlebih dulu

/etc/init.d/mailscanner stop
apt-get remove mailscanner


Instalasi Postfix

install postfix

sudo apt-get install postfix

Masukan di akhir /etc/postfix/main.cf

vi /etc/postfix/main.cf
header_checks = regexp:/etc/postfix/header_checks

Buat file /etc/postfix/header_checks

vi /etc/postfix/header_checks
/^Received:/ HOLD

Instalasi MailScanner

Install Mailscanner dan teman temannya

sudo apt-get install mailscanner tnef unrar unzip pyzor razor

Update ClamAV database

freshclam 

Make directory for SpamAssassin and set permissions

mkdir /var/spool/MailScanner/incoming
mkdir /var/spool/MailScanner/spamassassin
chown -Rf postfix /var/spool/MailScanner

Backup and edit MailScanner.conf

cp /etc/MailScanner/MailScanner.conf /etc/MailScanner/MailScanner.conf.bak
vi /etc/MailScanner/MailScanner.conf 

Set berikut ini di MailScanner.conf

%org-name% = ORGNAME
%org-long-name% = ORGFULLNAME
%web-site% = ORGWEBSITE
Run As User = postfix                             PERHATIKAN!
Run As Group = postfix                            PERHATIKAN!
Incoming Queue Dir = /var/spool/postfix/hold      PERHATIKAN!
Outgoing Queue Dir = /var/spool/postfix/incoming  PERHATIKAN!
MTA = postfix                                     PERHATIKAN!
Virus Scanners = clamav
Spam List = SBL+XBL
SpamAssassin User State Dir = /var/spool/MailScanner/spamassassin 
Spam Actions = deliver header "X-Spam-Status: Yes"
High Scoring Spam Actions = delete
Syslog Facility = local0
Log Spam = yes
SpamAssassin User State Dir = /var/spool/MailScanner/spamassassin


Matikan permission check oleh MailScanner pada /var

vi /etc/rc2.d/S20mailscanner 

Edit agar

# check_dir /var/spool/MailScanner       ${user:-mail} ${group:-mail}
# check_dir /var/lib/MailScanner         ${user:-mail} ${group:-mail}
# check_dir /var/run/MailScanner         ${user:-mail} ${group:-mail}
# check_dir /var/lock/subsys/MailScanner ${user:-mail} ${group:-mail}

Set default mailscanner

vi /etc/default/mailscanner

pastikan

run_mailscanner=1 

Buat Directory & Ubah Ijin / Permission

sudo cp /etc/MailScanner/MailScanner.conf /etc/MailScanner/conf.d/
sudo mkdir /var/spool/MailScanner/spamassassin
sudo mkdir /var/run/MailScanner
sudo mkdir /var/lock
sudo mkdir /var/lock/subsys
sudo mkdir /var/lock/subsys/MailScanner
sudo chown -R postfix:postfix /var/spool/MailScanner
sudo chown -R postfix:postfix /var/lib/MailScanner
sudo chown -R postfix:postfix /var/run/MailScanner
sudo chown -R postfix:postfix /var/lock/subsys/MailScanner

Edit /etc/syslog.conf

vi /etc/syslog.conf
local0.* -/var/log/mailscanner.log

Start the system

sudo /etc/init.d/syslogd restart
sudo /etc/init.d/mailscanner restart
sudo /etc/init.d/postfix restart

Perbaikan untuk Ubuntu 8.04

Jika MailScanner men-delete directory-nya, tambahkan di /etc/rc.local kalimat berikut

mkdir /var/run/MailScanner
mkdir /var/lock/subsys
mkdir /var/lock/subsys/MailScanner
chown -R postfix:postfix /var/run/MailScanner
chown -R postfix:postfix /var/lock/subsys/MailScanner
/etc/init.d/postfix restart
/etc/init.d/mailscanner restart

Referensi

Pranala Menarik