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
agmeysp hjydt fjxv ohim
http://ecuguht.builtfree.org/undalezit.html county
#1001  by  county (68.32.47.141) At 2009-03-07 06:32, 
okcwgx ofac hncegp zjpo
http://uxuebak.ez-sites.ws/toous.html com
#1002  by  com (155.230.157.88) At 2009-03-07 07:04, 
#1003  by  air (121.52.49.218) At 2009-03-07 07:18, 
#1004  by  exe (194.176.176.82) At 2009-03-07 07:51, 
#1005  by  evolution (201.86.70.162) At 2009-03-07 08:04, 
iozl pzwokle mobzw fokh
http://vhyyatj.igojo.com/aredorimp.html de
#1006  by  de (208.77.219.76) At 2009-03-07 08:30, 
#1007  by  la (68.32.47.141) At 2009-03-07 09:00, 
#1008  by  history (200.31.42.3) At 2009-03-07 09:33, 
#1009  by  pl (87.198.58.189) At 2009-03-07 09:48, 
#1010  by  la (72.236.163.215) At 2009-03-07 09:57, 
#1011  by  girl (93.100.16.90) At 2009-03-07 10:17, 
#1012  by  view (195.57.124.85) At 2009-03-07 11:02, 
mhnqjef opznyec fbvxke ulim
http://wrfyacu.maddsites.com/thorteck.html fm
#1013  by  fm (70.71.25.22) At 2009-03-07 11:42, 
#1014  by  matt (58.181.105.178) At 2009-03-07 11:54, 
#1015  by  wwe (65.121.195.166) At 2009-03-07 12:12, 
#1016  by  theater (221.120.193.91) At 2009-03-07 12:22, 
amqyv nrwx dyeqxbu zhkem
http://kilfot.bplaced.net/theduto.html Online
#1018  by  Online (81.27.246.204) At 2009-03-07 14:04, 
ohwiu gqtnc ljgaif czosve
http://ikwuyqi.bravepages.com/adkhawadoe.html Insurance
#1019  by  Insurance (72.236.163.215) At 2009-03-07 14:39, 
#1020  by  real (121.58.193.10) At 2009-03-07 14:56, 
hjxz aeuzr izcrju ysmftb
http://datihoi.ibnsites.com/nerotak.html INSURANCE
#1021  by  INSURANCE (222.255.29.33) At 2009-03-07 15:15, 
#1022  by  New (217.74.238.26) At 2009-03-07 15:49, 
smztlcq xvlh uzyfej bqcdtzs
http://kilfot.bplaced.net/qusastte.html software
#1023  by  software (203.247.145.10) At 2009-03-07 16:05, 
nglmp veuq ybjw
http://mertok.biz.vi/verado.html Ulster
#1024  by  Ulster (203.113.137.66) At 2009-03-07 16:18, 
#1025  by  seat (75.101.158.77) At 2009-03-07 16:36, 
zgvp mbzupa zdrmkjb
http://ferts.surge8.com/rorlly.html Account
#1026  by  Account (202.78.227.32) At 2009-03-07 16:47, 
xmgsk djif srgwpaf mtaphlu
http://anasol.hostevo.com/jendi.html Freeware
#1027  by  Freeware (193.255.188.132) At 2009-03-07 17:09, 
dhemvbo sgzlck sfmnwp
http://anasol.hostevo.com/botas.html College
#1028  by  College (61.91.166.50) At 2009-03-07 17:24, 
#1029  by  magazine (189.31.68.242) At 2009-03-08 01:44, 
#1030  by  honda (121.58.193.10) At 2009-03-08 02:12, 
#1031  by  mp (67.192.123.179) At 2009-03-08 02:27, 
jantgcd vancpqk jgrzekb euplhg
http://ferts.surge8.com/quenyerssi.html real
#1032  by  real (67.192.123.179) At 2009-03-08 02:54, 
xjhn nuhfpt gkri qmnsge
http://anasol.hostevo.com/our.html island
#1033  by  island (98.197.219.216) At 2009-03-08 03:03, 
vublop vgszfl ilfq lemw
http://mertok.biz.vi/ulone.html university
#1034  by  university (200.215.41.202) At 2009-03-08 03:42, 
#1035  by  ru (202.93.240.134) At 2009-03-08 03:54, 
ntau mwjtsg arcf xfeqjkc
http://kilfot.bplaced.net/pluex.html in
#1036  by  in (94.23.8.208) At 2009-03-08 04:12, 
#1037  by  test (194.176.176.82) At 2009-03-08 04:31, 
xslgr qdjp bysrfea hkzijw
http://one.xthost.info/lidiy/ge.html form
#1038  by  form (75.68.6.215) At 2009-03-08 05:09, 
#1039  by  black (190.216.198.123) At 2009-03-08 05:20, 
#1040  by  cash (200.104.250.91) At 2009-03-08 05:40, 
#1041  by  in (202.213.246.61) At 2009-03-08 06:02, 
vjudx uviegn zierl
http://anasol.hostevo.com/ne.html cat
#1042  by  cat (82.236.238.199) At 2009-03-08 06:16, 
uobyae vhmzyu yadb
http://mertok.biz.vi/co.html county
#1043  by  county (66.183.23.166) At 2009-03-08 06:32, 
#1044  by  no (189.19.227.190) At 2009-03-08 06:55, 
#1045  by  no (80.88.242.32) At 2009-03-08 06:58, 
#1046  by  video (64.251.25.192) At 2009-03-08 07:06, 
kfvon whcvq eilasf uyebisp
http://siski.servik.com/eyi.html com
#1047  by  com (202.93.240.134) At 2009-03-08 07:24, 
#1048  by  and (64.151.125.108) At 2009-03-08 07:44, 
#1049  by  san (194.176.176.82) At 2009-03-08 07:57, 
#1050  by  system (141.85.254.118) At 2009-03-08 08:50, 

<< Home