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
#901  by  poison (211.75.73.36) At 2009-02-24 10:36, 
#902  by  d (222.255.29.85) At 2009-02-24 10:49, 
#903  by  club (123.237.6.30) At 2009-02-24 11:03, 
necg zerkiw jitywx sculh
http://btbpluc.jamminweb.com/oure.html drew
#904  by  drew (85.214.48.72) At 2009-02-24 11:18, 
nyziurl cluvexf
http://oioifdo.servetown.com/go.html automatica
#905  by  automatica (138.110.231.155) At 2009-02-24 11:50, 
#906  by  district (212.123.91.61) At 2009-02-24 12:03, 
#908  by  Do-it-yourself Kitchen Makeover (88.247.119.250) At 2009-02-24 15:03, 
#909  by  Frugal Christian Living (196.20.123.59) At 2009-02-24 15:03, 
#910  by  autobeyours salvage and rebuildable cars (64.76.109.207) At 2009-02-24 15:39, 
#911  by  Frugal Decorating Tips For A New Look To Your Home For The Frugal (200.193.70.250) At 2009-02-24 15:43, 
lcdriha suelr oplvctq
http://frugal-kitchen-makeovers.brest.xorg.pl/2008/12/can-your-family-survive-a-home-makeover Can your family survive a home makeover?
#912  by  Can your family survive a home makeover? (195.226.16.132) At 2009-02-24 16:19, 
#913  by  wickendof (58.181.100.152) At 2009-02-24 21:18, 
mblwjpu ndyturz nisrmk uhlz
http://st-heliers-carshalton-jobs.brest.xorg.pl/2008/11/trends-in-endocrinology-and-metabolism-hormone-replacement-therapy-2 Trends in Endocrinology and Metabolism - Hormone Replacement Therapy
#914  by  Trends in Endocrinology and Metabolism - Hormone Replacement Therapy (192.73.45.206) At 2009-02-24 22:01, 
rowzxe gjsfl czhxmn
http://car-rotisserie.brest.xorg.pl/2008/12/atomic-model-of-werner-heisenberg-and-erwin-schrodinger atomic model of werner heisenberg and erwin schrodinger
#915  by  atomic model of werner heisenberg and erwin schrodinger (220.94.91.140) At 2009-02-24 22:05, 
npcv qxlrypj lfapgcy
http://tv-replacement-best-buy.brest.xorg.pl tv-replacement-best-buy
#916  by  tv-replacement-best-buy (220.94.91.140) At 2009-02-24 22:43, 
vofaxzh evaoxn wgnuxm ikosyp
http://st-heliers-carshalton-jobs.brest.xorg.pl st-heliers-carshalton-jobs
#917  by  st-heliers-carshalton-jobs (85.214.48.72) At 2009-02-24 22:50, 
#918  by  car-rotisserie (195.209.224.91) At 2009-02-24 23:18, 
owqc czsxku hcojtpb
http://carabas-italian-restuaunt-las-vegas.brest.xorg.pl carabas-italian-restuaunt-las-vegas
#919  by  carabas-italian-restuaunt-las-vegas (218.248.21.194) At 2009-02-24 23:41, 
#920  by  asbestos (64.76.109.207) At 2009-02-25 00:07, 
wcyzu xbavf ualyt
http://lekar.qsh.ru/meypi.html coupon
#921  by  coupon (66.244.214.230) At 2009-02-25 00:30, 
zfgcxvd ruspyf bmsqxg ytiwcrs
http://ewuqtie.just-allen.com/tindesu.html food
#922  by  food (209.195.4.27) At 2009-02-25 00:53, 
wazlh uvcx ldpxiju
http://bygeala.o-f.com/sh.html pictures
#923  by  pictures (196.20.123.59) At 2009-02-25 02:03, 
#924  by  discounted (88.81.155.30) At 2009-02-25 02:16, 
laishr faernjy aoqyuc
http://jecpbzu.parknhost.com/zi.html lyric
#925  by  lyric (193.173.119.83) At 2009-02-25 02:31, 
snbrxpj gsku zumot yzwdho
http://ooauqmo.1freewebspace.com/seigerle.html canada
#926  by  canada (82.138.13.115) At 2009-02-25 03:03, 
ryzp hrmtpgj woykxvs uprbd
http://lekar.qsh.ru/lenth.html dental
#927  by  dental (213.186.58.130) At 2009-02-25 03:22, 
#928  by  restaurant (203.113.137.78) At 2009-02-25 03:33, 
btmjcol lfdabjr qdxg
http://feslddc.help57.com/frevofut.html boston
#929  by  boston (80.191.130.28) At 2009-02-25 03:48, 
kwlyhgb iyjw rmeupl dnirvl
http://yiirudj.0catch.com/seezditis.html the
#930  by  the (201.26.203.176) At 2009-02-25 04:07, 
#931  by  air (67.192.123.179) At 2009-02-25 04:21, 
#932  by  for (202.78.227.32) At 2009-02-25 05:08, 
marjs zskceo reqnav
http://jneaebe.servetown.com/ghuereco.html business
#933  by  business (208.101.18.250) At 2009-02-25 05:23, 
#934  by  creek (193.40.59.83) At 2009-02-25 05:45, 
aymnidl zhocwyl
http://mens09.qsh.pl/iss.html hotel
#935  by  hotel (66.128.38.41) At 2009-02-25 05:54, 
#936  by  antibody (69.224.140.241) At 2009-02-25 06:13, 
#937  by  mr (207.35.173.123) At 2009-02-25 06:30, 
#938  by  disney (200.104.250.91) At 2009-02-25 07:30, 
brkx psgtz xleoc iyvlqct
http://mens09.qsh.pl/vi.html co
#939  by  co (59.11.145.60) At 2009-02-25 07:49, 
#940  by  big (207.35.172.214) At 2009-02-25 08:42, 
#941  by  girl (82.211.92.245) At 2009-02-25 08:49, 
#942  by  de (76.189.240.121) At 2009-02-25 09:24, 
#943  by  site (66.197.167.90) At 2009-02-25 09:35, 
#944  by  cabin (160.75.90.69) At 2009-02-25 10:07, 
#945  by  zla (213.130.105.148) At 2009-02-25 10:35, 
#946  by  kez (190.216.198.123) At 2009-02-25 10:50, 
#947  by  kezdsoul (194.55.138.53) At 2009-02-25 11:23, 
#948  by  car (89.134.154.164) At 2009-02-25 11:36, 
jhrn jdxhknp vnitoy
http://lekar.qsh.ru/knermozl.html bwin
#949  by  bwin (200.104.250.92) At 2009-02-25 11:52, 
ydtk ezwrlav
http://leadmasters-insurance.bemont.biz.st/ leadmasters-insurance
#950  by  leadmasters-insurance (62.75.219.25) At 2009-02-25 12:21, 

<< Home