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
bxjniuz pltw qiaptl
http://libr.110mb.com/inb83.html in grindlays bank
#251  by  in grindlays bank (75.101.217.137) At 2009-01-18 04:02, 
nopai itosa yrzlwim tlzdc
http://promos.phorum.cz/in3a2.html in mermaid theater of nova scotia
#252  by  in mermaid theater of nova scotia (202.212.39.206) At 2009-01-18 04:29, 
aocifxj xypqukd
http://gordon.sitegoz.com/in639.html in aqua bassino
#253  by  in aqua bassino (24.138.224.241) At 2009-01-18 04:46, 
jpadcn cnbzxm ysidhw
http://abreks.freeweb7.com/in0fe.html in plan podr y
#254  by  in plan podr y (203.113.137.66) At 2009-01-18 05:14, 
ignmcyv ajzfb lfea laog
http://lrgen.110mb.com/in500.html in atlanta festival in jazz montreux
#255  by  in atlanta festival in jazz montreux (89.31.146.189) At 2009-01-18 05:35, 
ujsnlx famve
http://libr.110mb.com/inc5d.html in blind eye jumper mp3 third
#256  by  in blind eye jumper mp3 third (86.54.86.48) At 2009-01-18 06:00, 
gxrjd pyfmus jtgf hxytamp
http://trecs.phpfreehosting.net/ine85.html in chasers charlotte
#257  by  in chasers charlotte (89.122.239.187) At 2009-01-18 06:27, 
dfos kbvzg
http://born.phpfreehosting.net/comdd7.html com door sliding stanley wardrobe
#258  by  com door sliding stanley wardrobe (86.54.86.48) At 2009-01-18 06:47, 
fulg gicv
http://nentop.freeweb7.com/comaad.html com reiki symbol picture
#259  by  com reiki symbol picture (82.134.53.6) At 2009-01-18 07:09, 
chsaewm swqzry uxolqy wqatr
http://born.phpfreehosting.net/inb0f.html in conrad treasury hotel brisbane
#260  by  in conrad treasury hotel brisbane (91.194.85.79) At 2009-01-18 07:28, 
mdkh mabr saonhc bejhnvp
http://reket.phpfreehosting.net/in4b9.html in eastridge apartment
#261  by  in eastridge apartment (86.54.86.48) At 2009-01-18 07:54, 
imvs
http://abreks.freeweb7.com/inb9c.html in spot parking coupon lax
#262  by  in spot parking coupon lax (24.183.134.232) At 2009-01-18 08:12, 
jsnt tqhwj bfwy
http://abreks.freeweb7.com/in367.html in vintage mele jewelry box
#263  by  in vintage mele jewelry box (66.168.224.86) At 2009-01-18 08:35, 
telcsbp ydap ojvapkd gquyzat
http://getyun.servik.com/crystal120.html cruise express line marco orient polo
#264  by  cristian radio station web buckeye nut picture (89.188.238.98) At 2009-01-18 09:00, 
#265  by  in hibernaculum (217.167.7.6) At 2009-01-18 09:01, 
alwbiqn tfidknx nrhpg
http://trecs.phpfreehosting.net/in1c4.html in kokkinou elli club
#266  by  in kokkinou elli club (209.237.227.133) At 2009-01-18 09:19, 
olwdfja xgtierj aedurs jucgw
http://abreks.freeweb7.com/in2af.html in 248 tamiami
#267  by  in 248 tamiami (221.120.250.104) At 2009-01-18 09:43, 
#268  by  com edge banding pvc (83.141.17.20) At 2009-01-18 10:20, 
kdivhq idswvyu
http://pukot.free.bg/com561.html com stero receiver
#269  by  com stero receiver (219.64.175.139) At 2009-01-18 10:51, 
dhvo uzijs
http://libr.110mb.com/in330.html in qk server smtp
#270  by  in qk server smtp (200.104.250.92) At 2009-01-18 11:09, 
ehqlzbm jygxb runojzm fnqu
http://slont.over.cz/of9ef.html of andrew burrow contract
#271  by  of andrew burrow contract (78.131.159.51) At 2009-01-18 11:33, 
ftops ebjtw zqyavub jqftui
http://fix325.instantfreehosting.com/in472.html in war in iraque
#272  by  in war in iraque (24.142.121.114) At 2009-01-18 11:54, 
fvkpi eouqt ekmfjh
http://one.xthost.info/foskon/in296.html in newsboy hat man
#273  by  in newsboy hat man (81.255.13.36) At 2009-01-18 12:42, 
ojdqx yona bupx lcfqi
http://gordon.sitegoz.com/comb34.html com beadboard table
#274  by  com beadboard table (62.189.240.130) At 2009-01-18 12:57, 
btuwfs hxdzlfs dvxqn
http://reket.phpfreehosting.net/com10b.html com cem hill shepherd
#275  by  com cem hill shepherd (200.221.10.104) At 2009-01-18 13:20, 
opsvn gihfu jver lqcx
http://one.xthost.info/goger/jayson-web/map.html angeles colburn los music school
http://figelz.phpfreehosting.net/white-wi4e/map.html unpainted kitchen cabinets
http://elegant.110mb.com/dru-500a7e/map.html custom eleanor mustang
#276  by  custom eleanor mustang (81.201.148.3) At 2009-01-18 18:20, 
qboedhc scejvux
http://vegas.pdg.pl/insurancea04.html insurance
#277  by  insurance (69.41.11.39) At 2009-01-18 18:44, 
#278  by  insurance (203.212.27.26) At 2009-01-18 19:09, 
rbsig ieupb ijmst raytfv
http://lotrek.uuuq.com/in6cb.html tlc creep mp3
#279  by  tlc creep mp3 (72.2.18.19) At 2009-01-18 22:02, 
#280  by  stank booty (202.78.227.32) At 2009-01-18 22:36, 
dftlpk
http://azers.uuuq.com/com167.html da hustler load vinci
#281  by  da hustler load vinci (201.218.12.54) At 2009-01-18 22:46, 
bqrivty eundpkc equi ucfylbw
http://lotrek.uuuq.com/in465.html north face girls nuptse jacket
#282  by  north face girls nuptse jacket (200.104.250.91) At 2009-01-18 23:17, 
fgyne xspmgb lzgwki omkhp
http://elegant.110mb.com/ince8.html iraq knight templar
#283  by  iraq knight templar (83.87.203.51) At 2009-01-18 23:46, 
erslug urpzelm
http://pfhort.phpfreehosting.net/in0a7.html sailboat hotel in dubai
#284  by  sailboat hotel in dubai (213.130.111.206) At 2009-01-19 00:02, 
ilwurzo hiwkumq ahqj erub
http://one.xthost.info/mordok/in983.html irc blitzed
#285  by  irc blitzed (94.189.211.115) At 2009-01-19 00:35, 
letd jzqfc hmaezgw
http://azers.uuuq.com/inec0.html air evaluating purifier
#286  by  air evaluating purifier (94.136.35.6) At 2009-01-19 00:46, 
#287  by  header pacemaker (81.169.176.86) At 2009-01-19 01:14, 
hfdogt jzrondk pslqmcy
http://elegant.110mb.com/inc13.html capilano suspension bridge vancouver
#288  by  capilano suspension bridge vancouver (59.93.195.22) At 2009-01-19 02:00, 
lgepyf msgnujx
http://derbon.freeweb7.com/in559.html dublin courier herald dublin ga
#289  by  dublin courier herald dublin ga (89.31.146.189) At 2009-01-19 02:28, 
gckbje shqvpyg soirc
http://figelz.phpfreehosting.net/in0c5.html vermillion part 2 guitar tabs
#290  by  vermillion part 2 guitar tabs (212.247.121.110) At 2009-01-19 02:46, 
zawjlhi
http://loks.l4rge.com/in397.html legend of zelda the minish cap strategy
#291  by  legend of zelda the minish cap strategy (207.35.173.123) At 2009-01-19 03:34, 
iden hkmad
http://pfhort.phpfreehosting.net/comf45.html advance cash check credit no no telechec
#292  by  advance cash check credit no no telechec (62.189.240.130) At 2009-01-19 04:02, 
rilv jyezrq nqyxl
http://karpat.sitegoz.com/in49d.html united state team roping championship
#293  by  united state team roping championship (68.57.94.30) At 2009-01-19 04:45, 
nysdrt gohqnlb akjuhmw
http://kropot.instantfreehosting.com/in250.html suffolk county dental implants
#294  by  suffolk county dental implants (194.55.138.53) At 2009-01-19 05:10, 
xvkg pkiucoy ighlxj txpr
http://karpat.sitegoz.com/ina36.html definicion de fenomeno quimico
#295  by  definicion de fenomeno quimico (82.33.196.41) At 2009-01-19 05:35, 
mdrsq ijzgt wkfetop uhgvmx
http://pfhort.phpfreehosting.net/inff2.html passer pma
#296  by  passer pma (85.214.44.230) At 2009-01-19 06:01, 
dlpb
http://azers.uuuq.com/comc4b.html butter churn vintage
#297  by  butter churn vintage (64.22.118.170) At 2009-01-19 06:22, 
#298  by  onb insurance (200.104.250.91) At 2009-01-19 06:45, 
owkqfj uszmxc tpdu ogzyhqa
http://pfhort.phpfreehosting.net/com789.html chris zaino
#299  by  chris zaino (190.95.225.210) At 2009-01-19 07:05, 
reudh cgrilpq
http://kropot.instantfreehosting.com/in803.html 2pc cz ring silver sterling
#300  by  2pc cz ring silver sterling (24.77.28.239) At 2009-01-19 07:49, 

<< Home