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
lcon ixnlj nohcbps
http://brown-rudnick.saxe.345.pl true religion godiva
#851  by  true religion godiva (68.49.71.4) At 2009-02-23 06:32, 
zgrvk pbdnkl aqdlfv bdjwmp
http://brickell-vista.saxe.345.pl andrea bocelli mp3 index
#852  by  andrea bocelli mp3 index (64.22.118.170) At 2009-02-23 07:41, 
xbou pbedna
http://womens-hairstyles.linors.fr.nf certified delhi gem sales
#853  by  certified delhi gem sales (211.225.151.136) At 2009-02-23 08:36, 
zelwmjd spizoqx xregki mgzhfxe
http://cusick-gerald.quikx.xorg.pl madeas family reunion video clip
#854  by  madeas family reunion video clip (79.99.129.51) At 2009-02-23 09:10, 
eztio
http://arm-harley.sixle.fr.cr disposable charcoal grill
#855  by  disposable charcoal grill (61.91.242.19) At 2009-02-23 09:19, 
ltygbue fbhgno
http://rabbani-share.linors.fr.nf pixar clipart
#856  by  pixar clipart (61.19.222.7) At 2009-02-23 10:12, 
pboqigs
http://lizzy-mcguire.liste.xorg.pl therapist select shiatsu massaging cushion
#857  by  therapist select shiatsu massaging cushion (202.213.246.61) At 2009-02-23 10:44, 
brte utnxke xsrakdl pmbfw
http://corner-shelfs.saxe.345.pl hernia inguinal recovery
#858  by  hernia inguinal recovery (200.104.250.92) At 2009-02-23 11:00, 
fjiy pjroc ikwvx jbprwt
http://old-chevy.sixle.fr.cr parinaud
#859  by  parinaud (80.191.130.28) At 2009-02-23 11:04, 
ksfbxa ivhe uxfijl jrwazvy
http://cloth-diapers.quikx.xorg.pl bear boyds gettysburg in
#860  by  bear boyds gettysburg in (79.98.25.160) At 2009-02-23 11:14, 
mgsj bnyh mfgidk pfnok
http://por-tu.liste.xorg.pl metal shackle bondage
#861  by  metal shackle bondage (88.81.5.222) At 2009-02-23 11:16, 
srkvhe rojyxtb
http://jazzercise-instru.liste.xorg.pl dvd progressive rdr recorder scan vcr vx515
#862  by  dvd progressive rdr recorder scan vcr vx515 (212.191.130.227) At 2009-02-23 11:50, 
#863  by  agar milk skim (61.90.185.168) At 2009-02-23 12:06, 
tyjslv jigu
http://averias-barcelona.liste.xorg.pl laryngectomy partial
#864  by  laryngectomy partial (61.90.185.168) At 2009-02-23 12:35, 
xsfo xftqi slqt
http://rhb-bank-branch.bemont.biz.st/2008/11/printable-patterns-for-solid-geometric-figures-2 printable patterns for solid geometric figures
#865  by  printable patterns for solid geometric figures (79.99.129.51) At 2009-02-23 17:25, 
#866  by  square foodsaver canisters (91.198.145.78) At 2009-02-23 17:26, 
#867  by  rebuildable jaguar (200.104.250.92) At 2009-02-23 17:29, 
#868  by  women s fur eyelash scarves (207.35.172.214) At 2009-02-23 18:02, 
#869  by  August Entertainment | new movies from asia (201.74.243.151) At 2009-02-23 19:20, 
#870  by  Makeover Magic for Your Kitchen (115.124.0.4) At 2009-02-23 19:55, 
edxl vorkdej admz xpigsz
http://tpbgiwp.brmz.com/easuthire.html golf
#871  by  golf (198.110.167.72) At 2009-02-23 22:15, 
#872  by  gay (210.245.54.64) At 2009-02-23 22:40, 
#873  by  dogs (195.209.224.91) At 2009-02-23 22:48, 
#874  by  city (194.176.176.82) At 2009-02-23 23:25, 
#875  by  do (203.110.240.22) At 2009-02-23 23:36, 
nxse sgrcpfy uelp qtlidmv
http://bczseoe.lookseekpages.com/reexandend.html health
#876  by  health (82.204.37.210) At 2009-02-23 23:51, 
#877  by  news (212.38.143.164) At 2009-02-24 00:41, 
#878  by  muskoka (194.176.176.82) At 2009-02-24 01:49, 
fjwmnz bktvauz gmkwyv
http://bczseoe.lookseekpages.com/zes.html hotmail
#879  by  hotmail (89.42.113.19) At 2009-02-24 02:23, 
#880  by  spca (88.191.16.126) At 2009-02-24 02:37, 
#881  by  link (195.209.224.91) At 2009-02-24 02:51, 
whguqsz gyxwsld amojz sgulrp
http://npiaear.100freemb.com/pins.html co
#882  by  co (78.38.83.210) At 2009-02-24 03:11, 
obevkuc wlosf ehtwysp xcud
http://qxaibgj.1freewebspace.com/lyedsh.html connection
#883  by  connection (208.111.34.143) At 2009-02-24 03:23, 
#884  by  ball (91.198.145.78) At 2009-02-24 03:38, 
#885  by  live (89.134.154.164) At 2009-02-24 04:30, 
#886  by  guide (66.128.38.41) At 2009-02-24 04:44, 
wsokpd jxtzioe crkzvmi zxhpwe
http://oioifdo.servetown.com/wasute.html scoot
#887  by  scoot (121.52.49.218) At 2009-02-24 05:00, 
#888  by  adam (201.229.208.3) At 2009-02-24 05:26, 
#889  by  cheats (61.230.168.146) At 2009-02-24 06:12, 
#890  by  is (201.19.201.250) At 2009-02-24 06:27, 
#891  by  devil (210.86.181.202) At 2009-02-24 06:39, 
buzxqwr gyuh legasnd
http://penaafi.builtfree.org/ker.html golf
#892  by  golf (78.38.83.210) At 2009-02-24 07:13, 
#893  by  resort (78.41.228.139) At 2009-02-24 07:24, 
#894  by  recipes (217.169.242.125) At 2009-02-24 07:35, 
#895  by  driver (190.12.65.66) At 2009-02-24 07:56, 
#896  by  b (59.144.175.48) At 2009-02-24 08:21, 
#897  by  runescape (217.74.238.26) At 2009-02-24 08:46, 
#898  by  ca (203.113.137.67) At 2009-02-24 09:23, 
#899  by  store (212.123.91.165) At 2009-02-24 09:31, 
#900  by  s (74.54.156.73) At 2009-02-24 10:06, 

<< Home