แสดงกระทู้

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - golfreeze

Pages: 1 ... 133 134 [135] 136 137 ... 146
2011
thai language in squirrel mail
trick ของการ set ภาษาไทย ใน squirrel mail น่ะครับ

ปัญหามาจาก เวลาใช้ webmail squirrel ส่งเมลที่เป็น ภาษาไทย แล้ว ปลายทางได้รับเป็นภาษา ที่ถูก
encoding
ด้วย code หรือรหัส ต่างๆ ทำให้ไม่สามารถอ่าน ได้ออก ครับ วิธีแก้ ของผมก็

มีขั้นตอนดังนี้ น่ะครับ
1.ต้องเข้าไป set
# cd /usr/share/squirrelmail/locale/th_TH/LC_MESSAGES
# vi squirrelmail.po
....
...
"Content-Type: text/plain; charset=tis-620\n"
"Content-Transfer-Encoding: 8bit\n"

2.ทำการแก้ไข ไฟล์
# cd /usr/share/squirrelmail/functions
# vi i18n.php

/* translation is disabled because it contains less than 50%
* translated strings
*/
$languages['th_TH']['NAME'] = 'Thai';
$languages['th_TH']['CHARSET'] = 'tis-620';
$languages['th_TH']['LOCALE'] = 'th_TH.TIS-620';
$languages['th']['ALIAS'] = 'th_TH';

3.รันไฟล์ perl script เพื่อ set ค่า config ของ language ใน squirrel mail ครับ
ขึ้นอยู่กับไฟล์ที่เก็บว่าอยู่ path ไหนด้วยน่ะครับ
# cd /usr/share/squirrelmail/config
# ./conf.pl
----> 10: Language
----> 1: th_TH
----> 2: tis-620
----> Save
แล้ว quit ออกมาครับ

4. สุดท้าย set ให้ apache config support "tis-620"
#vi /usr/local/etc/apache2/httpd.conf

เพิ่ม config
AddDefaultCharset tis-620

แค่นี้ ล่ะครับ แล้วลอง test ส่งเมลดูน่ะครับ รับรองเป็น ภาษาไทย ครับ
อิอิ

golfreeze[at]packetlove.com
Make Love Not War!!

2012
สำหรับลูกค้า packetlove.com

สามารถใช้งาน squirrel mail แทนตัว webmail ตัวเก่าได้แล้วน่ะครับ
โดยเข้าไปที่

http://www.โดเมนของท่าน/squirrelmail

เมื่อกี้เพิ่งแก้ ปัญหาให้ ใช้งาน attach file ได้โดยแก้ที่

#cd /xxx/xxxxx/squirrelmail/config/
#vi config.php

เพื่อเข้าไปดู $attachment_dir

แล้วเข้าไป สร้าง folder ดังกล่าว แล้วเปลี่ยนให้เป็นสิทธิ์ของ apache ครับ

เท่านี้ ก็สามารถใช้งาน attachfile ใน squirrelmail ได้แล้ว

ถ้าเพื่อนๆ มีคำถามก็สอบถามได้น่ะครับ

2013
all application on unix knowledges by golfreeze / Re: Apache redirect code error403
« on: มกราคม 24, 2011, 11:27:23 AM »
##redirect traffic web โดยใช้ tool ครับ via DNSDIY.NET

ต้องการ redirect traffic ของเว็บ xx.com ===> test.com
ของผมใช้เป้น onlinenic.com
login เข้าไปเสร็จก็ไปที่ domain ที่ต้องการทำ forwarding ครับ

โดยของ onlinenic จะให้ใช้ tools ส่วนของ DNSDIY.NET

เสร็จแล้ว ก็ทำโดย ใส่ ชื่อ domain กับ password เมื่อได้แระก็เข้าไป manage โดย เลือกส่วนของ URL
Forwarding

ใส่ค่าดังนี้
็HOST | URL | TYPE
ว่างเปล่า | test.com | redirect
www | test.com | redirect

เสร็จขั้นตอนนี้ แล้วเข้าไปเปลี่ยน ns ใน onlinenic ของ domain xx.com ให้ไปเป็น
ns1.dns-diy.net
ns2.dns-diy.net

ครับแค่นี้ก็เรียบร้อย

เราสามารถ redirect ให้ mail เปลี่ยนไปที่อื่นได้ โดยใส่ในช่อง MX น่ะครับ

มีปัญหาก็สอบถามไว้ได้ น่ะครับ
golfreeze[at]packetlove.com

2014
วิธีการเข้าไปอ่านเมลผ่าน protocol imap (port 143) ด้วยวิธีการ telnet
#telnet localhost 143

ขั้นตอนที่ 1 ทำการใส่ username password ตาม command
. login user@test.com password

ขั้นตอนที่ 2 ทำการ list ดูรายชื่อ folder ภายใน account ของเรา
. LIST "INBOX" "*"
* LIST (\HasNoChildren) "." "INBOX.Folder1"
* LIST (\HasNoChildren) "." "INBOX.Folder2"
* LIST (\HasChildren) "." "INBOX.Folder3"
. OK Completed

ขั้นตอนที่ 3 ทำการ select folder ที่ต้องการเข้าไปอ่านเมล
. SELECT "INBOX"
* FLAGS (\Answered \Flagged \Draft \Deleted \Seen NonJunk Junk $NotJunk $Junk $Forwarded)
* OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen NonJunk Junk $NotJunk $Junk $Forwarded \*)] 
* 2 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1136990532]
* OK [UIDNEXT 12498]
* OK [NOMODSEQ] Sorry, modsequences have not been enabled on this mailbox
. OK [READ-WRITE] Completed

ขั้นตอนที่ 4 หลังจากพบว่ามีเมลอยู่ใน inbox อยู่ 2 ฉบับ (2 EXISTS) และต้องการอ่านเมลฉบับที่ 2 ก็
. FETCH 2 BODY []

Return-Path: <root@example.com>
X-Original-To: golftest
Delivered-To: golftest@example.com
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
        by spz.example.com (Postfix) with SMTP id 6B9E49F78B
        for <golftest>; Thu, 30 Apr 2015 09:57:03 +0700 (ICT)
Message-Id: <20150430025706.6B9E49F78B@example.com>
Date: Thu, 30 Apr 2015 09:57:03 +0700 (ICT)
From: root@example.com
To: undisclosed-recipients:;

check send second on 0954
)
* 2 FETCH (FLAGS (\Seen \Recent))
. OK FETCH completed.

ขั้นตอนที่ 5 หลังจากเจอ mail content แล้วต้องการจบ process และ logout ออก
. logout

2016
กรณี ที่ต้องการ reconfigure ของ perl ก็เข้าตามนี้

#perl -MCPAN -e shell

CPAN>o conf help
CPAN>o conf init

ให้ set ค่าต่างๆ ใหม่ ทำการ เลือก urllist ที่ต้องการไป check package และ install ตัว ผมเลือกเป็น
ประเทศไทย
เสร็จแล้ว รอให้ perl ทำการ update package ต่างๆ ให้เสร็จ

เมื่อหยุดแล้ว ทำการ wrote configure โดย
CPAN>o conf commit

เรียบร้อยแล้วก็ออกครับ
CPAN>exit

เข้าใหม่ แล้วดูตรง version CPAN exploration and modules installation (v1.9205) ครับจะเป็น
ตัวใหม่ล่าสุด

2017
พอดีจะ ทำการ test connection ของ imap ครับผ่าน
user = golfreeze@xxx.com
pass = passxxx
เริ่มต้นเลย

วิธีการเข้าไปอ่านเมลผ่าน protocol imap (port 143) ด้วยวิธีการ telnet
#telnet localhost 143

ขั้นตอนที่ 1 ทำการใส่ username password ตาม command
. login golfreeze@xxx.com passxxx

ขั้นตอนที่ 2 ทำการ list ดูรายชื่อ folder ภายใน account ของเรา
. LIST "INBOX" "*"
* LIST (\HasNoChildren) "." "INBOX.Folder1"
* LIST (\HasNoChildren) "." "INBOX.Folder2"
* LIST (\HasChildren) "." "INBOX.Folder3"
. OK Completed

ขั้นตอนที่ 3 ทำการ select folder ที่ต้องการเข้าไปอ่านเมล
. SELECT "INBOX"
* FLAGS (\Answered \Flagged \Draft \Deleted \Seen NonJunk Junk $NotJunk $Junk $Forwarded)
* OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen NonJunk Junk $NotJunk $Junk $Forwarded \*)] 
* 2 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1136990532]
* OK [UIDNEXT 12498]
* OK [NOMODSEQ] Sorry, modsequences have not been enabled on this mailbox
. OK [READ-WRITE] Completed

ขั้นตอนที่ 4 หลังจากพบว่ามีเมลอยู่ใน inbox อยู่ 2 ฉบับ (2 EXISTS) และต้องการอ่านเมลฉบับที่ 2 ก็
. FETCH 2 BODY []

Return-Path: <root@example.com>
X-Original-To: golftest
Delivered-To: golftest@example.com
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
        by spz.example.com (Postfix) with SMTP id 6B9E49F78B
        for <golftest>; Thu, 30 Apr 2015 09:57:03 +0700 (ICT)
Message-Id: <20150430025706.6B9E49F78B@example.com>
Date: Thu, 30 Apr 2015 09:57:03 +0700 (ICT)
From: root@example.com
To: undisclosed-recipients:;

check send second on 0954
)
* 2 FETCH (FLAGS (\Seen \Recent))
. OK FETCH completed.

ขั้นตอนที่ 5 หลังจากเจอ mail content แล้วต้องการจบ process และ logout ออก
. logout

2018
พอดีวันนี้ ได้ migrate mail ครับเลยเอาข้อมูลวิธี มาให้เพื่อนๆ พี่ๆ น้องๆ ดูหน่อยเผื่อจะเป็นประโยชน์
บ้าง

อิอิ
การใช้ imapcopy ในการ migrate mail ที่เป็น imap ครับโดยผ่าน perl module

ต้อง download imapcopy shell ก่อนครับโดยหาจาก google ก็ได้ชื่อ Golfinho-IMAPCopy-0.06.tar.gz
เริ่มต้นลง perl module
#perl -MCPAN -e shell
กระผมเลือกใช้ ค่า default ทั้งหมด
เสร็จแล้วทำการลง ตัว Bundle ครับ ในครั้งแรกที่มีการ ลง perl module
CPAN>install Bundle::CPAN

รอสักครู่ นานสองนาน เมื่อเสร็จแล้ว install IMAPClient Module
CPAN>install Mail::IMAPClient

ออกจาก cpan โดย
CPAN>quit
สั่งให้มัน updatedb
#updatedb
#locate IMAPCopy.pm

ทำการ copy IMAPCopy.pm_hack ไปทับไฟล์ IMAPCopy.pm ซึ่ง perl จะเรียกใช้งาน module นี้ครับ
แล้วเราก็เรียก script imapcopy
ถ้ามี user เดียวสั่งแบบนี้ เลยครับ
/usr/bin/imapcopy -from-host mail.xxx.com -from-login golfreeze -from-pass passxxx -to-host
localhost -to-login golfreeze@destination.com -to-pass passxxx -tmpdir /tmp -to-debug

ของผมมี migrate เยอะเลยใช้วิธีเขียน shell script ช่วยครับ
++++++++++++++++++++++++++++++++++++++++++++++++
#!/bin/bash
PATH=/sbin:/usr/sbin:/bin
export PATH

##Directory value

HOME=/mbox
USERLIST=/home/golf/imapcopy_only
ID=vmail
GID=mail


## Check user and create for dir user ##
if [ -s ${USERLIST}/userlist_seperate_test ] # if file size of new_account > 0
then
#lock account file
chown root ${USERLIST}/userlist_seperate_test
chmod 770 ${USERLIST}/userlist_seperate_test

while read account_dest
do
#Begin imapcopy change #account_ori and #account_dest
/usr/bin/imapcopy -from-host mail.xxx.com -from-login golfreeze -from-pass passxxx
-to-host
localhost -to-login golfreeze@destination.com -to-pass passxxx -tmpdir /tmp

done < ${USERLIST}/userlist_seperate_test

cat /dev/null > ${USERLIST}/userlist_seperate_test
chown root:root ${USERLIST}/userlist_seperate_test
chmod 770 ${USERLIST}/userlist_seperate_test

else
#nothing to do
exit
fi
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
สำหรับ ตัวแปร
account_ori = account ต้นทาง
account_dest = account ปลายทาง

2019
iftop คล้ายๆ กับ top ใน unix ครับ แต่ตัวนี้ จะเอาดู traffic ของ network ที่เข้ามาที่ server
###iftop
#apt-get install iftop

ใช้งานก็
#iftop

มี option ให้เลือกมากมาย
#man iftop ดูน่ะครับ

อีกตัวคือ

iptraf
#apt-get install iptraf

ดูปริมาณ traffic ที่วิ่งผ่าน การ์ดแลน ครับ
แจ่มดี อิอิ

ลองดูน่ะครับ

2021
junning ระบบ mail ให้ secure ครับ
การ block จำนวนการส่งเมลของ แต่ล่ะ user
http://help.directadmin.com/item.php?id=81

สอน spam ใน directadmin
http://help.directadmin.com/item.php?id=188

2022
เว็บนี้ ช่วยได้เยอะเลย

http://help.directadmin.com

มีเกือบทุกอย่าง

ผมลง webalizer เพิ่มครับ
wget -O /usr/local/bin/webalizer http://files.directadmin.com/services/freebsd6/webalizer
chmod 755 /usr/local/bin/webalizer

เสร็จแล้วไปเขียน ลง crontab ครับ
10 0 * * * root echo "action=tally&value=all" >>
/usr/local/directadmin/data/task.queue

แค่นี้แล้วลองเข้าดูเว็บ webalizer ในส่วนของ control panel ดูน่ะครับ

2023
##mail gateway in debian + vhcs

สำหรับ vhcs เองจะไม่ได้ทำ config เกี่ยวกับ mail gateway ที่มีตัว clamav spamassasin amavisd
มาให้น่ะครับ เราต้องทำการ modify เองเล็กน้อย แต่เพื่อมาตรฐานที่ดี ของเรา ควรทำไว้ครับ
เพื่อจะได้ใช้งาน email ได้อย่างไม่มีปัญหามารบกวน อิอิ


### INSTALL ###


### Postfix

apt-get install postfix

dpkg-reconfigure postfix

#postfix re-configuration, if needed



configuration files:

/etc/postfix/main.cf
/etc/postfix/master.cf

(logs to syslog by default)



### Amavis

apt-get install amavisd-new



configuration files:

/etc/amavis/conf.d/01-debian

/etc/amavis/conf.d/05-domain_id
/etc/amavis/conf.d/05-node_id
/etc/amavis/conf.d/15-av_scanners

/etc/amavis/conf.d/15-content_filter_mode
/etc/amavis/conf.d/20-debian_defaults
/etc/amavis/conf.d/25-amavis_helpers
/etc/amavis/conf.d/30-template_localization
/etc/amavis/conf.d/50-user



amavisd-new might complaint about hostname during install, when trying to start amavisd-new

type: hostname

if it returns only your hostname (like debian), but not your fully qualified domain name (like
debian.myhosting.com) you have found the problem.

check your /etc/hosts file, it should contain the following two lines: (if not, fix it!)

127.0.0.1 localhost.localdomain localhost
your_ip your_hostname your_hostname.your_domain_name



check by typing: hostname

if it returns this format, it will be OK: your_hostname.your_domain_name



### Clamav

apt-get install clamav-daemon clamav-freshclam



configuration files:

/etc/clamav/clamav.conf

(logs to /var/log/clamav.log and freshclam.log)



### Spamassassin

apt-get install spamassassin spamc



configuration files:

/etc/spamassassin/init.pre
/etc/spamassassin/init.pre.dpkg-dist
/etc/spamassassin/local.cf
/etc/spamassassin/plugintest.cf
/etc/spamassassin/sa-update-keys
/etc/spamassassin/v310.pre
/etc/spamassassin/v312.pre

(no logging by default)



### CONFIGURATION ###



### Setting up Postfix for using amavisd-new:



Add the following line to end of /etc/postfix/main.cf

content_filter = smtp-amavis:[127.0.0.1]:10024



Add the following lines to end of /etc/postfix/master.cf

smtp-amavis unix - - n - 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
-o disable_dns_lookup=yes
localhost:10025 inet n - n - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-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



Restart both damons to load the modified config files:

/etc/init.d/postfix restart

/etc/init.d/amavis restart



If should work, without even touching any of amavis's conf files.

By default, both of them log to: /var/log/syslog

You can track mail processing by typing: tail -f /var/log/syslog



When a mail arrives, postfix will call amavisd-new, to process mails.



### Setting up amavisd-new to call clamav-daemon



A default clamav.conf should look like this somehow:

LocalSocket /var/run/clamav/clamd.ctl
FixStaleSocket
User clamav
AllowSupplementaryGroups
ScanMail
ScanArchive
ArchiveMaxRecursion 5
ArchiveMaxFiles 1000
ArchiveMaxFileSize 10M
ArchiveMaxCompressionRatio 250
ReadTimeout 180
MaxThreads 12
MaxConnectionQueueLength 15
LogFile /var/log/clamav/clamav.log
LogSyslog
LogTime
LogFileMaxSize 0
PidFile /var/run/clamav/clamd.pid
DatabaseDirectory /var/lib/clamav
SelfCheck 3600
ScanOLE2
ScanPE
DetectBrokenExecutables
ScanHTML
ArchiveBlockMax
LogVerbose



Add user clamav to group amavis:

adduser clamav amavis



start freshclam-daemon: (updates virus signiture database 24 times a day by default)

/etc/init.d/clamav-freshclam start

by default you don't need to touch clamav's conf files.

/etc/amavis/conf.d/15-av_scanners contains every necessary setting for amavis to communicate with
clamav-daemon



simply restart clamav-daemon:

/etc/init.d/clamav-daemon start



When a mail arrives, postfix will call amavisd-new, that calls clamav-daemon to process mails for
viruses.



### Spamassassin + spamc

After searching for days, how to call spamassassin from amavisd-new + reading some documentation,
where it was suggested to use spamc, i have decided not to call spamassassin from amavisd-new

spamc is a client for spamd, the daemon of spamassassin

as it it is claimed, "Spamc has extremely low overhead in loading, so it should be much
faster to load than the whole spamassassin program"

speed, CPU and memory usage might be an issue when processing thousends of mails per hour



create a user, called spamd:

adduser --shell=/bin/false --disabled-password --gecos=,,, spamd

at /etc/default/spamassassin set ENABLED=1 (if needed)

add some logging capability:

OPTIONS="--create-prefs --max-children 5 --helper-home-dir -s /var/log/spamd.log"

at /etc/postfix/master.cf modify at the beginning of the file

from:

smtp inet n - - - - smtpd

to:

smtp inet n - - - - smtpd
-o content_filter=spamassassin

add the follwing lines to the end of the file:

spamassassin unix - n n - - pipe
user=spamd argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

restart postfix to the modifications take effect:

/etc/init.d/postfix restart

2024
#####change shell in freebsd bsd

#pw usermod useraccount -s /bin/sh

2025
all application on unix knowledges by golfreeze / Re: Apache redirect code error403
« on: มกราคม 24, 2011, 11:20:30 AM »
##Config forbidden page

ถ้าอยากให้ขึ้นเป็นไฟล์ ให้ download ได้ผ่านหน้าเว็บน่ะครับ เราต้องเข้าไปเพิ่ม configuration ใน
httpd.conf ดังนี้ ครับ
เช่นต้องการ ให้มัน โพล่ที่หน้า http://www.xxx.com/download

<Directory "/test/xxxx/html/download/">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

ดูตรง Options ให้ดีน่ะครับต้องเป็น FollowSymlinks ถึงจะ เปิดให้โหลดได้ครับ

Pages: 1 ... 133 134 [135] 136 137 ... 146