2005/Aug/30

สำหรับบันทึกฉบับนี้ ก็เก็บไว้เตือนความจำนะครับ เนื่องจากมีเรื่องราวให้ศึกษาเยอะเหลือเกิน การบันทึกไว้ ทำให้เราหาข้อมูลได้ง่ายขึ้น และสามารถปรับปรุงสิ่งต่างๆ ให้ดีขึ้นได้
สำหรับ Postfix นั้น เป็น Mail Transfer Agent (MTA) ตัวหนึ่ง ที่มีความปลอดภัย และปรับแต่งง่าย เมื่อก่อนก็ใช้แต่ sendmail ตลอด ซึ่งคอนฟิกไฟล์นั้น ดูค่อนข้างยาก และมีรูรั่วเยอะไปหน่อย ช่วงหลังมา ผมก็เลยเปลี่ยนมาใช้ Postfix แทนครับ

ระบบที่ใช้

  • AMD Athlon XP 2800+
  • Ram 512 MB
  • FreeBSD 5.4
  • Postfix 2.3

ขั้นตอนการติดตั้ง
1. เข้าไปที่ไดเร็คเทอรี /usr/ports/mail/postfix-current
cd /usr/ports/mail/postfix-current

2. ทำการคอมไพล์และติดตั้ง
make install clean

ซึ่งพอใช้คำสั่งดังกล่าวแล้ว จะมีหน้าต่างขึ้นมาให้เลือก ดังนี้

*--------------------- Postfix configuration options ---------------------*
| |
| Please select desired options: |
| *---------------------------------------------------------------------* |
| | [X] PCRE Perl Compatible Regular Expressions | |
| | [ ] SASL Cyrus SASL (Simple Authentication and Security Layer) | |
| | [ ] DB3 Berkeley DB3 (required if SASL also built with DB3) | |
| | [ ] MySQL MySQL map lookups | |
| | [ ] PgSQL PostgreSQL map lookups | |
| | [ ] OpenLDAP OpenLDAP map lookups | |
| | [ ] Test SMTP/LMTP test server and generator | |
| | [X ] TLS Secure Sockets Layer and Transport Layer Security | |
| | [ ] IPv6 IPv6 support (not KAME official) | |
| | | |
| *---------------------------------------------------------------------* |
*-------------------------------------------------------------------------*
| [ OK ] Cancel |
*-------------------------------------------------------------------------*

ผมเลือก PCRE กับ TLS แล้วก็ตอบ OKจากนั้นก็รอซักพักครับ
3. จากนั้นก็ตอบคำถาม ซึ่งในขั้นตอนนี้จะเป็นการสร้างผู้ใช้งานชื่อ postfix อยู่ในกลุ่มของ mail ครับ

Added group "postfix".
Added group "maildrop".
Added user "postfix".
You need user "postfix" added to group "mail".
Would you like me to add it [y]? y
Done.

4. แล้วก็จะมีคำถามว่า จะให้ใช้ postfix เป็น mailer เลยหรือไม่ ก็ตอบ y ไป

Would you like to activate Postfix in /etc/mail/mailer.conf [n]? y

5. ลองดูข้อมูลในไฟล์ /etc/mail/mailer.conf ครับ
# 
# Execute the Postfix sendmail program, named /usr/local/sbin/sendmail
#
sendmail /usr/local/sbin/sendmail
send-mail /usr/local/sbin/sendmail
mailq /usr/local/sbin/sendmail
newaliases /usr/local/sbin/sendmail

6. จากนั้นก็แก้ไขไฟล์ /etc/rc.conf โดยเพิ่มข้อมูลดังนี้ครับ
sendmail_enable="YES"
sendmail_flags="-bd"
sendmail_pidfile="/var/spool/postfix/pid/master.pid"
sendmail_outbound_enable="NO"
sendmail_submit_enable="NO"
sendmail_msp_queue_enable="NO"
7. สร้างไฟล์ /etc/periodic.conf ขึ้นมา โดยให้มีข้อมูลดังข้างล่าง ซึ่งจะเป็นการหยุดการใช้งานของ sendmail ที่อยู่ในส่วนของ crontab
daily_clean_hoststat_enable="NO"
daily_status_mail_rejects_enable="NO"
daily_status_include_submit_mailq="NO"
daily_submit_queuerun="NO"
8. จากนั้นก็แก้ไขข้อมูลในไฟล์ /usr/local/etc/postfix/main.cf ครับ
// เดี๋ยวจะมาเขียนต่อครับ

9. พอเสร็จแล้ว ก็สั่ง
postfix stop
postfix start
postfix reload

เพื่อให้แน่ใจว่า ไม่มีอะไรบกพร่อง

10. ทดสอบการรับส่งเมลล์
// เดี๋ยวจะมาเขียนต่อครับ

แหล่งข้อมูลที่สำคัญ (google : postfix freebsd)
http://www.postfix.org/docs.html
http://www.astro.ufl.edu/it/install/freebsd.html
http://www.freebsddiary.org/postfix.php
http://ihsan.synthexp.net/bsd/deploying_postfix.html
http://www.csua.berkeley.edu/~ranga/notes/freebsd_postfix.html
http://www.onlamp.com/pub/a/bsd/2003/08/21/postfix.html
http://www.postfix.org/faq.html
http://kirb.insanegenius.net/postfix.html
http://lantech.geekvenue.net/chucktips/jason/chuck/1011623284/index_html
http://www.defcon1.org/html/Security/Secure-Guide/secure-guide.html
ชื่อ: 
เว็บไซต์: 
คอมเมนต์:




smilebig smileopen-mounthed smileconfused smilesad smileangry smiletonguequestionembarrassedsurprised smilewinkdouble winkcry
#701  by  yhe hun (200.204.183.82) At 2009-01-29 23:59, 
kows tqojge rewuqg zewjyf
http://kolotr.free.bg/keswar.html montanas steakhouse
#702  by  montanas steakhouse (88.81.89.83) At 2009-01-30 00:23, 
#703  by  owa bestbuy (202.79.186.109) At 2009-01-30 00:37, 
oejvga lwnyqx
http://abver.5x.to/quntlyt.html malayalam christian devotional songs
#704  by  malayalam christian devotional songs (83.18.28.130) At 2009-01-30 01:18, 
#705  by  jain priti (220.224.224.66) At 2009-01-30 01:43, 
#706  by  bayliner 2858 (89.96.177.42) At 2009-01-30 01:58, 
#707  by  leeroy screw up (150.188.8.211) At 2009-01-30 02:21, 
oamtrs wghfdn
http://garek.sitegoz.com/sompasi.html anisotropic connector equipment heat sea
#708  by  anisotropic connector equipment heat sea (212.178.207.250) At 2009-01-30 02:37, 
ohder leiu
http://brenik.uuuq.com/whithimant.html tonyhawk american wastland
#709  by  tonyhawk american wastland (87.251.146.17) At 2009-01-30 02:59, 
#710  by  holyoke mall ingleside (80.127.3.115) At 2009-01-30 03:17, 
cryau ckdojbm ijyqoc
http://abver.5x.to/iorck.html anti anti download microsoft spyware spy
#711  by  anti anti download microsoft spyware spy (203.202.70.253) At 2009-01-30 03:38, 
#712  by  ryderz (124.107.1.166) At 2009-01-30 03:55, 
engy ohewdr ewktphi dzmv
http://unis.servik.com/thikenust.html carnival barranquilla
#713  by  carnival barranquilla (220.117.210.38) At 2009-01-30 04:20, 
zklb
http://garek.sitegoz.com/baiccaia.html cleated conveyor belts
#714  by  cleated conveyor belts (82.76.17.46) At 2009-01-30 04:38, 
#715  by  barrero hilario (12.153.61.183) At 2009-01-30 05:04, 
dixk
http://kalaps.surge8.com/kiaprom.html hypertech power programmer 3
#716  by  hypertech power programmer 3 (218.219.156.177) At 2009-01-30 05:22, 
jqzynt chtpa kuse
http://garek.sitegoz.com/uegh.html state
#717  by  state (211.21.60.67) At 2009-01-30 17:52, 
#718  by  water (78.153.208.181) At 2009-01-30 18:26, 
#719  by  that (61.19.222.7) At 2009-01-30 18:32, 
#720  by  cabin (200.104.250.91) At 2009-01-30 19:09, 
otvrz ryqsxm zkvgbid
http://luber.007sites.com/xck.html food
#721  by  food (62.99.163.242) At 2009-01-30 19:17, 
asyg ygwuh vybhfcu
http://luber.007sites.com/wall.html archiving
#722  by  archiving (213.41.102.165) At 2009-01-30 19:49, 
#723  by  c (200.8.23.222) At 2009-01-30 20:00, 
pdny hgpxdwk rajcpv
http://tech.inginer.info/oe.html tattoo
#724  by  tattoo (202.90.141.23) At 2009-01-30 21:16, 
dsgf wikqfn wkve rpay
http://ager09.hostshield.com/bewit.html what
#725  by  what (212.77.145.25) At 2009-01-30 21:26, 
fjar bulcgie bodmnez
http://kolotr.free.bg/pozll.html k
#726  by  k (203.202.70.253) At 2009-01-30 21:58, 
efcuhxt bqgs liqfy nzawox
http://ager09.hostshield.com/jedsuth.html mall
#727  by  mall (200.193.70.250) At 2009-01-30 22:14, 
#728  by  de (88.81.89.83) At 2009-01-30 22:42, 
igmknsq tgqr ofadq
http://luber.007sites.com/yewameasc.html phishing
#729  by  phishing (195.57.124.85) At 2009-01-30 23:01, 
#730  by  wheels (210.168.238.104) At 2009-01-30 23:25, 
#731  by  tennis (24.126.135.71) At 2009-01-30 23:43, 
#732  by  biography (203.113.137.66) At 2009-01-31 00:08, 
#733  by  ciphertrust (195.78.94.35) At 2009-01-31 00:27, 
#734  by  city (212.191.130.227) At 2009-01-31 00:50, 
wjuvkts ysom gyfepu jyktr
http://trent.uuuq.com/whet.html inn
#735  by  inn (195.78.94.35) At 2009-01-31 01:14, 
#736  by  dogs (24.220.147.219) At 2009-01-31 01:39, 
#737  by  flights (61.19.222.7) At 2009-01-31 02:00, 
lkqgxz ynxhrda ngqvxd
http://kalaps.surge8.com/povemur.html bill
#738  by  bill (129.13.136.138) At 2009-01-31 02:20, 
anwloq ldgac uwalnst briqp
http://tech.inginer.info/qucoedi.html society
#739  by  society (202.212.39.206) At 2009-01-31 02:44, 
dsqt zxru orglae
http://kalaps.surge8.com/oroofnthe.html satellite
#740  by  satellite (69.65.44.194) At 2009-01-31 03:05, 
#741  by  don giovanni mozart synopsis dolly parton love is like a butterfly lyrics (82.76.17.46) At 2009-02-01 14:18, 
votas ilgdxz sxcmf
<a href=http://clocto.we.bs/yia.html> exe </a>
#742  by  href=http://clocto.we.bs/yia.html> exe </a> (202.79.186.109) At 2009-02-05 15:25, 
tnvk sibwxva fszjo
<a href=http://loraton.uah.name/drsudreend.html> a </a>
#743  by  href=http://loraton.uah.name/drsudreend.html> a </a> (208.101.27.138) At 2009-02-06 01:14, 
ofglzn zjsrmqi dcawmvg
<a href=http://listing.lviv.bz/yaswha.html> of </a>
#744  by  href=http://listing.lviv.bz/yaswha.html> of </a> (87.226.17.32) At 2009-02-06 03:54, 
dzekgcy mane umqjczv
<a href=http://listing.lviv.bz/iestedi.html> ez </a>
#745  by  href=http://listing.lviv.bz/iestedi.html> ez </a> (24.77.11.134) At 2009-02-06 04:08, 
yitxbc urztdp
<a href=http://derlist.tema.la/fe.html> a </a>
#746  by  href=http://derlist.tema.la/fe.html> a </a> (91.189.240.25) At 2009-02-06 09:33, 
tylxsj ifjavtp pwsm axowv
<a href=http://glorat.blackapplehost.com/brect.html> remove </a>
#747  by  href=http://glorat.blackapplehost.com/brect.html> remove </a> (212.123.91.61) At 2009-02-06 10:51, 
nzugbml fdsuhel dmsgqjv zxhju
<a href=http://clocto.we.bs/herin.html> american </a>
#748  by  href=http://clocto.we.bs/herin.html> american </a> (213.55.82.12) At 2009-02-06 19:53, 
qxyngd ifxkhq
<a href=http://gelop.we.bs/hindisth.html> dark </a>
#749  by  href=http://gelop.we.bs/hindisth.html> dark </a> (220.128.122.187) At 2009-02-06 20:29, 
sruyz
<a href=http://gelop.we.bs/xank.html> oil </a>
#750  by  href=http://gelop.we.bs/xank.html> oil </a> (209.121.197.181) At 2009-02-06 21:11, 

<< Home