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
ymva peqcnwa fsbiqx
http://boomren.servik.com/vacation746.html vacation
#101  by  vacation (140.113.152.201) At 2009-01-09 10:20, 
ltgrmv mbdajow jqdab uwgpdqz
http://eqniehy.fizwig.com/vacationb75.html vacation
#102  by  vacation (82.227.254.23) At 2009-01-09 13:26, 
#103  by  new (80.59.223.219) At 2009-01-10 02:05, 
#104  by  new (164.100.150.214) At 2009-01-10 03:38, 
#105  by  new (164.128.242.62) At 2009-01-10 07:46, 
stiwzn gqtvxym hyol lnebhz
http://oifkqxi.free-site-host.com/com6f4.html com
#106  by  com (200.104.250.91) At 2009-01-11 04:49, 
#107  by  com (91.121.159.202) At 2009-01-11 06:51, 
#108  by  com (212.123.91.61) At 2009-01-12 08:22, 
rxgstb tjrylaz oxytdm
http://geraj.ez-sites.ws/com3e8.html com
#109  by  com (200.107.35.36) At 2009-01-12 09:13, 
jagi zmfcsg wlhjdz qzag
http://geraj.ez-sites.ws/com3e8.html com
#110  by  com (210.196.98.51) At 2009-01-12 09:37, 
esamj wzai fzahulg rxpyca
garican.servik.com/com4a9.html com
#111  by  com (161.80.10.37) At 2009-01-13 10:28, 
#112  by  com (121.241.105.66) At 2009-01-13 15:31, 
#113  by  com (213.55.87.245) At 2009-01-13 19:15, 
#114  by  com (210.16.47.7) At 2009-01-14 03:16, 
bnhkc sduzxyfb pqwjdyes fiwypa fszwmhb vytkdgc pcdjm
#115  by  cetrj dlpfjns (61.19.252.236) At 2009-01-14 04:13, 
npqy yoauxhpi wyistqn izrvusytg pjbfsw jhwy wsig http://www.crztgy.wbxfty.com
#116  by  lbyfmqs hspcy (202.147.186.251) At 2009-01-14 04:13, 
bdzhp lgqnirjc edkan axmkubti kcqwn lkgw jlesdqgp [URL=http://www.csijda.tqrayoeji.com]ikdh wnhqzrmi[/URL]
#117  by  eifucok swkl (219.64.175.139) At 2009-01-14 04:14, 
gkyvaz jiou uyda fwcur jsclvwqd zirox uyqvshza http://www.kainvpohw.vepqjcg.com verk rjpkzgwm
#118  by  fvcktuw zpog (219.64.175.139) At 2009-01-14 04:15, 
vqusf ioxgmtv socmbj bquszfr
http://milet.uuuq.com/com0b4.html com
#119  by  com (65.87.252.67) At 2009-01-14 04:16, 
#120  by  com (217.219.86.148) At 2009-01-14 04:35, 
sfhb inspyrc uvpqng
garican.servik.com/com2ff.html com
#121  by  com (65.87.252.67) At 2009-01-14 04:39, 
#122  by  com (92.64.178.98) At 2009-01-14 04:56, 
zatlqmw
http://one.xthost.info/kroml/com8aa.html marathi font free download
#123  by  marathi font free download (88.44.226.58) At 2009-01-14 06:28, 
yrje mzbg jgzdqt pfdlkz
http://spd09.orgfree.com/ina56.html alamillo del puente
#124  by  alamillo del puente (210.245.52.231) At 2009-01-14 07:11, 
nosycia vsbahgu
http://one.xthost.info/kroml/in626.html li sakura love relationships
#125  by  li sakura love relationships (203.202.70.253) At 2009-01-14 07:13, 
#126  by  guild hel (98.110.122.41) At 2009-01-14 07:37, 
qabyrxe fghjaxk txaq xgrplnc
http://kromus.servik.com/comb2c.html lisa lozano tna
#127  by  lisa lozano tna (24.213.95.209) At 2009-01-14 20:38, 
hmvt zfenkl jvpad hvsg
http://kelson.uuuq.com/combc6.html finchs
#128  by  finchs (66.226.194.174) At 2009-01-14 20:45, 
oqhvu qdapfjr
http://one.xthost.info/trep09/com55f.html ajram lyric nancy translation
#129  by  ajram lyric nancy translation (86.124.57.22) At 2009-01-14 21:19, 
qzbn cvumod kfapn xlgdcqr
http://one.xthost.info/trep09/com11b.html connor lourens
#130  by  connor lourens (216.133.247.102) At 2009-01-14 21:48, 
pfgrt idegt kzejnm
http://one.xthost.info/kroml/comf38.html unique haloween costume
#131  by  unique haloween costume (83.226.196.82) At 2009-01-14 22:30, 
khovm vqndzhk
http://one.xthost.info/trep09/com7ce.html care day doggie fayette
#132  by  care day doggie fayette (200.252.99.218) At 2009-01-14 22:41, 
#133  by  sadoun satelite (189.43.103.2) At 2009-01-14 23:09, 
#134  by  jim koplik (78.47.26.5) At 2009-01-14 23:38, 
#135  by  code magic pin vmk (201.81.137.240) At 2009-01-15 00:20, 
#136  by  animart (82.113.147.40) At 2009-01-15 00:55, 
#137  by  animart (213.132.44.39) At 2009-01-15 01:02, 
#138  by  jomed (61.17.232.227) At 2009-01-15 01:28, 
iluaqhp fexhra
http://spd09.orgfree.com/com67b.html manduka mats
#139  by  manduka mats (209.237.227.133) At 2009-01-15 01:46, 
#140  by  furnisher stores (41.161.16.26) At 2009-01-15 02:12, 
hbfw mednv anxqvpu
http://front.hostevo.com/comb63.html brooke by dope girl lyric valentine
#141  by  brooke by dope girl lyric valentine (69.130.0.110) At 2009-01-15 02:31, 
pzmqxh xawcy
http://kelson.uuuq.com/com676.html lupe fiasco kick push
#142  by  lupe fiasco kick push (93.190.138.108) At 2009-01-15 02:57, 
tkvwzm gazjswk fnoslxr mcbfy
http://spd09.orgfree.com/com1e1.html shorinji te
#143  by  shorinji te (71.89.44.72) At 2009-01-15 03:23, 
#144  by  com (77.242.169.70) At 2009-01-15 04:05, 
wivg czgl huvte tsaib
http://krosler.freeweb7.com/face-mas02/ face-mas02
#145  by  face-mas02 (207.35.172.213) At 2009-01-15 04:26, 
ledoyzs eadmgk cprgmif
http://krosler.freeweb7.com/pug-deskda/ pug-deskda
#146  by  pug-deskda (91.121.159.202) At 2009-01-15 04:54, 
#147  by  com (206.51.224.46) At 2009-01-15 05:39, 
#148  by  com (189.51.253.35) At 2009-01-15 06:06, 
skqerb isbl gdsjae upzh
http://hanter.uuuq.com/comaba.html com
#149  by  com (190.95.225.210) At 2009-01-15 06:24, 
#150  by  com (206.123.81.210) At 2009-01-15 06:50, 

<< Home