ลอง ping เครื่องตัวเองดูครับ
[root@host Maildir]# ping host.example.com
PING host.example.com (10.34.15.74) 56(84) bytes of data.
64 bytes from host.example.com (10.34.15.74): icmp_seq=1 ttl=64 time=0.035 ms
คือว่า Postfix รันอยู่ครับ
[root@host ~]# /etc/init.d/postfix status
master (pid 3862) is running...
ใช้ telnet ส่งเมล์ตามนี้ครับ
[root@host ~]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 host.example.com ESMTP Postfix
EHLO host.example.com
250-host.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
MAIL FROM: <root@host.example.com>
250 2.1.0 Ok
RCPT TO: <one@host.example.com>
250 2.1.5 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
Subject: test
test
.
250 2.0.0 Ok: queued as B3292110039
QUIT
221 2.0.0 Bye
Connection closed by foreign host.
ใช้ ls -l ดูได้ตามนี้ครับ
[root@host /]# cd home/one/
[root@host one]# ls -l
total 80
drwx------ 5 one one 4096 2008-02-13 16:47 Maildir
[root@host one]# cd Maildir/
[root@host Maildir]# ls -l
total 24
drwx------ 2 one one 4096 2008-02-13 16:47 cur
drwx------ 2 one one 4096 2008-02-13 16:47 new
drwx------ 2 one one 4096 2008-02-13 16:47 tmp
[root@host Maildir]#
ใช้ tail ดู log ได้ตามนี้ครับ
[root@host Maildir]# tail -n 14 /var/log/maillog
Feb 14 23:16:33 host postfix/smtpd[29714]: connect from localhost.localdomain[127.0.0.1]
Feb 14 23:17:11 host postfix/smtpd[29714]: B3292110039: client=localhost.localdomain[127.0.0.1]
Feb 14 23:17:21 host postfix/cleanup[29718]: B3292110039: message-id=<20080214161711.B3292110039@host.example.com>
Feb 14 23:17:21 host postfix/qmgr[3865]: B3292110039: from=<root@host.example.com>, size=381, nrcpt=1 (queue active)
Feb 14 23:17:21 host postfix/local[29719]: warning: maildir access problem for UID/GID=500/500: create maildir file /home/one/Maildir/tmp/1203005841.P29719.host.example.com: Permission denied
Feb 14 23:17:21 host postfix/local[29719]: warning: perhaps you need to create the maildirs in advance
Feb 14 23:17:21 host postfix/local[29719]: B3292110039: to=<one@host.example.com>, relay=local, delay=31, delays=31/0.01/0/0.01, dsn=5.2.0, status=bounced (maildir delivery failed: create maildir file /home/one/Maildir/tmp/1203005841.P29719.host.example.com: Permission denied)
Feb 14 23:17:21 host postfix/cleanup[29718]: 923C511003B: message-id=<20080214161721.923C511003B@host.example.com>
Feb 14 23:17:21 host postfix/bounce[29720]: B3292110039: sender non-delivery notification: 923C511003B
Feb 14 23:17:21 host postfix/qmgr[3865]: 923C511003B: from=<>, size=2338, nrcpt=1 (queue active)
Feb 14 23:17:21 host postfix/qmgr[3865]: B3292110039: removed
Feb 14 23:17:21 host postfix/local[29719]: 923C511003B: to=<root@host.example.com>, relay=local, delay=0.01, delays=0/0/0/0, dsn=2.0.0, status=sent (delivered to maildir)
Feb 14 23:17:21 host postfix/qmgr[3865]: 923C511003B: removed
Feb 14 23:17:23 host postfix/smtpd[29714]: disconnect from localhost.localdomain[127.0.0.1]
อันนี้เป็น postconf -n ครับ
[root@host Maildir]# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = host.example.com
myhostname = host.example.com
mynetworks_style = host
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.4.5/README_FILES
sample_directory = /usr/share/doc/postfix-2.4.5/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550
ปัญหาเกิดแถวๆนี้ครับ
Feb 14 23:17:21 host postfix/local[29719]: warning: maildir access problem for UID/GID=500/500: create maildir file /home/one/Maildir/tmp/1203005841.P29719.host.example.com: Permission denied
Feb 14 23:17:21 host postfix/local[29719]: warning: perhaps you need to create the maildirs in advance
ลองหลายตำราแล้วยังไม่รอดครับ
รบกวนพี่ๆด้วยครับ ถ้าหลุดตรงนี้ไปผมจะลง Mailman ต่อแล้วครับ
ขอบคุณมากครับ