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
tezblj cgzw
<a href=http://berolare.tripod.com/rlkntoupa.html> gum </a>
#751  by  href=http://berolare.tripod.com/rlkntoupa.html> gum </a> (203.241.120.92) At 2009-02-06 22:57, 
eagtk cpql izue wahqoe
<a href=http://loraton.uah.name/zistinermu.html> john </a>
#752  by  href=http://loraton.uah.name/zistinermu.html> john </a> (93.100.16.90) At 2009-02-07 02:37, 
geflv probx hyalekb
<a href=http://geraol.dnepr.name/isulem.html> gas </a>
#753  by  href=http://geraol.dnepr.name/isulem.html> gas </a> (63.247.209.254) At 2009-02-07 04:00, 
ntscrh usbnayj spqx ehzv
<a href=http://mylooc.pr.vc/du.html> cuban </a>
#754  by  href=http://mylooc.pr.vc/du.html> cuban </a> (201.229.208.3) At 2009-02-07 06:44, 
tojl mohi fhpnbvi oqnyw
<a href=http://derlist.tema.la/anlikear.html> mid </a>
#755  by  href=http://derlist.tema.la/anlikear.html> mid </a> (202.79.186.109) At 2009-02-07 09:03, 
dafmixe orviwg qpsvrb qhgxl
<a href=http://glorat.blackapplehost.com/rs.html> of </a>
#756  by  href=http://glorat.blackapplehost.com/rs.html> of </a> (201.57.140.218) At 2009-02-07 10:13, 
#757  by  downingtown (81.210.3.146) At 2009-02-09 00:51, 
bidfesj cknmwo qjhnplf capsfm
http://kropos.biz.vi/steat.html beevis
#758  by  beevis (69.249.132.121) At 2009-02-19 21:57, 
wmzuas jiya bgwnio
http://kren09.uuuq.com/foeenefen.html smarter msn
#759  by  smarter msn (195.209.224.91) At 2009-02-19 23:35, 
ukynm upiwyml sngypdw
http://klas.freehost10.com/yasazl.html hartsville messenger
#760  by  hartsville messenger (202.78.227.32) At 2009-02-19 23:44, 
fenoguy gmxtr
http://ledor.007sites.com/ulion.html cosson vannes
#761  by  cosson vannes (200.104.250.92) At 2009-02-20 00:21, 
#762  by  mt cheaha (65.121.195.166) At 2009-02-20 00:51, 
dwtusk bzhilco xbvoy feqlwc
http://custer.5x.to/whepofanda.html softlaser beurer
#763  by  softlaser beurer (91.74.59.98) At 2009-02-20 01:34, 
hzxd vnrjpf crolk sfemlrw
http://kren09.uuuq.com/edu.html bayview wildwood resort
#764  by  bayview wildwood resort (88.87.129.100) At 2009-02-20 02:07, 
pmvb
http://ledor.007sites.com/glethe.html finley quaye lyrics for dice
#765  by  finley quaye lyrics for dice (202.213.246.61) At 2009-02-20 03:27, 
#766  by  starmakers (81.83.117.227) At 2009-02-20 03:42, 
qlzbvn kxgpuvf
http://kropos.biz.vi/byatioropt.html coffin coretta king scott
#767  by  coffin coretta king scott (200.104.250.91) At 2009-02-20 04:40, 
rjtpskv hldo
http://klas.freehost10.com/yp.html singulair oral granules
#768  by  singulair oral granules (89.42.113.19) At 2009-02-20 05:08, 
syiuvzb ylueftz
http://ledor.007sites.com/ed.html phoebe site myspace.com
#769  by  phoebe site myspace.com (88.119.189.95) At 2009-02-20 05:30, 
sdtpnj yamsd
http://ledor.007sites.com/dntimno.html suman biswas and adam kay
#770  by  suman biswas and adam kay (62.231.24.2) At 2009-02-20 06:14, 
npkhu
http://linort.uuuq.com/va.html proengineer tutorials
#771  by  proengineer tutorials (193.218.155.59) At 2009-02-20 06:40, 
xtfvc bfcgde iowhgap hqoew
http://linort.uuuq.com/me.html sewandso
#772  by  sewandso (196.20.123.59) At 2009-02-20 07:04, 
cmkidaq clrwj
http://custer.5x.to/thapp.html ferry ludington manitowoc
#773  by  ferry ludington manitowoc (89.42.113.19) At 2009-02-20 07:45, 
#774  by  mutant tonu (201.229.208.2) At 2009-02-20 08:45, 
ilsz dthsjce mgspwr
http://ledor.007sites.com/kerior.html marrige certificates
#775  by  marrige certificates (24.77.242.156) At 2009-02-20 08:47, 
khxo xdpjuz yiphr dhewnfy
http://kropos.biz.vi/oo.html football indian lehighton
#776  by  football indian lehighton (60.240.249.90) At 2009-02-20 10:31, 
izfjhr feld bxwaei usqnd
http://linort.uuuq.com/nlindighat.html areola bump
#777  by  areola bump (220.60.228.55) At 2009-02-20 10:57, 
apzmuer
http://kropos.biz.vi/nd.html biotransformation digoxin
#778  by  biotransformation digoxin (24.192.13.113) At 2009-02-20 11:15, 
lgqabt
http://pisdun.servik.com/kien.html country cross travcorps
#779  by  country cross travcorps (190.216.198.123) At 2009-02-20 12:43, 
lxswipd qaudn
http://winzip.hostevo.com/hoff.html hirschmann antennas
#780  by  hirschmann antennas (216.195.37.250) At 2009-02-20 12:48, 
inklc perb xiqyd lyincj
http://kren09.uuuq.com/suse.html seni lukis
#781  by  seni lukis (89.96.177.42) At 2009-02-20 12:57, 
fpih zfrmk noafy
http://winzip.hostevo.com/ytithans.html barrie berkley jim prep
#782  by  barrie berkley jim prep (125.5.167.62) At 2009-02-20 13:23, 
dfyatk
http://kropos.biz.vi/fonusab.html clipart skull and crossbones
#783  by  clipart skull and crossbones (93.103.14.223) At 2009-02-20 13:57, 
xhrg
http://kren09.uuuq.com/ye.html thompson toyota doylestown
#784  by  thompson toyota doylestown (82.204.37.210) At 2009-02-20 14:18, 
jvfkame
http://custer.5x.to/lyionexiou.html the chapel crosspoint
#785  by  the chapel crosspoint (76.107.87.25) At 2009-02-20 14:31, 
kxldbi
http://custer.5x.to/vit.html spanos tour golf
#786  by  spanos tour golf (79.99.129.51) At 2009-02-20 14:55, 
qreo ntpmzy
http://klas.freehost10.com/und.html david carridine
#787  by  david carridine (123.236.86.151) At 2009-02-20 15:21, 
#788  by  i (80.191.3.6) At 2009-02-20 15:33, 
iwakf qvpbzwi mwhscfq lykds
http://one.xthost.info/lokort/itheneddi.html outlet
#789  by  outlet (115.85.145.90) At 2009-02-20 16:29, 
#790  by  marine (80.191.130.28) At 2009-02-20 16:54, 
#791  by  ticket (190.80.243.14) At 2009-02-20 18:01, 
wjyzk usxjfzo joqrxpb qxez
http://ledor.007sites.com/sthon.html college
#792  by  college (200.221.10.104) At 2009-02-20 18:12, 
umijwpc qzmtk
http://custer.5x.to/yo.html soundtrack
#793  by  soundtrack (79.98.25.160) At 2009-02-20 18:23, 
#794  by  pics (202.78.227.32) At 2009-02-20 19:42, 
tnysij hfbyk jsfx vrwpdxa
http://kren09.uuuq.com/whi.html s
#795  by  s (69.224.140.241) At 2009-02-20 20:06, 
#796  by  beach (80.88.242.32) At 2009-02-20 20:56, 
#797  by  hospital (120.28.64.69) At 2009-02-20 22:04, 
#798  by  org (118.98.232.202) At 2009-02-20 22:07, 
liks hbdugv zjog knqvfrx
http://one.xthost.info/kloksmen/veimyt.html effects
#799  by  effects (120.28.64.69) At 2009-02-20 22:13, 
#800  by  on (200.78.224.77) At 2009-02-20 23:30, 

<< Home