banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Forum Index Thảo luận hệ điều hành *nix mail server  XML
  [Question]   mail server 06/07/2011 15:51:16 (+0700) | #1 | 242907
docong1010
Member

[Minus]    0    [Plus]
Joined: 28/12/2004 14:11:13
Messages: 72
Offline
[Profile] [PM]
Hi All
Mình có setup mail Postfix+dovecot+mysql+postfixadmin
Đây là file config của mình

main.cf
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:/home/vmail/%u/
html_directory = no
inet_interfaces = all
local_recipient_maps = $virtual_mailbox_maps
mail_owner = postfix
mail_spool_directory = /var/spool/mail
mailbox_transport = dovecot
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, $mydomain, localhost.$mydomain, localhost
mydomain = xxx.com.vn
myhostname = mail2.xxx.com.vn
mynetworks = 10.0.0.0/8, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = no
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/etc/postfix/mysql-aliases.cf
virtual_gid_maps = static:501
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-users.cf
virtual_transport = virtual
virtual_uid_maps = static:501

mysql-users.cf
hosts = 127.0.0.1
user = postfix
password = postfix
dbname = postfix
query = SELECT maildir FROM mailbox WHERE username='%s' AND active = 1

mysql-domains.cf
user = postfix
password = postfix
hosts = 127.0.0.1
dbname = postfix
query = SELECT domain FROM domain WHERE domain='%s'

mysql-aliases.cf
hosts = 127.0.0.1
user = postfix
password = postfix
dbname = postfix
query = SELECT goto FROM alias WHERE address='%s' AND active = 1

Postfix của mình gởi không được nó báo lổi "Temporary lookup failure"

Đây là mail log của mình
postfix/pickup[8026]: 240D69651B: uid=0 from=<root>
Jul 5 14:35:14 mail2 postfix/cleanup[8390]: 240D69651B: message-id=<20110705073514.240D69651B@mail2.xxx.com.vn>
Jul 5 14:35:14 mail2 postfix/cleanup[8390]: warning: connect to mysql server localhost: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)
Jul 5 14:35:14 mail2 postfix/cleanup[8390]: warning: 240D69651B: virtual_alias_maps map lookup problem for root@xxx.com.vn
Jul 5 14:35:14 mail2 postfix/pickup[8026]: warning: 252869651B: message has been queued for 1 days
Jul 5 14:35:14 mail2 postfix/pickup[8026]: 252869651B: uid=0 from=<root>
Jul 5 14:35:14 mail2 postfix/cleanup[8390]: 252869651B: message-id=<20110705073514.252869651B@mail2.xxx.com.vn>
Jul 5 14:35:14 mail2 postfix/cleanup[8390]: warning: 252869651B: virtual_alias_maps map lookup problem for root@xxx.com.vn
Jul 5 14:35:14 mail2 postfix/pickup[8026]: warning: 2606D9651B: message has been queued for 4 days
Jul 5 14:35:14 mail2 postfix/pickup[8026]: 2606D9651B: uid=0 from=<root>
Jul 5 14:35:14 mail2 postfix/cleanup[8390]: 2606D9651B: message-id=<20110705073514.2606D9651B@mail2.xxx.com.vn>
Jul 5 14:35:14 mail2 postfix/cleanup[8390]: warning: 2606D9651B: virtual_alias_maps map lookup problem for root@xxx.com.vn
Jul 5 14:35:14 mail2 postfix/pickup[8026]: 272049651B: uid=0 from=<root>
Jul 5 14:35:14 mail2 postfix/cleanup[8390]: 272049651B: message-id=<20110705073514.272049651B@mail2.xxx.com.vn>
Jul 5 14:35:14 mail2 postfix/cleanup[8390]: warning: 272049651B: virtual_alias_maps map lookup problem for root@xxx.com.vn
Jul 5 14:35:14 mail2 postfix/pickup[8026]: warning: 2BBC39651B: message has been queued for 5 days
Jul 5 14:35:14 mail2 postfix/pickup[8026]: 2BBC39651B: uid=0 from=<root>
Jul 5 14:35:14 mail2 postfix/cleanup[8390]: 2BBC39651B: message-id=<20110705073514.2BBC39651B@mail2.xxx.com.vn>
Jul 5 14:35:14 mail2 postfix/cleanup[8390]: warning: 2BBC39651B: virtual_alias_maps map lookup problem for root@xxx.com.vn

Minh connect được database bình thường mà nó bảo lổi
connect to mysql server localhost: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)
Dovecot vẫn auth được user .Mong các bạn xem và hướng dẫn mình .Thank
[Up] [Print Copy]
  [Question]   mail server 06/07/2011 15:56:09 (+0700) | #2 | 242908
docong1010
Member

[Minus]    0    [Plus]
Joined: 28/12/2004 14:11:13
Messages: 72
Offline
[Profile] [PM]
Đây là my.cnf của mình

[mysqld]
datadir=/var/lib/mysql
bind-address = 127.0.0.1
port = 3306
socket = /var/lib/mysql/mysql.sock
user = mysql

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

Các service mình đang open
te PID/Program name
tcp 0 0 localhost:mysql *:* LISTEN 11577/mysqld
tcp 0 0 *:sunrpc *:* LISTEN 5802/portmap
tcp 0 0 *:917 *:* LISTEN 5823/rpc.statd
tcp 0 0 localhost:ipp *:* LISTEN 5465/cupsd
tcp 0 0 *:smtp *:* LISTEN 12270/master
tcp 1 0 localhost:33316 localhost:mysql CLOSE_WAIT 8656/mysql
tcp 0 0 *:imaps *:* LISTEN 7336/dovecot
tcp 0 0 *:pop3s *:* LISTEN 7336/dovecot
tcp 0 0 *:pop3 *:* LISTEN 7336/dovecot
tcp 0 0 *:imap *:* LISTEN 7336/dovecot
tcp 0 0 *:http *:* LISTEN 6119/httpd
tcp 0 0 *:ssh *:* LISTEN 6017/sshd
tcp 0 0 localhost:ipp

Thank các bạn
[Up] [Print Copy]
  [Question]   mail server 06/07/2011 16:12:52 (+0700) | #3 | 242913
docong1010
Member

[Minus]    0    [Plus]
Joined: 28/12/2004 14:11:13
Messages: 72
Offline
[Profile] [PM]
HI all
Mình đã test như thế này
[root@mail2 ~]# telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
220 mail2.xxx.com.vn ESMTP Postfix
mail from:u1@xxx.com.vn
250 2.1.0 Ok
rcpt tosmiliexx@yahoo.com "Dòng này lúc trước nó báo là ("Temporary lookup failure" )"
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
helo
.
451 4.3.0 Error: queue file write error
421 4.4.2 mail2.xxx.com.vn Error: timeout exceeded
Connection closed by foreign host.
Mình xem log thì kho thấy báo lỗi gì
[Up] [Print Copy]
  [Question]   mail server 06/07/2011 16:26:00 (+0700) | #4 | 242915
neverwon
Member

[Minus]    0    [Plus]
Joined: 08/08/2006 13:38:43
Messages: 89
Offline
[Profile] [PM]
Cú pháp bạn sử dụng khi bạn cố connect vào DB và nhận được thông báo lỗi: "connect to mysql server localhost: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)" là gì?

Ví dụ:

# mysql -u username datbasename
# mysql -u username -p datbasename
#mysql -u username -p datbasename --socket=/var/lib/mysql/mysql.sock


????

P/S: Thông báo lỗi như trên có thể xuất hiện khi bạn nhập sai username/password hay sai option khai báo socket...

Không thể đưa ra gợi ý chính xác nếu không biết được chính xác cú pháp mà bạn đã sử dụng!!!

[Up] [Print Copy]
  [Question]   mail server 07/07/2011 08:34:03 (+0700) | #5 | 242954
docong1010
Member

[Minus]    0    [Plus]
Joined: 28/12/2004 14:11:13
Messages: 72
Offline
[Profile] [PM]
Thank you bạn đã reply cho mình. Mình đã test OK rồi. Mình chưa permissons /var/spool/postfix nên xảy ra lỗi như vậy
[Up] [Print Copy]
[digg] [delicious] [google] [yahoo] [technorati] [reddit] [stumbleupon]
Go to: 
 Users currently in here 
1 Anonymous

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|