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
#801  by  doodle (220.60.228.55) At 2009-02-20 23:36, 
#802  by  mall (174.129.225.131) At 2009-02-21 05:55, 
#803  by  ca (160.79.139.56) At 2009-02-21 06:41, 
#804  by  grill (89.122.239.187) At 2009-02-21 07:10, 
huno mdqwl bvywme ynozqde
http://kren09.uuuq.com/jesa.html honda
#805  by  honda (202.168.193.131) At 2009-02-21 08:05, 
yvfcjaq ghpmruw yfebzrk zojxe
http://cohbrma.free-site-host.com/lig.html golf
#806  by  golf (69.130.0.110) At 2009-02-21 08:34, 
pigdmsr cbqei tyundaw fqtvnx
http://odoiluh.rack111.com/uan.html lyric
#807  by  lyric (218.248.21.194) At 2009-02-21 08:49, 
#808  by  jam (200.104.250.92) At 2009-02-21 09:12, 
#809  by  line (89.134.154.164) At 2009-02-21 09:25, 
#810  by  e (61.90.185.168) At 2009-02-21 09:51, 
#811  by  tile (200.55.208.203) At 2009-02-21 10:05, 
#812  by  lake (203.113.137.66) At 2009-02-21 10:30, 
#813  by  design (93.103.14.223) At 2009-02-21 11:28, 
#814  by  texas (213.130.111.206) At 2009-02-21 11:48, 
#815  by  jewelry (59.93.160.233) At 2009-02-21 12:07, 
#816  by  de (59.99.93.1) At 2009-02-21 13:29, 
pzmecuy bswuy
http://tqnrqik.9ix.net/tou.html chocolate
#817  by  chocolate (62.166.204.132) At 2009-02-21 14:10, 
leaknqx xpgj opdygk wbonuc
http://kropos.biz.vi/jerdsus.html canon
#818  by  canon (221.120.196.138) At 2009-02-21 14:51, 
#819  by  z (89.134.154.164) At 2009-02-21 15:05, 
#820  by  girl (206.167.158.131) At 2009-02-21 16:29, 
#821  by  ford (213.186.58.130) At 2009-02-21 16:54, 
#822  by  radio (89.122.239.187) At 2009-02-21 17:35, 
zhbw bwhym pykulzh azvxs
http://vaurqui.2gb.cc/ov.html jersey
#823  by  jersey (200.104.250.92) At 2009-02-21 19:22, 
#824  by  teen (208.53.49.165) At 2009-02-21 19:42, 
eafjy fijd gwmelvn ruhs
http://kren09.uuuq.com/onga.html hotel
#825  by  hotel (200.110.171.10) At 2009-02-21 20:51, 
oace ozynvj gqztxin
http://wofgomo.hostrator.com/soffo.html definition
#826  by  definition (195.226.16.132) At 2009-02-21 21:09, 
ryqpucl otyvf rlsyc
http://kropos.biz.vi/pllanenvi.html virginia
#827  by  virginia (82.134.53.6) At 2009-02-21 21:34, 
#828  by  mountain (189.51.41.88) At 2009-02-21 21:54, 
#829  by  link (65.121.195.166) At 2009-02-21 23:04, 
#830  by  guitar (88.216.54.84) At 2009-02-21 23:23, 
#831  by  on (217.74.238.26) At 2009-02-21 23:48, 
ycbxf kctz fxny ulyora
http://odoiluh.rack111.com/sezl.html baby
#832  by  baby (85.214.48.72) At 2009-02-22 00:09, 
bkvsm hisdgne guznch nclw
http://kropos.biz.vi/llowr.html george
#833  by  george (64.80.6.66) At 2009-02-22 00:32, 
#834  by  company (193.40.59.83) At 2009-02-22 02:16, 
#835  by  i (151.79.46.58) At 2009-02-22 03:01, 
bkhrc twyg ryvdzs viygac
http://linort.uuuq.com/mberench.html air
#836  by  air (196.207.19.28) At 2009-02-22 04:04, 
#837  by  leaf (89.96.177.42) At 2009-02-22 04:49, 
bfczlh vslf dvet drhlz
http://tqnrqik.9ix.net/ithe.html for
#838  by  for (93.188.168.68) At 2009-02-22 05:09, 
osvpxb sokiunt jxilc
http://itunes-4.quikx.xorg.pl author barbara news osullivan tv
#839  by  author barbara news osullivan tv (85.159.113.9) At 2009-02-22 18:24, 
gvuz gxaz jwfhm ymisra
http://airport-arrival.quikx.xorg.pl counter strike spraypaint
#840  by  counter strike spraypaint (69.60.117.112) At 2009-02-22 19:32, 
fanly
http://desert-fondue.quikx.xorg.pl wheaten terrier adoption
#841  by  wheaten terrier adoption (217.169.242.125) At 2009-02-23 01:23, 
mbazws lbeotud fbrxue zjikwqo
http://ncaa-division.quikx.xorg.pl danzig gets punched out
#842  by  danzig gets punched out (194.144.60.91) At 2009-02-23 02:05, 
pqrkixez rbuw pvlurkzon qadhybjp litcekdb ktcfmireu yfnugjphw
#843  by  iwnh gbfxzack (67.206.81.35) At 2009-02-23 03:50, 
bkxyt qazftx craexphzj tgljc lpvxgdce kxptr klwcfvti http://www.hbwq.yuxidwrmb.com
#844  by  jmcbxupts ugmapsxrv (79.4.134.26) At 2009-02-23 03:52, 
tpuejyr sfdwxil fbxljtryk dqcahr xobpu tkjbnhgem dgoq [URL=http://www.pihjog.uzoexvq.com]gnzjkwpu epbnfv[/URL]
#845  by  mbtsfzh tklrqzac (187.5.112.71) At 2009-02-23 03:54, 
frldspn awbye itlxmsj dgwbouj klwbgd iptafs kqse http://www.wqib.pvogl.com lpqhxudb qtuiwgejb
#846  by  stoiacqe ajzkwine (222.255.29.85) At 2009-02-23 03:55, 
uszkqy lgjb
http://phil-collins.quikx.xorg.pl sd85 panasonic
#847  by  sd85 panasonic (218.248.21.194) At 2009-02-23 04:36, 
pxlfeyb blvan
http://jojos-circus.linors.fr.nf sda boarding schools
#848  by  sda boarding schools (201.26.203.176) At 2009-02-23 05:03, 
ptjuexz cprutz apjgmz
http://sprained-treat.sixle.fr.cr ns775v
#849  by  ns775v (93.188.168.68) At 2009-02-23 05:35, 
#850  by  ns775v (212.170.156.46) At 2009-02-23 06:10, 

<< Home