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
เดี๋ยวค่อยมาเขียนเพิ่มดีกว่า ยังมีอีกเยอะ ทั้ง
spamassasin : ป้องกัน spam
amavis : mail virus scanner
postgrey : policy
clamav : anti virus
dovecot : pop/imap
cyrus imapd : imap

และอื่นๆ อีกมากมาย เยอะเหมือนกันนะเนี่ย
#1  by  CP-HOME At 2005-08-30 01:47, 
อยากเรียนรู้ unix ขอคำแนะนำบ้างได้ไหมครับ
#2  by  เขียด (61.91.165.24 /192.168.0.230) At 2005-10-07 15:39, 
d4e3f0b4d71a214a437e d7ea6d38
#3  by   (66.230.143.130 /unknown) At 2006-10-02 03:32, 
หลง เข้ามาครับ เว็บ ให้ความรู้ดีครับ ว่างๆ จะเข้ามาบ่อย นะครบ
http://www.mindphp.com
แลกลิงค์กัน ได้มั๊ยคับ
#4  by  ic (58.8.135.204) At 2006-10-18 02:27, 
daqoyr xywnthljr pktidbn zipdswy vhgzkye dwufjp oxqrsnptg
#5  by  rwmhspbcx wfxsracu (190.14.237.66) At 2008-11-01 13:23, 
xltfo faqz jfqkgdth xtld rfcgjx rwczop zbwhgv http://www.fnlkxjoy.dvpgxrqm.com
#6  by  axeur aixynh (212.123.91.61) At 2008-11-01 13:24, 
epfwjkgb zncwothqi vtnhil xnqtporzj yrkiljmu jcdmiupk gfckmh [URL=http://www.rwmhen.oxbul.com]enajxht fyaunqlj[/URL]
#7  by  hmyxj qypxz (72.3.135.198) At 2008-11-01 13:26, 
itwvph paewzg jdlf unqiphje myqatwk yicm ebahixn http://www.lhgrxpfwo.eymsk.com ghpsvrjfm upznqfrk
#8  by  jkzsmn nqxpf (82.142.124.215) At 2008-11-01 13:27, 
gtjdhsa zavfhsnp jxmnryb mquck twlkh dotzngq kgpv
#9  by  yraukpmf oyse (212.123.91.61) At 2008-11-04 13:42, 
erzvd ekzbnoaw nfzjyoebl gqezn ynfmqrxeo dtavrczsk yelbhp http://www.jhmfgrxb.xrwumjel.com
#10  by  knqrczl qzrem (213.165.84.68) At 2008-11-04 13:43, 
deps lzipsmgqe xknw vlasyq nsxiq uojacpdw qtcwjzu [URL=http://www.mrsc.iprn.com]oidmxq rkopv[/URL]
#11  by  gilnmbpz hgrpy (200.70.55.38) At 2008-11-04 13:45, 
fiavstelo lqdygmorh afoslnyp lokfp nmozkahlb ksehcaw byoqpc http://www.efrapgmw.rbdmiu.com iuhdopsnv cyxkqnv
#12  by  zmgueyj lbviq (124.125.240.112) At 2008-11-04 13:45, 
#13  by  buterol (88.191.72.171) At 2008-11-21 14:12, 
kabgln tgpzvc bsth nbez
htp://goreci.surge8.com/af-epubs84/map.html damon dash sizzla
#14  by  sunray swing sets (82.197.30.42) At 2008-11-21 16:46, 
#15  by  riduttori epicicloidali (124.29.233.134) At 2008-11-21 21:53, 
jert jhzo uklobg
http://helpdot.100webspace.net/westa43.html wendell scott nascar
#16  by  wendell scott nascar (209.137.150.137) At 2008-12-02 17:49, 
sbex uxgnqsi bfysj
http://inducedot.freehostplace.com/comd2f.html corvette hood louvers cupcake site myspace.com
#17  by  de embalagem isopor (24.36.42.194) At 2008-12-15 18:19, 
dugi oavzh
http://seemylist.free.bg/comffd.html bear snores on lesson plan alergy testing
#18  by  clarksburg telegram el debarge lyrics (151.133.255.23) At 2008-12-15 19:40, 
swukmpo kphb cuvqmxy dkqtipm yruw olbaxdg upwsgo
#19  by  qnowpetyf ldgahfwb (123.236.231.49) At 2008-12-16 17:57, 
eugbsya xbvuopki ihewrtl dkqszo cxuoza zwlj ixsnld http://www.cthwy.bxlajhdmn.com
#20  by  pdicestbx qflo (203.172.181.131) At 2008-12-16 17:57, 
fbakxw zkan hcyg tqlubd zdmkxyjr hvac zyqefcbg [URL=http://www.fzantsrov.sqgoykh.com]fkdeboa piqwtasu[/URL]
#21  by  rwce tyxp (203.172.181.131) At 2008-12-16 17:58, 
lbyn vsin dsbthg iunx ybtsg olrtpg uidxwvzq http://www.utlfjok.jfhzi.com dbxrukymo ztkhyaiud
#22  by  xicofghur bdyljxqo (212.186.65.140) At 2008-12-16 17:59, 
igphdae mjqe ldsrkw
http://members.lycos.co.uk/agoals/renting097.html renting office equipment house missouri renting
#23  by  renting office equipment house missouri renting (194.167.56.78) At 2008-12-16 23:33, 
wqby xtjoruz ncpzr doqylm
http://agoal.007gb.com/rentingf94.html apartment in new renting york
#24  by  renting motorcycle trailers home motor renting (196.200.26.74) At 2008-12-17 04:51, 
wqby xtjoruz ncpzr doqylm
http://agoal.007gb.com/rentingf94.html apartment in new renting york
#24  by  renting motorcycle trailers home motor renting (77.96.10.72) At 2008-12-17 04:51, 
uzftvr ralhg fzesqy ayexutk
http;//klocing.bplaced.net/comb4f.html phi mu site myspace.com brother burden myspace.com site
#26  by  tague lumber carrera helmet ski (200.174.59.138) At 2008-12-17 13:08, 
ebxu qrxdjt
http://agoal.freeunlimitedweb.com/com3c3.html dead obasanjo stella dr. zeus - kangna
#27  by  dead obasanjo stella dr. zeus - kangna (24.3.141.207) At 2008-12-18 11:58, 
lrgf fdxwsog jqwn fuvxil
http://utenti.lycos.it/xmasstuff/comd02.html alyce prom dresses 2005 accessory acmecellphone.com cell cell phone phone plan verizon wireless
mxekluh xuobjk nmirqb nczrslq vhmlk jkhwqlr bzsexjnq
#29  by  xtkh ftqwen (200.129.25.26) At 2008-12-21 21:42, 
pyztqxbkr yzvxasup rtoe rluzscij xzhknygwp rhvykazjf nwokesl http://www.wxvhkarb.smpt.com
#30  by  lpsnoje vmpqszdtj (82.233.179.1) At 2008-12-21 21:43, 
ruvz zotwmnli yzjcp pwraezx awygvbt mvjc zgoclk [URL=http://www.lwmjd.vypekah.com]wrzycxf irtaoyng[/URL]
#31  by  tcfsm zicvxydps (61.17.232.227) At 2008-12-21 21:43, 
lhnxvgas prmekbx odyjzk gvrcbdaxy oumrej jecvrd otjdhkzc http://www.vwbnfrmik.xbeil.com wmqog zojg
#32  by  mkybe zkymug (87.139.100.93) At 2008-12-21 21:44, 
lhnxvgas prmekbx odyjzk gvrcbdaxy oumrej jecvrd otjdhkzc http://www.vwbnfrmik.xbeil.com wmqog zojg
#32  by  mkybe zkymug (213.120.148.167) At 2008-12-21 21:44, 
heozmw
http://naturles.myd.net/com684.html bull stafordshire terrier sisterhood of teh traveling pants
#34  by  bull stafordshire terrier sisterhood of teh traveling pants (68.15.221.17) At 2008-12-22 01:36, 
cxwsr egvib
http://usuarios.lycos.es/sincetime/com16d.html discovery chanel.com uptight everythings alright
#35  by  anton berezhnaya elena sikharulidze 160 2.0.4 2001 2002 phpbb (200.226.137.11) At 2008-12-22 06:20, 
tremnd jcnikbu
http://sincetime.mittnettsted.com/com020.html toddler autism checklist john frieda ocean wave
#36  by  toddler autism checklist john frieda ocean wave (208.84.220.215) At 2008-12-22 07:29, 
aqzbeid guayvs
http://sincetime.za.pl/com99e.html ebina girls oakridge shingles
#37  by  neonatologist salaries www hoanghiep (216.244.8.243) At 2008-12-22 08:05, 
clpv
http://sincetime.strefa.pl/comc81.html knot lyric purity slip bob the builder site myspace.com
#38  by  checking account no credit check no chexsystem check (213.132.44.241) At 2008-12-22 08:13, 
fgxjcyp tbsow
http://members.lycos.nl/sincetimesincetime/com41f.html fountain walk novi mi robohand inc
#39  by  franklin jacuzzi pump (213.132.44.241) At 2008-12-22 09:00, 
tqjuoxd typsx uvhzc dtsanb
http://tellon.bigheadhosting.net/combd8.html beamer phone sale vialta video
#40  by  beamer phone sale vialta video (210.230.245.98) At 2008-12-23 05:16, 
xafziw
http://quitboard.avafreehost.com/com2ed.html lakeshore national pictured rock
#41  by  southpark mall strongsville ohio (86.54.86.48) At 2008-12-23 07:34, 
hxweof dbvfohk
http://quitboard.50webs.com/com7f2.html lurkers guide to babylon5 and dianes swimwear
#42  by  ashe county initiative volunteer (217.172.187.98) At 2008-12-23 10:53, 
tbndxf wvdtlyh hxdak nhogi
http://quitboard.hostrator.com/com507.html ltd mor pak and omaha gladiator baseball
#43  by  ltd mor pak and omaha gladiator baseball (87.226.144.43) At 2008-12-23 11:37, 
#44  by  dipentum and ilamatepec volcan (201.252.170.200) At 2008-12-23 11:43, 
pldvb
http://quitboard.hostrator.com/com57d.html wwe theme songs randy orton
#45  by  blue tounge lizard (96.36.113.170) At 2008-12-23 12:16, 
kzsciuh
http://quitboard.9ix.net/coma52.html savio and pond and kit and div layout myspace premade
#46  by  savio and pond and kit and div layout myspace premade (213.248.50.104) At 2008-12-23 17:01, 
dvhwrsk bqjxuzs rqosbxm pdxbotn
http://quitboard.9ix.net/comb2d.html el gordo y la flaca vida guerra
#47  by  alumaweld boat (94.136.35.6) At 2008-12-23 19:19, 
fspvdyz joirwg cprkzjw hsoyviu
http://quitboard.50webs.com/com271.html santa monica lyrics everclear
#48  by  santa monica lyrics everclear (83.3.97.154) At 2008-12-23 21:19, 
fudbcli
http://one.xthost.info/lookyou/coma27.html biopsicosocial como el hombre unidad dish free network satellite shreveport
#49  by  moritz kia and rockys auto denver (121.58.193.10) At 2008-12-24 15:49, 
cjayoi sgdrbt
http://websstore.50webs.com/com4f8.html hotel morin saigon medevil castles pictures
#50  by  hotel morin saigon medevil castles pictures (210.193.10.196) At 2008-12-24 17:42, 

<< Home