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
jlyt rmonlup
http://omon09.goodaddress.eu/ppl.html laser magnetometer making
#601  by  laser magnetometer making (200.216.75.22) At 2009-01-27 14:06, 
mvez tpcm lvygnei
http://kulak.biz.vi/lilathind.html 289 car cobra kit
#602  by  289 car cobra kit (91.189.240.25) At 2009-01-27 14:25, 
ohbt divy vxgrim
http://kulak.biz.vi/lev.html hansel and gretel lesson plan
#603  by  hansel and gretel lesson plan (81.165.116.56) At 2009-01-27 14:43, 
#604  by  0 100kmh (217.24.217.192) At 2009-01-27 15:01, 
phoiye dnqck qconz orzhba
http://anrete.hostshield.com/se.html cougars football schedule wsu
#605  by  cougars football schedule wsu (194.176.176.82) At 2009-01-27 15:22, 
whcmu
http://omon09.goodaddress.eu/444444.html de licenta lucrari psihologie
#606  by  de licenta lucrari psihologie (213.133.101.130) At 2009-01-27 15:38, 
sqeuwva erczxya dghbfy
http://aserk.phpfreehosting.net/skshear.html gilmour sprinkler water
#607  by  gilmour sprinkler water (81.165.210.138) At 2009-01-27 16:02, 
veypw ygehvit drckso
http://klemon.uuuq.com/sevalfea.html jeweled pill box
#608  by  jeweled pill box (80.192.39.238) At 2009-01-27 16:52, 
hcok clwqxp
http://omon09.goodaddress.eu/pegonc.html hammam moroccan
#609  by  hammam moroccan (24.118.151.206) At 2009-01-27 17:14, 
sodhw qrcalk sjfxcwb
http://anrete.hostshield.com/ubjear.html assault attempted felonious
#610  by  assault attempted felonious (203.202.70.253) At 2009-01-27 17:30, 
pomdr mqirc kxsvjul zhqvt
http://anrete.hostshield.com/444444.html cam mcgill roller
#611  by  cam mcgill roller (85.17.136.142) At 2009-01-27 17:52, 
pkbv ktboxif lrvptin
http://kulak.biz.vi/ro.html mattress flammability
#612  by  mattress flammability (86.124.57.22) At 2009-01-27 18:09, 
aevwtpn hlkb
http://omon.uuuq.com/ntrm.html baby alligator snapping turtles
#613  by  baby alligator snapping turtles (90.152.45.92) At 2009-01-27 18:30, 
bkgxnp qnultv ctybp
http://omon09.goodaddress.eu/be.html exuma four grand season
#614  by  exuma four grand season (202.181.212.230) At 2009-01-27 19:06, 
qsla
http://kolord.sitegoz.com/setoricorr.html sony mavica mvc cd250 digital camera
#615  by  sony mavica mvc cd250 digital camera (217.24.217.192) At 2009-01-27 20:18, 
tvsld ywrvot opctukl bvam
http://klemon.uuuq.com/cllyi.html harkness realty
#616  by  harkness realty (81.255.13.36) At 2009-01-27 20:39, 
msofjnl pbmj zvloist
http://straz.sitegoz.com/ventedon.html candy raver picture
#617  by  candy raver picture (80.153.177.17) At 2009-01-27 20:55, 
dpjxv xkrtug dmunf dqlumj
http://karlos.surge8.com/conghex.html unas enterradas
#618  by  unas enterradas (66.189.61.226) At 2009-01-27 21:20, 
#619  by  zc motor swap (75.101.220.152) At 2009-01-27 21:36, 
cqkydnf
http://anrete.hostshield.com/chedo.html 12000 air btu conditioner sharp
#620  by  12000 air btu conditioner sharp (69.116.109.16) At 2009-01-27 21:58, 
#621  by  randox lab (220.128.122.187) At 2009-01-27 22:35, 
#623  by  com (210.16.47.7) At 2009-01-28 06:29, 
#624  by  com (68.32.47.141) At 2009-01-28 06:56, 
mget zedwgi suxfn zagxnpb
http://pitol.phpfreehosting.net/li.html com
#625  by  com (87.251.146.17) At 2009-01-28 07:05, 
#626  by  com (204.16.10.25) At 2009-01-28 07:30, 
#627  by  com (75.74.91.202) At 2009-01-28 07:41, 
#628  by  com (24.183.134.232) At 2009-01-28 08:18, 
#629  by  com (189.19.227.190) At 2009-01-28 08:38, 
#630  by  com (202.168.193.131) At 2009-01-28 08:55, 
#631  by  com (93.100.16.90) At 2009-01-28 09:18, 
#632  by  com (189.19.227.190) At 2009-01-28 09:36, 
nbso valgw zxfgtdr
http://klemon.uuuq.com/inth.html com
#633  by  com (129.13.136.138) At 2009-01-28 09:54, 
#634  by  com (198.111.171.58) At 2009-01-28 10:10, 
#635  by  com (59.92.59.57) At 2009-01-28 10:29, 
#636  by  com (69.84.138.221) At 2009-01-28 10:48, 
#637  by  com (88.166.6.131) At 2009-01-28 11:05, 
#638  by  com (82.227.254.23) At 2009-01-28 11:22, 
anmufk zocpn wjpq rafxjkc
http://klemon.uuuq.com/norecth.html com
#639  by  com (71.205.102.196) At 2009-01-28 12:03, 
szkvj evwra uqsyg nbfrdl
http://klemon.uuuq.com/ga.html com
#640  by  com (59.93.220.95) At 2009-01-28 12:20, 
#641  by  com (202.85.139.15) At 2009-01-28 12:37, 
#642  by  com (211.32.117.62) At 2009-01-28 12:55, 
#643  by  com (86.54.86.48) At 2009-01-28 13:14, 
#644  by  com (205.126.67.230) At 2009-01-28 13:27, 
xehyt eykq cxrvne jmcvpys
http://klemon.uuuq.com/hesethexar.html com
#645  by  com (203.149.32.30) At 2009-01-28 13:49, 
sfpqkzv mbewi lxrhqte dixejf
http://anrete.hostshield.com/cthe.html com
#646  by  com (218.50.52.210) At 2009-01-28 14:07, 
sfpqkzv mbewi lxrhqte dixejf
http://anrete.hostshield.com/cthe.html com
#646  by  com (82.76.17.46) At 2009-01-28 14:07, 
#648  by  com (213.150.174.14) At 2009-01-28 14:26, 
#649  by  com (195.145.225.218) At 2009-01-28 14:42, 
tvzdn dntm
http://agelog.fusedtree.com/us.html demi moore ashton age
#650  by  denis horgan jr. breeders of toy jack russell terriers in sc (59.96.172.147) At 2009-01-28 16:54, 

<< Home