Wednesday, July 31, 2013

How to disable USB port on Ubuntu

ปิดไม่ให้ใช้อุปกรณ์ USB port สำหรับ H/D external, Flash drive แต่ยังคงใช้อุปกรณ์เมาส์ คีย์บอร์ด USB ได้

For a permanent solution edit /etc/modprobe.d/blacklist and add following line:

  blacklist usb_storage
-------------------------------------------------------------------------------------------------------------------

then save and reboot.

สำหรับ Ubuntu 12.04 - 13.04 ใช้วิธีนี้ block-flash-driver-haddis-external

www.makeuseof.com

Monday, July 29, 2013

Set Postfix with SSL Port 465, 587

แก้ไข #vi /etc/postfix/master.cf

เพิ่มเข้าไปในไฟล์ดังกล่าว

## Enable SMTP on port 587 only for authenticated/TLS clients
submission inet n       -       n       -       -       smtpd
  -o smtpd_enforce_tls=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject

## Enable SMTP on port 465 only for authenticated/SSL clients
smtps     inet  n       -       n       -       -       smtpd
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
   
Restart Service postfix 
 
Ref.
www.brandonchecketts.com 

new link: PostfixAndSASL




Command to test smtps
#openssl s_client -connect mymailserver:myport
#openssl s_client -connect mailserver:465


Ref. testing-smtps-certificate

 
ถ้าเจอ Err. SASL authentication failure: cannot connect to saslauthd server: No such file or directory 

ให้แก้ไขดังนี้
--------------------------------------------------- 
rm -r /var/run/saslauthd/
mkdir -p /var/spool/postfix/var/run/saslauthd
ln -s /var/spool/postfix/var/run/saslauthd /var/run
chgrp sasl /var/spool/postfix/var/run/saslauthd
adduser postfix sasl
---------------------------------------------------
อ้างอิง www.jimmy.co.at 
 
 

Setup Postfix on debian

Read Link

perfect-server-debian-squeeze-ispconfig-2-p4


ตัวอย่างไฟล์ postfix config

cat /etc/postfix/main.cf
##################################################################
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# 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 (Debian/GNU)
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

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/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.

myhostname = pop3.sirivatana.co.th
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = pop3.sirivatana.co.th, localhost.sirivatana.co.th, , localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 10.10.10.222
mailbox_command =
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
html_directory = /usr/share/doc/postfix/html
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
home_mailbox = Maildir/
#######################################################################

Set dovecot with SSL port 995,993

Install Dovecot
Dovecot is POP3/IMAP server which needs MTA like Postfix to work properly.
#aptitude install dovecot-imapd dovecot-pop3d dovecot-common
Dovecot configuration file is located at: /etc/dovecot/dovecot.conf
Before we proceed we need to make some changes with dovecot configuration file. Double check the following entries in the file if the values are entered properly.
Edit the dovecot configuration file using the following command

Edit /etc/dovecot/dovecot.conf file

#vi /etc/dovecot/dovecot.conf
protocols = imap imaps pop3 pop3s
# uncomment this and change to no.
disable_plaintext_auth = no
pop3_uidl_format = %08Xu%08Xv

# PEM encoded X.509 SSL/TLS certificate and private key. They're opened before
# dropping root privileges, so keep the key file unreadable by anyone but
# root.
ssl_cert_file = /etc/ssl/certs/dovecot.pem
ssl_key_file = /etc/ssl/private/dovecot.pem

Look for the line that starts with auth default, before that insert the lines below.

auth default {
mechanisms = plain login
passdb pam {
}
userdb passwd {
}
socket listen {
client {
path = /var/spool/postfix/private/auth
mode = 0660
user = postfix
group = postfix
}
}
}
Now, rename previous auth default to auth default2. If you dont rename this then dovecot server will give you error like multiple instances of auth default.


Now, create a user to test our pop3 mail with outlook:
#adduser user_name
Note: Always create a separate user to test your mail or ftp.
Restart Dovecot using the following command
#/etc/init.d/dovecot restart

Ref.
www.debianadmin.com


create a self-signed SSL certificate for the Dovecot

openssl req -new -x509 -days 1000 -nodes -out "/etc/ssl/certs/dovecot.pem" -keyout "/etc/ssl/private/dovecot.pem"

cd /etc/ssl/private
# chown root:dovecot dovecot.pem
# chmod 440 dovecot.pem
# cd /etc/ssl/certs
# chown root:dovecot dovecot.pem
# chmod 440 dovecot.pem

 Ref.
paulschreiber.com 

Postfix Autorespon mail

Set auto reply mail on postfix

www.howtoforge.com

Source Debian 6, 7.5

Source list debain 6

deb http://ftp.th.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.th.debian.org/debian/ squeeze main contrib non-free

ตัวนี้ใช้ได้ สำหรับ Debain 6.0.10
** deb http://archive.debian.org/debian/ squeeze contrib main non-free **

Source Liste debian 7.5 Wheezy
# /etc/apt/sources.list :
deb http://ftp.th.debian.org/debian/ wheezy main contrib non-free
deb-src http://ftp.th.debian.org/debian/ wheezy main contrib non-free


Ref
how-to.linuxcareer.com

Remove exim4

วิธีลบโปรแกรมเมล Exim4
1. aptitude search ~i~nexim   แสดงโปรแกรม exim4 มีอะไรบ้าง?
2. aptitude purge ~i~nexim    ลบโปรแกรม exim4


อ้างอิง
forums.debian.net 

Tuesday, July 2, 2013

Cron [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -delete

วิธีการปิด Cron ดังกล่าวให้แก้ไข 2 ไฟล์คือ
1. /etc/php5/cli/conf.d/ming.ini
ลบบรรทัดแรก # configuration for php MING module ออกไป

2. /etc/php5/cli/conf.d/ps.ini
 ลบบรรทัดแรก # configuration for php ps module ออกไป


Monday, July 1, 2013

Script iptables on mail server

 root@smtp:/home/man# cat /etc/init.d/iptables

---------------------Begin-----------------------------------
 #!/bin/sh
#
# Firewall script for ChilliSpot
# A Wireless LAN Access Point Controller
#
# Uses $EXTIF (eth0) as the external interface (Internet or intranet) and
# $INTIF (eth1) as the internal interface (access points).
#
#
# SUMMARY
# * All connections originating from chilli are allowed.
# * Only ssh is allowed in on external interface.
# * Nothing is allowed in on internal interface.
# * Forwarding is allowed to and from the external interface, but disallowed
#   to and from the internal interface.
# * NAT is enabled on the external interface.

IPTABLES="/sbin/iptables"
EXTIF="eth0"
INTIF="eth1"

$IPTABLES -F
$IPTABLES -F INPUT
$IPTABLES -F FORWARD
$IPTABLES -F OUTPUT

$IPTABLES -P INPUT DROP
$IPTABLES -P FORWARD DROP
$IPTABLES -P OUTPUT ACCEPT

#Allow related and established on all interfaces (input)
$IPTABLES -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
$IPTABLES -A INPUT -i lo -j ACCEPT
#$IPTABLES -A INPUT -p icmp --icmp-type echo-request -j ACCEPT

#Block ip Spam with IP
$IPTABLES -A INPUT -s 41.203.64.0/24 -p tcp --dport 25 -j DROP
$IPTABLES -A INPUT -s 41.203.64.131 -p tcp --dport 25 -j DROP
$IPTABLES -A INPUT -s 41.203.64.132 -p tcp --dport 25 -j DROP
$IPTABLES -A INPUT -s 41.203.64.133 -p tcp --dport 25 -j DROP
$IPTABLES -A INPUT -s 41.203.64.134 -p tcp --dport 25 -j DROP
$IPTABLES -A INPUT -s 41.203.64.135 -p tcp --dport 25 -j DROP
$IPTABLES -A INPUT -s 67.15.76.50 -p tcp --dport 25 -j DROP
$IPTABLES -A INPUT -s 186.82.169.236 -p tcp --dport 25 -j DROP
$IPTABLES -A INPUT -s 122.164.34.182 -p tcp --dport 25 -j DROP
$IPTABLES -A INPUT -s 89.123.161.227 -p tcp --dport 25 -j DROP
$IPTABLES -A INPUT -s 208.83.136.12 -p tcp --dport 25 -j DROP
$IPTABLES -A INPUT -s 208.83.136.13 -p tcp --dport 25 -j DROP
curl -s http://www.spamhaus.org/drop/drop.lasso |grep ^[1-9]|cut -f 1 -d ' ' | xargs -iX -n 1 /sbin/iptables -A INPUT -s X -p tcp --dport 25 -j DROP

#Allow http and https on other interfaces (input).
$IPTABLES -A INPUT -p tcp -m tcp --dport 22 --syn -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport 22 -i $EXTIF -m state --state NEW -m recent --set
$IPTABLES -A INPUT -p tcp --dport 22 -i $EXTIF -m state --state NEW -m recent --update --seconds 600 --hitcount 3 -j DROP
$IPTABLES -A INPUT -p tcp ! --syn -m state --state NEW -j DROP
$IPTABLES -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
$IPTABLES -A INPUT -p tcp -m tcp --dport 25 --syn -j ACCEPT
$IPTABLES -A INPUT -p tcp -m tcp --dport 465 --syn -j ACCEPT
$IPTABLES -A INPUT -p tcp -m tcp --dport 80 --syn -j ACCEPT
$IPTABLES -A INPUT -p tcp -m tcp --dport 110 --syn -j ACCEPT
$IPTABLES -A INPUT -p tcp -m tcp --dport 10000 --syn -j ACCEPT
$IPTABLES -A INPUT -p tcp -m tcp --dport 3990 --syn -j ACCEPT

# Drop everything to and from $INTIF (forward)
$IPTABLES -A FORWARD -i lo -j ACCEPT

#Protect Syn Flood
$IPTABLES -N syn-flood
$IPTABLES -A syn-flood -i eth0 -m limit --limit 75/s --limit-burst 100 -j RETURN
$IPTABLES -A syn-flood -j LOG --log-prefix "SYN-FLOOD: "
$IPTABLES -A syn-flood -j DROP

-----------------//End//--------------------------------------

Run script boot up!

#update-rc.d iptables defaults

show iptables
#iptables -L --line-number
#iptables -S
#iptables -L -v

Save iptable
1. install package to autosave during install have a question choose Yes to save rule
aptitude install iptables-persistent

2. command: iptables-save

----For Centos----------พิมพ์คำสั่งด้านล่าง service ssh port 55001--------------------------------------
iptables -F
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 55001 --syn -j ACCEPT
iptables -A INPUT -p tcp --dport 55001 -m state --state NEW -m recent --set
iptables -A INPUT -p tcp --dport 55001 -m state --state NEW -m recent --update --seconds 600 --hitcount 3 -j DROP
iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
-----------------------------------------------------------------------------

#For samba
iptables -A INPUT -p tcp -m tcp --dport 445 --syn -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 139 --syn -j ACCEPT


Ref: digitalocean
Ref: serverfault.com

Postfix flush mail

Flush mail

#postfix flush
#postfix -f
#postqueue -f

Delete queue mail
#postsuper -d ALL

delete by email
#postqueue -p | grep -v "^ " | grep "email@domain.com" | awk -F"* " '{ print $1}' | postsuper -d -

Ref: www.cyberciti.biz

View detail mail
#postcat -vq queuemailID

Ref: 5-top-tips-reviewing-postfix-mail-queue


postcat -v
43C811592800A
43C811592800A

Set Date & Time

#hwclock --show

#date

# hwclock --systohc
OR
# hwclock --systohc --utc
***** use the second option if you use UTC.

hwclock --set --date="09/21/2005 14:23:23"

Ref: geekride.com

อ้างอิงจากเว็บไซต์ voip4share.com

For CentOS 7

check date and time
#timedatectl
set date
#timedatectl set-time mm-dd-yyyy
set time
#timedatectl set-time hh:mm:ss
To configure your system to maintain the clock in the local time, use the following command:
#timedatectl set-local-rtc yes
To configure your system to use UTC, use the following command:
#timedatectl set-local-rtc no
to set sync NTP 
#timedatectl set-ntp yes
to set unsync NTP
#timedatectl set-ntp no

Ref.
https://www.thegeekdiary.com/centos-rhel-7-how-to-set-datetime-ntp-and-timezone-using-timedatectl/

วิธีการเซ็ตอัพ Hardware Clock และ System Time บน Linux

โพสต์โดย nuiz » 07 ก.ย. 2010 17:41
พอดีผมเพิ่งเซ็ต Time บนเครื่องเซอร์เวอร์เสร็จเมื่อกี้นี้ เลยเอาวิธีการต่างๆที่ผมได้ใช้ไปมาแชร์ให้ทราบกันครับ เพื่อต้องใช้สักวันหนึ่ง

จากบทความเรื่อง "การติดตั้ง NTP บน CentOS" เป็นการเซ็ตเวลา (Time) บน Linux โดยการดึงเวลามาจาก Time Server แต่บทความนี้ผมจะแนะนำวิธีการเซ็ต System Time โดยใช้คำสั่ง "date" และเซ็ต Hardware Clock โดยใช้คำสั่ง "hwclock"

ใน เครื่องคอมพิวเตอร์ทุกเครื่องที่เราใช้งานกันอยู่ทุกวันนี้นะครับ ไม่ว่าจะเป็น Windows หรือว่า Linux หรือว่า Mac หรือว่า OS อะไรก็แล้วแต่ จะมีเวลา (Time) อยู่ด้วยกัน 2 ส่วน คือ "เวลาที่เก็บอยู่ในฮาร์ดแวร์เครื่อง" ซึ่งก็คือ BIOS นั่นเองครับ บางคนก็เรียกเวลานี้ว่า "Hardware clock" หรือ "BIOS clock" หรือ "CMOS clock" นะครับ และจะมีแบ็ตเตอรี่แบ็คอัพไว้อยู่ ถ้าแบ็ตไม่เสื่อมหล่ะก็เวลาที่เซ็ตไว้ก็จะไม่หายไปไหนครับ

เวลาอีกส่วนหนึ่งเป็นเวลาที่ระบบปฏิบัติการในเครื่องใช้ครับ เรียกว่า "System clock" โดยเมื่อเราบู๊ตเครื่อง เจ้า OS ก็จะไปเช็คเวลาจาก Hardward clock แล้วเอามาทำเป็น "System clock"

กรณี ของระบบปฏิบัติการ Linux เราต้องเลือกว่าจะใช้ Hardward clock ในรูปแบบไหนระหว่าง "UTC/GMT time" หรือว่า "Local time" ผมแนะนำว่าควรเลือกเป็นแบบ "UTC/GMT time" ดีกว่านะครับ เพราะมันจะมีเรื่องของ DST (Daylight Saving Time) หรือการปรับเปลี่ยนเวลาเข้ามาเกี่ยวข้องด้วย เรื่องของเรื่องก็คือ ถ้าเราใช้แบบ UTC/GMT แล้วเซอร์เวอร์ของเราติดตั้งอยู่ในประเทศที่ต้องมีการปรับเวลาด้วย (DST) เช่นแถบประเทศสหรัฐอเมริกา ระบบก็จะปรับเวลาให้เองโดยอัตโนมัติ โดยเราไม่ต้องทำอะไร แต่ประเทศไทยไม่มี DST นะครับ ไม่ต้องมีการปรับเวลา

แต่ การเซ็ต Hardward clock ให้เป็นแบบ UTC/GMT ก็มีข้อเสียอยู่เหมือนกันนะครับ แต่ว่าไม่น่าจะมีผลต่อเรา ข้อเสียที่ว่าก็คือ ถ้าเราติดตั้ง Linux ด้วย และ DOS ด้วยบนเครื่องเดียวกัน เวลาบน DOS จะไม่ตรงเพราะ DOS ต้องการ Hardward clock แบบ Local time นะครับ

การเซ็ต Timezone
เรา เซ็ต Timezone บน Linux โดยการทำ Symbolic Link จาก /etc/localtime ไปยัง /usr/share/zoneinfo ซึ่งจะมีไดเร็คตอรีย่อยๆที่สอดคล้องกับ Timezone ที่เราอยู่ ยกตัวอย่างเช่น ผมอยู่ที่กรุงเทพ ประเทศไทย ผมต้องทำ Symbolic Link จาก /etc/localtime ไปยัง /usr/share/zoneinfo/Asia/Bangkok ด้วยคำสั่งนี้

โค้ด: เลือกทั้งหมด
rm -f /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Bangkok /etc/localtime
การเซ็ต Hardware clock ให้อยู่ในรูปแบบ UTC/GMT time หรือ Local time
ใน ขณะที่ Linux กำลังบู๊ตเครื่อง งานอย่างหนึ่งของมันก็คือรันสคริปต์ /sbin/hwclock เพื่อก๊อบปี้เวลาใน Hardware clock แล้วนำไปใช้เป็น System clock โดยโปรแกรมสคริปต์ hwclock จะสมมติเอาว่า Hardware clock เซ็ตเป็นรูปแบบ Local time เว้นแต่ว่าเรารัน /sbin/hwclock และมี --utc ต่อท้ายด้วย แบบนี้นะครับ "/sbin/hwclock --utc" แต่การจะไปแก้ไขสคริปต์ก็ใช่ที่ ถ้าเราใช้ Red Hat หรือว่า CentOS ให้แก้ไขไฟล์ /etc/sysconfig/clockแทน แก้ไขบรรทัด UTC ให้เป็น true
โค้ด: เลือกทั้งหมด
UTC=true
แล้วเซฟไฟล์

การเซ็ต System Clock
บน Linux ใช้คำสั่ง date เช่น ถ้าต้องการเซ็ตวันที่และเวลาปัจจุบันให้เป็น 7 กันยายน 2010 เวลา 15:55:25 ก็ใช้คำสั่งนี้
โค้ด: เลือกทั้งหมด
date -s "09/07/2010 15:55:25"
มีเครื่องหมาย "" ด้วยนะครับ

การเช็คเวลาเวลาปัจจุบันบน Linux
ใช้คำสั่ง date ไม่ต้องมีอะไรต่อท้าย
โค้ด: เลือกทั้งหมด
date
การเซ็ต Hardware clock
ปกติวิธีการที่ผมใช้คือเซ็ต System Clock ก่อน จากนั้นค่อยเซ็ต Hardware clock จาก System clock โดยการรันคำสั่ง
เซ็ตในรูปแบบ Local time
โค้ด: เลือกทั้งหมด
/sbin/hwclock --systohc
เซ็ตในรูปแบบ UTC/GMT time
โค้ด: เลือกทั้งหมด
/sbin/hwclock --systohc --utc
เช็ค Hardware clock
โค้ด: เลือกทั้งหมด
hwclock
ถ้าเป็นแบบ UTC/GMT แล้วต้องการดูเวลาที่เทียบเท่ากับ Local time
โค้ด: เลือกทั้งหมด
hwclock --utc
ถ้าเวลาในโปรแกรมไม่ตรง
ถ้า เราใช้คำสั่ง date พบว่าเวลาตรง แต่โปรแกรมอื่นแสดงเวลาไม่ตรง แก้ไขโดยการสร้าง Symbolic Link จาก /usr/lib/zoneinfo ไปยัง /usr/share/zoneinfo
โค้ด: เลือกทั้งหมด
ln -s /usr/share/zoneinfo /usr/lib/zoneinfo

Ref: www.voip4share.com 

Configue MailScanner + MailWatch

1. หลังจาก configure เสร็จแล้ว ปรากฎว่าส่งเมลไป ไม่ได้รับแต่มันเข้าไปอยู่ที่ /var/spool/postfix/hold ให้แก้ไขไฟล์ /usr/sbin/MailScanner โดยเพิ่ม -U ในบรรทัดแรก ดังนี้

#!/usr/bin/perl -I/usr/share/MailScanner/ -U

อ้างอิง: bugs.launchpad.net

2. การเซทให้ mailscanner อ่านภาษาไทยได้
  
- การแก้ไข Apache โดย Set php.ini 2 จุดคือ
   1. #vim /etc/php5/apach2/php.ini
   2. #vim /etc/php5/cli/php.ini
    ใส่บรรทัดนี้เข้า default_charset = "TIS-620" หรือแก้ไขจากที่มีอยู่แล้ว restart service apache2

- แก้ไข mysql ไฟล์ /etc/mysql/my.cnf มี 3 จุดดังนี้
     [client] (ช่วงต้น)
port            = 3306
socket          = /var/run/mysqld/mysqld.sock
default-character-set=tis620

      # my edit (ช่วงกลาง) ตรงนี้ใส่เพิ่มเข้าไปเอง
default-character-set = tis620
collation-server = tis620_thai_ci
init-connect='SET NAMES TIS620'
character-set-server = tis620

      [mysql] (ช่วงท้าย)
#no-auto-rehash # faster start of mysql but no tab completition
default-character-set=tis620

       Restart servic mysql
     ต่อไปลบ Database ตัวเดิมทิ้ง และสร้างขึ้นมาใหม่ด้วย phpmyadmin และทำการ import database mailwatch เข้ามาใช้งาน

Import / Export Database





เมื่อได้ไฟล์ฐานข้อมูลแล้วก็โยนไฟล์ดังกล่าวเข้าไปยัง Server ดังนี้
scp Downloads/localhost.sql admin@192.168.xxx.x:/home/admin

ต่อก็ใช้คำสั่ง Import Database เข้าไป โดยเข้าไปยัง path ที่เราก็อปปี้ดาต้าเบสมา แล้วใช้คำสั่งดังนี้

** ให้ลบดาต้าเบสตัวเดิมออกก่อน Import database

mysql -uroot -p < localhost.sql
เสร็จแล้วเข้าไปสร้าง User เพื่อเข้าใช้งานฐานข้อมูล

mysql -u root -p
mysql> GRANT ALL ON mailscanner.* TO mailwatch@localhost IDENTIFIED BY 'mailwatchpassword';
mysql> quit

จบครับ.
เครดิตการ setup mailscaner mailwatch , Inport database opensource.cc.psu.ac.th

download mailwatch


Blacklists & Whiltelist

Edit file MailScanner_perl_scripts/SQLBlackWhiteList.pm

my($db_user) = ‘mailwatch’;
my($db_pass) = ‘password';

copy file SQLBlackWhiteList.pm to /etc/MailScanner/CustomFunctions/
#cp SQLBlackWhiteList.pm /etc/MailScanner/CustomFunctions/

edit /etc/MailScanner/MailScanner.conf

Is Definitely Not Spam = &SQLWhitelist
Is Definitely Spam = &SQLBlacklist
Always Looked Up Last = &MailWatchLogging


#service mailscanner restart