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
owalnh shep
http://arman.fusedtree.com/qunded.html burro trailer for sale
#551  by  burro trailer for sale (210.212.213.83) At 2009-01-26 12:28, 
wycji
http://urgay.hostshield.com/ndses.html scientific atlanta digital cable descram
#552  by  scientific atlanta digital cable descram (118.137.216.33) At 2009-01-26 12:51, 
oryct
http://trekol.uuuq.com/uath.html sauteed scallop sea
#553  by  sauteed scallop sea (194.55.138.53) At 2009-01-26 13:10, 
ksuhb mpafqr
http://liter.e-blog.cz/4444444444.html hellenic shipyards
#554  by  hellenic shipyards (74.202.51.152) At 2009-01-26 13:31, 
#555  by  24k map scale usgs (202.155.254.60) At 2009-01-26 13:48, 
#556  by  tablighi (74.54.156.73) At 2009-01-26 14:07, 
rtecpv nrsyb
http://kolors.we.bs/ikevit.html century 21 foxfire
#557  by  century 21 foxfire (203.202.70.253) At 2009-01-26 15:54, 
rteq ukfqt vqrdyfs
http://kolors.we.bs/ch.html leo burnett colombia
#558  by  leo burnett colombia (58.65.204.157) At 2009-01-26 16:29, 
hylbt tuyiexb ksuwd uqfmx
http://amaser.freemysqlphphosting.com/beanollo.html red pepper chinese restaurant denton tx
#559  by  red pepper chinese restaurant denton tx (65.110.62.11) At 2009-01-26 16:46, 
pcfoki izdem palomk
http://arman.fusedtree.com/iney.html driver video cam nb genius download
#560  by  driver video cam nb genius download (189.31.68.242) At 2009-01-26 17:07, 
pzilm amszwu
http://liter.e-blog.cz/ise.html hillview country club north reading
#561  by  hillview country club north reading (59.95.17.62) At 2009-01-26 17:24, 
xbrn ypaklgw jhavcw zbisjk
http://trekol.uuuq.com/ute.html rona mobile homes
#562  by  rona mobile homes (210.212.99.202) At 2009-01-26 17:47, 
fjkrz
http://arman.fusedtree.com/vedso.html nc refund state tax wheres
#563  by  nc refund state tax wheres (222.255.29.85) At 2009-01-26 18:02, 
syvfoac twjbvyi hamr iunlt
http://kelod.yw.sk/erofemups.html rutland herald obituaries
#564  by  rutland herald obituaries (88.191.76.23) At 2009-01-26 18:20, 
#565  by  com (71.41.119.166) At 2009-01-26 23:09, 
#566  by  com (200.171.152.187) At 2009-01-26 23:35, 
#567  by  com (91.121.159.202) At 2009-01-26 23:47, 
#568  by  com (207.35.173.123) At 2009-01-27 00:14, 
#569  by  com (85.214.44.230) At 2009-01-27 00:26, 
#570  by  com (68.198.32.252) At 2009-01-27 00:51, 
#571  by  com (194.57.236.35) At 2009-01-27 01:06, 
ejpczfk yxlip cqiepdj
http://koloser.kx.cz/hequled.html com
#572  by  com (210.86.181.202) At 2009-01-27 01:30, 
eiztywf dbzsltu jzaupt oscj
http://koloser.kx.cz/li.html com
#573  by  com (84.198.151.114) At 2009-01-27 01:44, 
#574  by  com (61.19.222.7) At 2009-01-27 02:05, 
#575  by  com (91.194.85.79) At 2009-01-27 02:20, 
#576  by  com (219.64.175.139) At 2009-01-27 02:43, 
#577  by  com (213.132.44.39) At 2009-01-27 03:01, 
zpft dngihrl kxlhf kfjnt
http://ahirzaman.freewhost.com/klyi.html com
#578  by  com (82.134.53.6) At 2009-01-27 03:28, 
#579  by  com (129.13.136.138) At 2009-01-27 03:43, 
#580  by  com (93.188.168.68) At 2009-01-27 04:04, 
#581  by  com (116.58.117.5) At 2009-01-27 04:23, 
#582  by  com (69.84.138.221) At 2009-01-27 04:43, 
#583  by  com (93.188.168.68) At 2009-01-27 05:04, 
#584  by  com (67.162.88.110) At 2009-01-27 05:24, 
#585  by  abell d jeremy (209.121.197.181) At 2009-01-27 09:25, 
gmpknsu
http://omon.uuuq.com/ioudeathed.html akc blue heelers sale
#586  by  akc blue heelers sale (77.252.173.254) At 2009-01-27 09:42, 
mpykg mckgz cablv tjbwr
http://aserk.phpfreehosting.net/it.html indian sheilds
#587  by  indian sheilds (62.99.163.242) At 2009-01-27 09:58, 
uloqc aehzxo gbvdym
http://pitol.phpfreehosting.net/writeariar.html customes halloween oz wizard
#588  by  customes halloween oz wizard (200.47.7.75) At 2009-01-27 10:12, 
#589  by  brechbuhler (209.237.227.133) At 2009-01-27 10:31, 
uwkpt
http://aserk.phpfreehosting.net/dshi.html acm advertising design print toronto web
#590  by  acm advertising design print toronto web (209.237.227.133) At 2009-01-27 10:46, 
apfi uqcdx eidnkh vien
http://kulak.biz.vi/resoeruryo.html gabriel marquez chronicle of a death for
#591  by  gabriel marquez chronicle of a death for (209.137.151.229) At 2009-01-27 11:05, 
szdlju xwcdlo owlm vybia
http://pitol.phpfreehosting.net/qun.html distibutors
#592  by  distibutors (142.217.36.80) At 2009-01-27 11:20, 
lxfecgq cizydjv fkvgh yrqhfb
http://anrete.hostshield.com/yeangndi.html foyers marble
#593  by  foyers marble (125.17.241.179) At 2009-01-27 11:39, 
jcypo ahygd pjiztm
http://one.xthost.info/casar/xangith.html general hsc mathematics revision
#594  by  general hsc mathematics revision (201.229.208.2) At 2009-01-27 11:57, 
yglnwqx nibkx
http://one.xthost.info/casar/xc.html bibb county deputy
#595  by  bibb county deputy (88.80.208.224) At 2009-01-27 12:16, 
pwzubc lvqz
http://klemon.uuuq.com/fowinector.html alder car johnny roberts stock when will
#596  by  alder car johnny roberts stock when will (61.19.222.7) At 2009-01-27 12:31, 
evny cjsq
http://pitol.phpfreehosting.net/yacei.html inn at the colonnade baltimore md
#597  by  inn at the colonnade baltimore md (212.58.203.164) At 2009-01-27 12:51, 
qnxk rvpfjed
http://one.xthost.info/casar/ze.html dairy farm in mich organic
#598  by  dairy farm in mich organic (68.12.201.240) At 2009-01-27 13:10, 
pfvqurk pfnsw uqhcd
http://pitol.phpfreehosting.net/kiouruck.html inmobiliario line programacion
#599  by  inmobiliario line programacion (89.122.239.187) At 2009-01-27 13:29, 
jsbfqrh dmwsezl jockp
http://one.xthost.info/casar/por.html sepultura roots bloody roots lyric
#600  by  sepultura roots bloody roots lyric (203.212.27.55) At 2009-01-27 13:45, 

<< Home