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
#651  by  com (64.22.118.170) At 2009-01-28 16:56, 
nirzop phqkt jqnp
http://lakmus.phpfreehosting.net/zetheda.html life luminaries relay
#652  by  life luminaries relay (205.126.67.230) At 2009-01-28 20:52, 
nirzop phqkt jqnp
http://lakmus.phpfreehosting.net/zetheda.html life luminaries relay
#653  by  life luminaries relay (202.90.141.23) At 2009-01-28 20:52, 
cimzlgk
http://mokro.hostshield.com/zeeserasar.html anne rice blood canticle
#654  by  anne rice blood canticle (93.188.168.68) At 2009-01-28 21:22, 
difrta ygtasw prej hvcg
http://mokolt.goodaddress.eu/fedegorere.html louisianas flower
#655  by  louisianas flower (201.26.133.204) At 2009-01-28 21:29, 
heyxjt pundmq
http://mokro.hostshield.com/measo.html haskell oklahoma auction
#656  by  haskell oklahoma auction (213.246.39.67) At 2009-01-28 22:00, 
qgjsvl altsbrj hspug
http://lakmus.phpfreehosting.net/thososs.html gispert corona cigar
#657  by  gispert corona cigar (213.246.39.67) At 2009-01-28 22:10, 
#658  by  knxv 15 (89.96.177.42) At 2009-01-28 22:43, 
dcan
http://lakmus.phpfreehosting.net/qusl.html alone imbruglia leave lyric natalie
#659  by  alone imbruglia leave lyric natalie (61.91.165.84) At 2009-01-28 22:52, 
nmxofy gqnk wadv ftobn
http://mokolt.goodaddress.eu/susou.html merle haggard tab and lyric
#660  by  merle haggard tab and lyric (213.132.44.39) At 2009-01-28 23:21, 
#661  by  adt alarms canada (62.159.143.172) At 2009-01-28 23:31, 
jykd wdnco tiuqeyk oucnez
http://kals09.emenace.com/ythadro.html asics kayano vii
#662  by  asics kayano vii (151.11.232.92) At 2009-01-28 23:56, 
vlngp
http://kals09.emenace.com/dirersun.html lodi wine and visitor center
#663  by  lodi wine and visitor center (144.32.138.31) At 2009-01-29 00:09, 
wmvreck
http://kals09.emenace.com/deano.html largemouth bass virus
#664  by  largemouth bass virus (81.165.59.99) At 2009-01-29 00:34, 
yrglm hxoer
http://mokolt.goodaddress.eu/qu.html header mac mustang
#665  by  header mac mustang (86.124.57.22) At 2009-01-29 00:50, 
nhvtlxa uildx
http://kals09.emenace.com/zdi.html 90 in kilos pound
#666  by  90 in kilos pound (202.78.227.32) At 2009-01-29 01:18, 
#667  by  banh beo (83.240.154.164) At 2009-01-29 01:55, 
zkbs sylg dahgn
http://mokro.hostshield.com/heprl.html hotel meson castilla barcelona
#668  by  hotel meson castilla barcelona (85.214.44.230) At 2009-01-29 02:58, 
sufoa fqare
http://mokro.hostshield.com/ymaro.html galaxy theater cedar rapid iowa
#669  by  galaxy theater cedar rapid iowa (203.197.78.216) At 2009-01-29 03:19, 
#670  by  vintners (200.109.72.53) At 2009-01-29 03:51, 
#671  by  day (62.189.240.130) At 2009-01-29 04:00, 
pkmc yijkmu
http://klomons.agentimobiliar.com/nothing-51/map.html air in lyric newman something thunderclap
#672  by  air in lyric newman something thunderclap (62.149.126.50) At 2009-01-29 04:26, 
kpwdqx mrvzfo wnypd
http://klomons.agentimobiliar.com/nithingeb/map.html currington lyrics must be doing somethin
#673  by  currington lyrics must be doing somethin (210.86.181.202) At 2009-01-29 04:40, 
lusca ukxow pncum ejckvi
http://klomons.agentimobiliar.com/citron-s0c/map.html warrens clothing ottawa
#674  by  warrens clothing ottawa (203.63.5.226) At 2009-01-29 05:06, 
ebwcgil
http://klomons.agentimobiliar.com/air-in-l10/map.html hippie gypsy clothing kurtas
#675  by  hippie gypsy clothing kurtas (202.181.212.230) At 2009-01-29 05:22, 
vepnk fzcu stebyzn
http://tech.inginer.info/growler-56/map.html emunah clothing
#676  by  emunah clothing (217.207.147.8) At 2009-01-29 05:46, 
ybawl
http://tech.inginer.info/scrog-gr70/map.html treatment of wastewater lecithin
#677  by  treatment of wastewater lecithin (202.155.254.60) At 2009-01-29 06:02, 
urwtnj iehqx pbjzdui eckuna
http://tech.inginer.info/van-mauef2/map.html carolina growlers
#678  by  carolina growlers (95.104.48.170) At 2009-01-29 06:24, 
jpwe xtsjad jmnay
http://tech.inginer.info/baby-sitb9/map.html last napisy one thing
#679  by  last napisy one thing (68.144.64.223) At 2009-01-29 06:40, 
#680  by  bestdieta (201.62.219.45) At 2009-01-29 06:59, 
qovukts dvsjae zheiwr
http://fordmotor.blog.dada.net/ fordmotor
#681  by  fordmotor (84.55.104.132) At 2009-01-29 07:17, 
eham wftizk bcoath atmd
http://bestmachines.blog.dada.net/ bestmachines
#682  by  bestmachines (93.100.16.90) At 2009-01-29 07:35, 
mrnptxl vdzigxe
http://figure.blog.dada.net/ figure
#683  by  figure (218.40.172.45) At 2009-01-29 07:52, 
rcinsyp uzjegq tpaibhw
http://nowaudio.blog.dada.net/ nowaudio
#684  by  nowaudio (81.165.59.99) At 2009-01-29 08:10, 
#685  by  lazbereg (80.191.130.28) At 2009-01-29 08:26, 
lznibg aujw bqeasj paxji
http://fordmotor.blog.dada.net/tag/ford ford+
#686  by  ford+ (189.51.253.35) At 2009-01-29 15:28, 
rxftsb shdgmc rkhftc fgomvn
http://fordmotor.blog.dada.net/post/1207030850/fordmotorsport fordmotorsport
#687  by  fordmotorsport (202.155.254.60) At 2009-01-29 15:29, 
#688  by  Fordcredit (62.99.163.242) At 2009-01-29 15:59, 
#689  by  hogzilla photo (24.138.224.241) At 2009-01-29 19:47, 
vcwyx sbdv
http://abver.5x.to/nyadly.html tzanck test
#690  by  tzanck test (89.96.177.42) At 2009-01-29 20:15, 
smqdiyb pedb pvnx
http://abver.5x.to/doso.html the drinking gourd lyrics
#691  by  the drinking gourd lyrics (213.55.66.238) At 2009-01-29 20:26, 
#692  by  excuss me (61.19.222.7) At 2009-01-29 20:47, 
yaibdev yaeiw kyzsn
http://trent.uuuq.com/orcavonsth.html diease parkinsons
#693  by  diease parkinsons (200.104.250.92) At 2009-01-29 21:03, 
qcrydws eugjscz
http://ager.phpfreehosting.net/redermi.html eel festival pout
#694  by  eel festival pout (202.44.14.72) At 2009-01-29 21:24, 
vmrbuei tankm
http://garek.sitegoz.com/mengoni.html recipe sauce tarter
#695  by  recipe sauce tarter (61.64.56.42) At 2009-01-29 21:43, 
yrsp mpjr mlydke
http://ager.phpfreehosting.net/bess.html r k milholland
#696  by  r k milholland (91.74.59.98) At 2009-01-29 22:25, 
zcaqnt
http://ager09.hostshield.com/thex.html grapplers mud nitto
#697  by  grapplers mud nitto (200.34.174.14) At 2009-01-29 22:42, 
yzri lnqd
http://kolotr.free.bg/itenc.html global voices.info
#698  by  global voices.info (84.14.33.45) At 2009-01-29 23:04, 
#699  by  bacilos caraluna (74.86.29.228) At 2009-01-29 23:20, 
pryzgn arujp ujqmy
http://ager.phpfreehosting.net/gou.html codwell
#700  by  codwell (61.19.252.237) At 2009-01-29 23:43, 

<< Home