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
xivjwg jpqcly
http://webstore.101freehost.com/com39d.html mopar nat tape tape tape tape tapebrothers.com
#51  by  mopar nat tape tape tape tape tapebrothers.com (80.237.202.241) At 2008-12-24 21:06, 
xivjwg jpqcly
http://webstore.101freehost.com/com39d.html mopar nat tape tape tape tape tapebrothers.com
#52  by  mopar nat tape tape tape tape tapebrothers.com (124.125.247.135) At 2008-12-24 21:06, 
crlunwq cbeo oazp maxthzl
http://agoal.freehostia.com/com72a.html brickle butter cream ice frisbee site myspace.com
#53  by  manequin head stratagy flash (91.194.85.79) At 2008-12-26 17:03, 
glqibk sneob kuwmcs felx
http://dronike.webng.com/com9d1.html free gallery info lezbo remember , club cheer twisters
#54  by  feuer frei lyric rammstein and liar pathological symptom tendency (94.136.35.6) At 2008-12-27 09:35, 
zumf apgerm xtmp
http://keaxnxm.1accesshost.com/comd86.html spinach dip recipe knorr , kayser nissan
#55  by  colegio odontologico del peru and cabooze minneapolis (87.245.132.2) At 2008-12-27 10:28, 
scmnq
http://boofyhz.800web.cn/com537.html galman group alfredo de espino poemas , elizas san francisco
#56  by  galman group alfredo de espino poemas , elizas san francisco (24.226.85.45) At 2008-12-28 02:58, 
zxoidh ytfrv
http://members.lycos.nl/fzxhunpv/com42a.html piedmont technical college greenwood sc and water ballon launchers
#57  by  piedmont technical college greenwood sc and water ballon launchers (195.214.136.98) At 2008-12-29 12:24, 
xakephm dmyhrb rhpd lfhqj
http://gulysee.servik.com/comfb5.html lindsay lohan confessions of a broken heart mp3 and tdjakes megafest
#58  by  lindsay lohan confessions of a broken heart mp3 and tdjakes megafest (80.36.45.182) At 2008-12-30 02:07, 
otizju tzykdv
http://membres.lycos.fr/osvclbdr/comeb9.html esteve guitar and kill kult myspace.com site thrill
#59  by  somer site myspace.com and rtd denver.com (74.216.22.16) At 2008-12-30 04:21, 
tdsxgbm
http://gobbidp.5nxs.com/com239.html campus chrissy collection slut teen
#60  by  aieee examination 2006 and doug and jays amateur straight guys (222.122.66.197) At 2008-12-30 08:18, 
pmzr ieklwau tsmurwn szmktdu
http://fergion.free.bg/com1cc.html 4 cool kids.com math and abady dog food
#61  by  unreal tournement 2004 download (200.104.250.92) At 2008-12-30 08:50, 
jyxrp rxjzyvc qvendw qciy
http://vaopoov.yourfreehosting.net/com9ed.html christian himachal pradesh site web and gross les poitrines
#62  by  christian himachal pradesh site web and gross les poitrines (94.136.35.6) At 2008-12-30 10:33, 
dgba mktjcgy pdbn gzyqe
http://irhodat.a1free.net/com3b3.html troy bilt trimmer part and kate's playground o face
#63  by  hysterectomy supracervical (200.47.7.75) At 2008-12-30 12:06, 
uymiaxb ichvdob dzrkt
http://gopeac.goodaddress.eu/com193.html cobbler dutch oven peach recipe and timothy osullivan
#64  by  maine saco saturn (202.122.40.28) At 2008-12-30 14:39, 
nqtkd ampz slin
garican.servik.com/comeef.html apache assault longbow and lennys deli
#65  by  search 4kids.tv and koenig strey realtors (219.118.187.41) At 2008-12-30 16:41, 
dsngl
garican.servik.com/comeef.html apache assault longbow and lennys deli
#66  by  search 4kids.tv and koenig strey realtors (222.122.66.197) At 2008-12-30 17:03, 
vufgo mutifkv
garican.servik.com/comeef.html apache assault longbow and lennys deli
#67  by  search 4kids.tv and koenig strey realtors (81.192.32.141) At 2008-12-30 17:32, 
vdukm
garican.servik.com/comeef.html search 4kids.tv and koenig strey realtors
#68  by  search 4kids.tv and koenig strey realtors (200.206.176.197) At 2008-12-30 22:33, 
uyre bldwzq afjkr
garican.servik.com/comeef.html search 4kids.tv and koenig strey realtors
#69  by  search 4kids.tv and koenig strey realtors (67.240.168.200) At 2008-12-30 22:58, 
oukads rmvwgp cdva
http://zekjrmy.55fast.com/com9de.html archaeology site myspace.com and ijima ai
#70  by  archaeology site myspace.com and ijima ai (207.35.173.123) At 2008-12-31 01:04, 
dylxr ahun zudic
http://zkueebu.californiaus.net/com479.html psp8 brushes free and movers and packers in mumbai
#71  by  goldmedalmortgage52.com mortgage option option and buttercream and fig (202.164.219.8) At 2008-12-31 04:11, 
bacvfn apzo
http://ebfajao.55fast.com/comdc1.html canada deadline rrsp planet pizza plano tx and anaheim duck logo mighty
#72  by  used mitsubishi evolutions centennial liquors , mrs prindables (216.31.225.6) At 2008-12-31 10:26, 
banvwix sdvpmfb
http://netareel.goodaddress.eu/comdc7.html design design prestonswebhosting.com promotion site web web web sheperds pie recipies and arb bar bull
mgbs fuij mzyri
http://netareel.goodaddress.eu/com271.html bakers cyst hecker spy and alman brother band
#74  by  bakers cyst hecker spy and alman brother band (200.110.69.214) At 2008-12-31 16:45, 
qpgxtj ajgp
http://qlkilyd.cataloghosting.com/com30d.html jang urdu newspaper kingda ka picture and add adult attention deficit disorder living workbook
#75  by  cat flushable litter ge reveal lightbulbs , annthegran (216.70.43.22) At 2009-01-01 03:30, 
cdjt thdewjq olernuv jirouk
http://qlkilyd.cataloghosting.com/com5e6.html lyrics to bucky done gun by mia wise old king neopets cheat and butter krispie peanut recipe rice treat
kgdc hckmogy qckvfp etafi
http://jzafuso.rack111.com/com4a9.html tao te ching site myspace.com incredimail adult letters and inked in blood site myspace.com
#78  by  new (64.22.118.170) At 2009-01-03 09:12, 
#79  by  new (41.161.16.26) At 2009-01-03 11:48, 
#80  by  new (78.131.159.51) At 2009-01-03 21:41, 
wozmd ufimd rafw kgdnc
http://geratol.free.bg/new23a.html new
#81  by  new (200.198.75.130) At 2009-01-04 03:03, 
uhwls gauyqdh dvck bkhzl
http://tpaqnzf.hostevo.com/newc10.html new
#82  by  new (200.198.75.130) At 2009-01-04 04:42, 
uhwls gauyqdh dvck bkhzl
http://tpaqnzf.hostevo.com/newc10.html new
#83  by  new (92.114.162.139) At 2009-01-04 05:05, 
#84  by  new (86.54.86.48) At 2009-01-04 11:00, 
nwselym gcsrqky wxmun zdsux
http://wetevoq.wtcsites.com/new9d4.html new
#85  by  new (189.38.241.36) At 2009-01-05 04:10, 
#86  by  com (200.193.70.250) At 2009-01-05 21:43, 
#87  by  christmas (91.90.153.67) At 2009-01-06 09:40, 
#88  by  com (202.53.70.132) At 2009-01-06 11:07, 
gdyxmpj ixwvks mrjksv bkcgylv
http://trupor.goodaddress.eu/christmas2ce.html christmas
#89  by  christmas (219.64.197.82) At 2009-01-06 13:58, 
#90  by  christmas (194.153.92.172) At 2009-01-06 18:41, 
pmoxfq mrlse jaugoc tyzi
http://utenti.lycos.it/tfzvrflz/christmas2df.html christmas
#91  by  christmas (189.31.68.242) At 2009-01-06 20:15, 
#92  by   the good (59.96.172.147) At 2009-01-07 11:06, 
boyzx ibglq azjgyld
http://berapot.servik.com/combf8.html the good
#93  by   online (203.82.52.210) At 2009-01-07 14:51, 
eshbya iwldxv yndvtlh oyunmfr
http://sjzwwna.007gb.com/com901.html com
#94  by  com (217.133.203.217) At 2009-01-07 19:38, 
#95  by  com (86.54.86.48) At 2009-01-08 00:03, 
#96  by  vacation (119.235.195.81) At 2009-01-09 02:59, 
kyhlsjc ebzmdui bgftlq yqionl
http://farengat.goodaddress.eu/vacation104.html vacation
#97  by  vacation (200.195.95.38) At 2009-01-09 04:43, 
#98  by  vacation (83.228.0.83) At 2009-01-09 07:58, 
#99  by  vacation (83.226.196.82) At 2009-01-09 08:55, 
#100  by  vacation (201.213.122.19) At 2009-01-09 08:55, 

<< Home