作者 主題: 架Virtual Domain於Postfix問題  (閱讀 8902 次)

0 會員 與 1 訪客 正在閱讀本文。

nick6562

  • 憂鬱的高中生
  • ***
  • 文章數: 103
    • 檢視個人資料
架Virtual Domain於Postfix問題
« 於: 2006-03-21 11:55 »
請教各位高手,

    我假設完Virtual Domain於Postfix後,在Maillog中可以看到從外部信箱寄來的信的確進入了Virtual MailBox,訊息如下:
代碼: [選擇]

[root@mail ~]# tail /var/log/maillog
Mar 21 11:51:55 mail pop3-login: Login: test [::ffff:61.222.103.142]
Mar 21 11:53:31 mail pop3-login: Login: test [::ffff:61.222.103.142]
Mar 21 11:53:50 mail postfix/smtpd[28452]: connect from webmsr6.webmail.hinet.net[61.220.15.206]
Mar 21 11:53:50 mail postfix/smtpd[28452]: 8DA9D68066: client=webmsr6.webmail.hinet.net[61.220.15.206]
Mar 21 11:53:50 mail postfix/cleanup[28456]: 8DA9D68066: message-id=<1748974644.1142912706992.JavaMail.nobody@sg2001-ap-1>
Mar 21 11:53:50 mail postfix/qmgr[8485]: 8DA9D68066: from=<nick.hsu1976@msa.hinet.net>, size=1249, nrcpt=1 (queue active)
Mar 21 11:53:50 mail postfix/virtual[28457]: 8DA9D68066: to=<test@faylice.com.tw>, relay=virtual, delay=0, status=sent (delivered to mailbox)
Mar 21 11:53:50 mail postfix/qmgr[8485]: 8DA9D68066: removed
Mar 21 11:53:50 mail postfix/smtpd[28452]: disconnect from webmsr6.webmail.hinet.net[61.220.15.206]
Mar 21 11:54:31 mail pop3-login: Login: test [::ffff:61.222.103.142]


而在/var/vmail/faylice.com.tw/(Virtual MailBox的路徑)的test User的目錄是有佔用空間的, 可是卻無法收到信件?
代碼: [選擇]

[root@mail ~]# ls -l /var/vmail/faylice.com.tw
total 456
-rw-------  1 peggy peggy 457179 Mar 21 11:27 peggy
-rw-------  1 test  test    1390 Mar 21 11:53 test


我的Postfix設定值如下:
代碼: [選擇]

[root@mail ~]# postconf -n
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
mail_owner = postfix
mail_spool_directory = /var/spool/mail
mailbox_size_limit = 1024000000
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/man
mydestination = $myhostname, localhost.$mydomain, localhost, %mydomain, shuyo.com.tw
mydomain = shuyo.com.tw
myhostname = mail.shuyo.com.tw
mynetworks = 127.0.0.0/8, 61.222.103.142, 203.73.128.136/29
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /etc/postfix/readme_files
relay_domains = $mydestination
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtpd_client_restrictions = permit_sasl_authenticated
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated,      reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = ' '
smtpd_sasl_security_options = noanonymous
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual_aliases
virtual_gid_maps = hash:/etc/postfix/virtual_gids
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = faylice.com.tw, silverdeco.com.tw
virtual_mailbox_maps = hash:/etc/postfix/virtual
virtual_uid_maps = hash:/etc/postfix/virtual_uids


是否可以請高手們幫我解惑?謝謝各位~~ :(

kenduest

  • 酷!學園 學長們
  • 俺是博士!
  • *****
  • 文章數: 3675
    • 檢視個人資料
    • http://kenduest.sayya.org
Re: 架Virtual Domain於Postfix問題
« 回覆 #1 於: 2006-03-21 15:01 »
請問你用哪種 pop3 daemon 程式提供收信服務 ?

==
I am kenduest - 小州

my website: http://kenduest.sayya.org/

nick6562

  • 憂鬱的高中生
  • ***
  • 文章數: 103
    • 檢視個人資料
Re: 架Virtual Domain於Postfix問題
« 回覆 #2 於: 2006-03-21 16:56 »
引述: "kenduest"
請問你用哪種 pop3 daemon 程式提供收信服務 ?

==


您好,

   謝謝您的回覆!

OS: RHEL4
POP3: dovecot-0.99.11-2.EL4.1

謝謝您~ :)

kenduest

  • 酷!學園 學長們
  • 俺是博士!
  • *****
  • 文章數: 3675
    • 檢視個人資料
    • http://kenduest.sayya.org
Re: 架Virtual Domain於Postfix問題
« 回覆 #3 於: 2006-03-21 16:58 »
你問的是 pop3 收不到信件 ?

那該問的是... 你的 dovecot 程式能夠支援你配置的 virtual account 與 virtual domain 環境嗎?

==
I am kenduest - 小州

my website: http://kenduest.sayya.org/

paulso

  • 俺是博士!
  • *****
  • 文章數: 1966
    • 檢視個人資料
架Virtual Domain於Postfix問題
« 回覆 #4 於: 2006-03-21 17:11 »
有沒有設定 /etc/dovecot.conf

default_mail_env =

nick6562

  • 憂鬱的高中生
  • ***
  • 文章數: 103
    • 檢視個人資料
架Virtual Domain於Postfix問題
« 回覆 #5 於: 2006-03-21 17:28 »
引述: "paulso"
有沒有設定 /etc/dovecot.conf

default_mail_env =


您好,

 謝謝您的回覆! :)
我並沒有設定到這個選項, 是否要將它指定到 /var/vmail(virtual Mail的路徑)中呢? 謝謝您~~ :oops:

代碼: [選擇]

SSH Secure Shell 3.1.0 (Build 235)
Copyright (c) 2000-2001 SSH Communications Security Corp - http://www.ssh.com/

This copy of SSH Secure Shell is a non-commercial version.
This version does not include PKI and PKCS #11 functionality.


Last login: Tue Mar 21 17:04:12 2006 from 61.222.103.142
[root@mail ~]# vi /etc/dovecot.conf
# More verbose logging. Useful for figuring out why authentication isn't
# working.
#auth_verbose = no

# Even more verbose logging for debugging purposes. Shows for example SQL
# queries.
#auth_debug = no

# digest-md5 authentication process. It requires special MD5 passwords which
# /etc/shadow and PAM doesn't support, so we never need roots to handle it.
# Note that the passwd-file is opened before chrooting and dropping root
# privileges, so it may be 0600-root owned file.

#auth = digest_md5
#auth_mechanisms = digest-md5
#auth_realms =
#auth_userdb = passwd-file /etc/passwd.imap
#auth_passdb = passwd-file /etc/passwd.imap
#auth_user = imapauth
#auth_chroot =

# if you plan to use only passwd-file, you don't need the two auth processes,
# simply set "auth_methods = plain digest-md5"
search hit BOTTOM, continuing at TOP
## Dovecot 1.0 configuration file

# Default values are shown after each value, it's not required to uncomment
# any of the lines. Exception to this are paths, they're just examples
# with real defaults being based on configure options. The paths listed here
# are for configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
# --with-ssldir=/usr/share/ssl

# Base directory where to store runtime data.
#base_dir = /var/run/dovecot/

# Protocols we want to be serving:
#  imap imaps pop3 pop3s
#protocols = imap imaps
protocols = pop3 pop3s imap imaps

# IP or host address where to listen in for connections. It's not currently
# possible to specify multiple addresses. "*" listens in all IPv4 interfaces.
# "[::]" listens in all IPv6 interfaces, but may also listen in all IPv4
# interfaces depending on the operating system. You can specify ports with
# "host:port".
imap_listen = [::]
pop3_listen = [::]
/default                                                      

# Disable LOGIN command and all other plaintext authentications unless
# SSL/TLS is used (LOGINDISABLED capability). Note that 127.*.*.* and
# IPv6 ::1 addresses are considered secure, this setting has no effect if
# you connect from those addresses.
#disable_plaintext_auth = yes

# Use this logfile instead of syslog(). /dev/stderr can be used if you want to
# use stderr for logging (ONLY /dev/stderr - otherwise it is closed).
#log_path =

# For informational messages, use this logfile instead of the default
#info_log_path =

# Prefix for each line written to log file. % codes are in strftime(3)
# format.
#log_timestamp = "%b %d %H:%M:%S "

##
## Login processes
##

# Directory where authentication process places authentication UNIX sockets
/default                                                      

# Maximum number of connections allowed in login state. When this limit is
# reached, the oldest connections are dropped. If login_process_per_user
# is no, this is a per-process value, so the absolute maximum number of users
# logging in actually login_processes_count * max_logging_users.
#login_max_logging_users = 256

##
## POP3 login process
##

# Settings default to same as above, so you don't have to set anything
# unless you want to override them.

login = pop3

# Exception to above rule being the executable location.
#login_executable = /usr/libexec/dovecot/pop3-login

##
## Mail processes
##

/default                                                      
# new users aren't allowed to log in.
#max_mail_processes = 1024

# Show more verbose process titles (in ps). Currently shows user name and
# IP address. Useful for seeing who are actually using the IMAP processes
# (eg. shared mailboxes or if same uid is used for multiple accounts).
#verbose_proctitle = no

# Show protocol level SSL errors.
#verbose_ssl = no

# Valid UID range for users, defaults to 500 and above. This is mostly
# to make sure that users can't log in as daemons or other system users.
# Note that denying root logins is hardcoded to dovecot binary and can't
# be done even if first_valid_uid is set to 0.
#first_valid_uid = 500
#last_valid_uid = 0

# Valid GID range for users, defaults to non-root/wheel. Users having
# non-valid GID as primary group ID aren't allowed to log in. If user
# belongs to supplementary groups with non-valid GIDs, those groups are
# not set.
#first_valid_gid = 1
/default                                                      
# doc/mail-storages.txt. There's a few special variables you can use:
#
#   %u - username
#   %n - user part in user@domain, same as %u if there's no domain
#   %d - domain part in user@domain, empty if user there's no domain
#   %h - home directory
#
# You can also limit a width of string by giving the number of max. characters
# after the '%' character. For example %1u gives the first character of
# username. Some examples:
#
#   default_mail_env = maildir:/var/mail/%1u/%u/Maildir
#   default_mail_env = mbox:~/mail/:INBOX=/var/mail/%u
#   default_mail_env = mbox:/var/mail/%d/%n/:INDEX=/var/indexes/%d/%n
#
#default_mail_env =

# Space-separated list of fields to cache for all mails. Currently these
# fields are allowed followed by a list of commands they speed up:
#
#  Envelope      - FETCH ENVELOPE and SEARCH FROM, TO, CC, BCC, SUBJECT,
#                  SENTBEFORE, SENTON, SENTSINCE, HEADER MESSAGE-ID,
#                  HEADER IN-REPLY-TO

paulso

  • 俺是博士!
  • *****
  • 文章數: 1966
    • 檢視個人資料
架Virtual Domain於Postfix問題
« 回覆 #6 於: 2006-03-21 17:35 »
那裏有教你怎樣設, 自己先試一試

nick6562

  • 憂鬱的高中生
  • ***
  • 文章數: 103
    • 檢視個人資料
架Virtual Domain於Postfix問題
« 回覆 #7 於: 2006-03-21 23:16 »
引述: "paulso"
那裏有教你怎樣設, 自己先試一試


您好,

  感謝您的回覆,我真的有些看不懂,是否能請您幫忙指導我?再次謝謝您~~ :(

paulso

  • 俺是博士!
  • *****
  • 文章數: 1966
    • 檢視個人資料
架Virtual Domain於Postfix問題
« 回覆 #8 於: 2006-03-22 10:24 »
引用
#   %u - username
#   %n - user part in user@domain, same as %u if there's no domain
#   %d - domain part in user@domain, empty if user there's no domain
#   %h - home directory
#
# You can also limit a width of string by giving the number of max. characters
# after the '%' character. For example %1u gives the first character of
# username. Some examples:
#
#   default_mail_env = maildir:/var/mail/%1u/%u/Maildir
#   default_mail_env = mbox:~/mail/:INBOX=/var/mail/%u
#   default_mail_env = mbox:/var/mail/%d/%n/:INDEX=/var/indexes/%d/%n

nick6562

  • 憂鬱的高中生
  • ***
  • 文章數: 103
    • 檢視個人資料
架Virtual Domain於Postfix問題
« 回覆 #9 於: 2006-03-22 10:40 »
引述: "paulso"
引用
#   %u - username
#   %n - user part in user@domain, same as %u if there's no domain
#   %d - domain part in user@domain, empty if user there's no domain
#   %h - home directory
#
# You can also limit a width of string by giving the number of max. characters
# after the '%' character. For example %1u gives the first character of
# username. Some examples:
#
#   default_mail_env = maildir:/var/mail/%1u/%u/Maildir
#   default_mail_env = mbox:~/mail/:INBOX=/var/mail/%u
#   default_mail_env = mbox:/var/mail/%d/%n/:INDEX=/var/indexes/%d/%n


您好,

   謝謝您的回覆,我大概照著做,內文如下:

代碼: [選擇]

#   %d - domain part in user@domain, empty if user there's no domain
#   %h - home directory
#
# You can also limit a width of string by giving the number of max. characters
# after the '%' character. For example %1u gives the first character of
# username. Some examples:
#
#   default_mail_env = maildir:/var/mail/%1u/%u/Maildir
#   default_mail_env = mbox:~/mail/:INBOX=/var/mail/%u
#   default_mail_env = mbox:/var/mail/%d/%n/:INDEX=/var/indexes/%d/%n
#
default_mail_env = mbox:~/var/vmail/%d/%n
#default_mail_env = maildir:/var/mail/%1u/%u/Maildir
#default_mail_env = mbox:~/mail/:INBOX=/var/vmail/%u


看到maillog出現下列訊息:
代碼: [選擇]

[root@mail /]# tail /var/log/maillog
Mar 22 10:45:58 mail pop3-login: Login: test [::ffff:61.222.103.142]
Mar 22 10:45:58 mail pop3(test): Invalid mbox file /home/test/var/vmail//test: No such file or directory
Mar 22 10:45:58 mail pop3(test): Failed to create storage with data: mbox:/home/test/var/vmail//test
Mar 22 10:45:58 mail dovecot: child 23342 (pop3) returned error 89
Mar 22 10:47:51 mail dovecot: Killed with signal 15
Mar 22 10:47:51 mail dovecot: Dovecot starting up
Mar 22 10:47:56 mail pop3-login: Login: test [::ffff:61.222.103.142]
Mar 22 10:47:56 mail pop3(test): Invalid mbox file /home/test/var/vmail//test: No such file or directory
Mar 22 10:47:56 mail pop3(test): Failed to create storage with data: mbox:/home/test/var/vmail//test
Mar 22 10:47:56 mail dovecot: child 23369 (pop3) returned error 89


我真的糊塗了~~~ :(

paulso

  • 俺是博士!
  • *****
  • 文章數: 1966
    • 檢視個人資料
架Virtual Domain於Postfix問題
« 回覆 #10 於: 2006-03-22 10:56 »
引述: "/var/log/maillog"
Mar 22 10:47:56 mail pop3(test): Failed to create storage with data: mbox:/home/test/var/vmail//test


http://linux.vbird.org/linux_basic/0220filemanager.php#dir_opdir

paulso

  • 俺是博士!
  • *****
  • 文章數: 1966
    • 檢視個人資料
架Virtual Domain於Postfix問題
« 回覆 #11 於: 2006-03-22 11:00 »

nick6562

  • 憂鬱的高中生
  • ***
  • 文章數: 103
    • 檢視個人資料
架Virtual Domain於Postfix問題
« 回覆 #12 於: 2006-03-22 11:20 »
引述: "paulso"
請參考我這篇文章

http://phorum.study-area.org/viewtopic.php?p=190058


您好,

   這篇文章我拜讀過了~~
事實上我的狀況會有兩個以上的virtual domain, 這樣我就不知該怎麼辦了~~ :(

nick6562

  • 憂鬱的高中生
  • ***
  • 文章數: 103
    • 檢視個人資料
架Virtual Domain於Postfix問題
« 回覆 #13 於: 2006-03-22 11:48 »
代碼: [選擇]

[root@mail ~]# tail /var/log/maillog
Mar 22 11:50:02 mail MailScanner-MRTG[24641]: ERROR: iptraffic counters not fully initialised - no iptraffic data on this run.  This is normal on the first run, or when the previous run was more than 5 minutes ago (e.g. when rebooting).  If these errors persist over multiple runs please check that snmpd is running on your system.  If you don't want to run snmp please ensure that you have disabled it in mailscanner-mrtg.conf.  For more hints about snmp see README.SNMP in the docs directory
Mar 22 11:51:33 mail dovecot: Killed with signal 15
Mar 22 11:51:34 mail dovecot: Dovecot starting up
Mar 22 11:53:02 mail dovecot: Killed with signal 15
Mar 22 11:54:29 mail dovecot: Dovecot starting up
Mar 22 11:55:02 mail MailScanner-MRTG[24820]: ERROR: iptraffic counters not fully initialised - no iptraffic data on this run.  This is normal on the first run, or when the previous run was more than 5 minutes ago (e.g. when rebooting).  If these errors persist over multiple runs please check that snmpd is running on your system.  If you don't want to run snmp please ensure that you have disabled it in mailscanner-mrtg.conf.  For more hints about snmp see README.SNMP in the docs directory
Mar 22 11:55:15 mail pop3-login: Login: test [::ffff:61.222.103.142]
Mar 22 11:55:15 mail pop3(test): Invalid mbox file /var/vmail//test: No such file or directory
Mar 22 11:55:15 mail pop3(test): Failed to create storage with data: mbox:/var/vmail//test
Mar 22 11:55:15 mail dovecot: child 24891 (pop3) returned error 89

代碼: [選擇]

#   %u - username
#   %n - user part in user@domain, same as %u if there's no domain
#   %d - domain part in user@domain, empty if user there's no domain
#   %h - home directory
#
# You can also limit a width of string by giving the number of max. characters
# after the '%' character. For example %1u gives the first character of
# username. Some examples:
#
#   default_mail_env = maildir:/var/mail/%1u/%u/Maildir
#   default_mail_env = mbox:~/mail/:INBOX=/var/mail/%u
#   default_mail_env = mbox:/var/mail/%d/%n/:INDEX=/var/indexes/%d/%n
#
default_mail_env = mbox:/var/vmail/%d/%n
#auth_userdb = hash:/etc/postfix/virtual_uids /etc/postfix/virtual_gids
#auth_passwd = passwd-file /etc/passwd.mail
#default_mail_env = maildir:/var/vmail/%n
#default_mail_env = mbox:~/mail/:INBOX=/var/vmail/%u

paulso

  • 俺是博士!
  • *****
  • 文章數: 1966
    • 檢視個人資料
架Virtual Domain於Postfix問題
« 回覆 #14 於: 2006-03-22 11:51 »
引述: "nick6562"
引述: "paulso"
請參考我這篇文章

http://phorum.study-area.org/viewtopic.php?p=190058


您好,

   這篇文章我拜讀過了~~
事實上我的狀況會有兩個以上的virtual domain, 這樣我就不知該怎麼辦了~~ :(


兩個 virtual domain 可以的話, 三個四個五個也不是問題
做法我寫好了, 只是你不懂怎去用

paulso

  • 俺是博士!
  • *****
  • 文章數: 1966
    • 檢視個人資料
架Virtual Domain於Postfix問題
« 回覆 #15 於: 2006-03-22 11:52 »
引述: "nick6562"
代碼: [選擇]

[root@mail ~]# tail /var/log/maillog
Mar 22 11:50:02 mail MailScanner-MRTG[24641]: ERROR: iptraffic counters not fully initialised - no iptraffic data on this run.  This is normal on the first run, or when the previous run was more than 5 minutes ago (e.g. when rebooting).  If these errors persist over multiple runs please check that snmpd is running on your system.  If you don't want to run snmp please ensure that you have disabled it in mailscanner-mrtg.conf.  For more hints about snmp see README.SNMP in the docs directory
Mar 22 11:51:33 mail dovecot: Killed with signal 15
Mar 22 11:51:34 mail dovecot: Dovecot starting up
Mar 22 11:53:02 mail dovecot: Killed with signal 15
Mar 22 11:54:29 mail dovecot: Dovecot starting up
Mar 22 11:55:02 mail MailScanner-MRTG[24820]: ERROR: iptraffic counters not fully initialised - no iptraffic data on this run.  This is normal on the first run, or when the previous run was more than 5 minutes ago (e.g. when rebooting).  If these errors persist over multiple runs please check that snmpd is running on your system.  If you don't want to run snmp please ensure that you have disabled it in mailscanner-mrtg.conf.  For more hints about snmp see README.SNMP in the docs directory
Mar 22 11:55:15 mail pop3-login: Login: test [::ffff:61.222.103.142]
Mar 22 11:55:15 mail pop3(test): Invalid mbox file /var/vmail//test: No such file or directory
Mar 22 11:55:15 mail pop3(test): Failed to create storage with data: mbox:/var/vmail//test
Mar 22 11:55:15 mail dovecot: child 24891 (pop3) returned error 89

代碼: [選擇]

#   %u - username
#   %n - user part in user@domain, same as %u if there's no domain
#   %d - domain part in user@domain, empty if user there's no domain
#   %h - home directory
#
# You can also limit a width of string by giving the number of max. characters
# after the '%' character. For example %1u gives the first character of
# username. Some examples:
#
#   default_mail_env = maildir:/var/mail/%1u/%u/Maildir
#   default_mail_env = mbox:~/mail/:INBOX=/var/mail/%u
#   default_mail_env = mbox:/var/mail/%d/%n/:INDEX=/var/indexes/%d/%n
#
default_mail_env = mbox:/var/vmail/%d/%n
#auth_userdb = hash:/etc/postfix/virtual_uids /etc/postfix/virtual_gids
#auth_passwd = passwd-file /etc/passwd.mail
#default_mail_env = maildir:/var/vmail/%n
#default_mail_env = mbox:~/mail/:INBOX=/var/vmail/%u


看來 %d 沒有東西, 試試 /etc/passwd 內的 username 是:user@domain.com

nick6562

  • 憂鬱的高中生
  • ***
  • 文章數: 103
    • 檢視個人資料
架Virtual Domain於Postfix問題
« 回覆 #16 於: 2006-03-22 11:57 »
引述: "paulso"
引述: "nick6562"
代碼: [選擇]

[root@mail ~]# tail /var/log/maillog
Mar 22 11:50:02 mail MailScanner-MRTG[24641]: ERROR: iptraffic counters not fully initialised - no iptraffic data on this run.  This is normal on the first run, or when the previous run was more than 5 minutes ago (e.g. when rebooting).  If these errors persist over multiple runs please check that snmpd is running on your system.  If you don't want to run snmp please ensure that you have disabled it in mailscanner-mrtg.conf.  For more hints about snmp see README.SNMP in the docs directory
Mar 22 11:51:33 mail dovecot: Killed with signal 15
Mar 22 11:51:34 mail dovecot: Dovecot starting up
Mar 22 11:53:02 mail dovecot: Killed with signal 15
Mar 22 11:54:29 mail dovecot: Dovecot starting up
Mar 22 11:55:02 mail MailScanner-MRTG[24820]: ERROR: iptraffic counters not fully initialised - no iptraffic data on this run.  This is normal on the first run, or when the previous run was more than 5 minutes ago (e.g. when rebooting).  If these errors persist over multiple runs please check that snmpd is running on your system.  If you don't want to run snmp please ensure that you have disabled it in mailscanner-mrtg.conf.  For more hints about snmp see README.SNMP in the docs directory
Mar 22 11:55:15 mail pop3-login: Login: test [::ffff:61.222.103.142]
Mar 22 11:55:15 mail pop3(test): Invalid mbox file /var/vmail//test: No such file or directory
Mar 22 11:55:15 mail pop3(test): Failed to create storage with data: mbox:/var/vmail//test
Mar 22 11:55:15 mail dovecot: child 24891 (pop3) returned error 89

代碼: [選擇]

#   %u - username
#   %n - user part in user@domain, same as %u if there's no domain
#   %d - domain part in user@domain, empty if user there's no domain
#   %h - home directory
#
# You can also limit a width of string by giving the number of max. characters
# after the '%' character. For example %1u gives the first character of
# username. Some examples:
#
#   default_mail_env = maildir:/var/mail/%1u/%u/Maildir
#   default_mail_env = mbox:~/mail/:INBOX=/var/mail/%u
#   default_mail_env = mbox:/var/mail/%d/%n/:INDEX=/var/indexes/%d/%n
#
default_mail_env = mbox:/var/vmail/%d/%n
#auth_userdb = hash:/etc/postfix/virtual_uids /etc/postfix/virtual_gids
#auth_passwd = passwd-file /etc/passwd.mail
#default_mail_env = maildir:/var/vmail/%n
#default_mail_env = mbox:~/mail/:INBOX=/var/vmail/%u


看來 %d 沒有東西, 試試 /etc/passwd 內的 username 是:user@domain.com


您好,

   請教 %d 這個變數是在讀取 /etc/passwd 中的資料嗎?

我不太懂您的意思~ :o

nick6562

  • 憂鬱的高中生
  • ***
  • 文章數: 103
    • 檢視個人資料
架Virtual Domain於Postfix問題
« 回覆 #17 於: 2006-03-22 11:59 »
代碼: [選擇]

[root@mail ~]# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
news:x:9:13:news:/etc/news:
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
nscd:x:28:28:NSCD Daemon:/:/sbin/nologin
rpm:x:37:37::/var/lib/rpm:/sbin/nologin
haldaemon:x:68:68:HAL daemon:/:/sbin/nologin
netdump:x:34:34:Network Crash Dump user:/var/crash:/bin/bash
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
rpc:x:32:32:Portmapper RPC user:/:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin
smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin
pcap:x:77:77::/var/arpwatch:/sbin/nologin
apache:x:48:48:Apache:/var/www:/sbin/nologin
squid:x:23:23::/var/spool/squid:/sbin/nologin
webalizer:x:67:67:Webalizer:/var/www/usage:/sbin/nologin
xfs:x:43:43:X Font Server:/etc/X11/fs:/sbin/nologin
ntp:x:38:38::/etc/ntp:/sbin/nologin
gdm:x:42:42::/var/gdm:/sbin/nologin
htt:x:100:101:IIIMF Htt:/usr/lib/im:/sbin/nologin
named:x:25:25:Named:/var/named:/sbin/nologin
nick:x:500:500:Nick Hsu:/home/nick:/bin/bash
dovecot:x:97:97:dovecot:/usr/libexec/dovecot:/sbin/nologin
postfix:x:101:103::/home/postfix:/bin/false
join:x:501:501:Join Hsu:/home/join:/sbin/nologin
peggy:x:502:502:Peggy:/home/peggy:/sbin/nologin
service:x:503:503:Service:/home/service:/sbin/nologin
luke:x:504:504:Luke:/home/luke:/sbin/nologin
clamav:x:505:505:ClamAV User:/home/clamav:/bin/bash
spam:x:506:506::/home/spam:/bin/bash
nospam:x:507:507::/home/nospam:/bin/bash
kim:x:509:509:Kim:/home/kim:/sbin/nologin
gary:x:510:510:Gary:/home/gary:/sbin/nologin
ivy:x:511:511:Ivy:/home/ivy:/sbin/nologin
test:x:508:508:Test:/home/test:/sbin/nologin
[root@mail ~]# cat /etc/passwd.mail
test@faylice.com.tw:h1S9i8dCermbc

paulso

  • 俺是博士!
  • *****
  • 文章數: 1966
    • 檢視個人資料
架Virtual Domain於Postfix問題
« 回覆 #18 於: 2006-03-22 12:23 »
引述: "nick6562"
引述: "paulso"

看來 %d 沒有東西, 試試 /etc/passwd 內的 username 是:user@domain.com


您好,

   請教 %d 這個變數是在讀取 /etc/passwd 中的資料嗎?

我不太懂您的意思~ :o


引述: "/etc/dovecot.conf"
#   %u - username
#   %n - user part in user@domain, same as %u if there's no domain
#   %d - domain part in user@domain, empty if user there's no domain


一試便知龍與鳳

nick6562

  • 憂鬱的高中生
  • ***
  • 文章數: 103
    • 檢視個人資料
架Virtual Domain於Postfix問題
« 回覆 #19 於: 2006-03-22 14:26 »
引述: "paulso"
引述: "nick6562"
引述: "paulso"

看來 %d 沒有東西, 試試 /etc/passwd 內的 username 是:user@domain.com


您好,

   請教 %d 這個變數是在讀取 /etc/passwd 中的資料嗎?

我不太懂您的意思~ :o


引述: "/etc/dovecot.conf"
#   %u - username
#   %n - user part in user@domain, same as %u if there's no domain
#   %d - domain part in user@domain, empty if user there's no domain


一試便知龍與鳳


您好,

  我將所有參數都試過了~始終不行~~ :(
可以給我一些指導嗎?謝謝您了~

paulso

  • 俺是博士!
  • *****
  • 文章數: 1966
    • 檢視個人資料
架Virtual Domain於Postfix問題
« 回覆 #20 於: 2006-03-22 14:36 »
我上面所貼的文章已經是使用 Postfix virtual domain
mail box 存在:/var/spool/mail/domain1.com/user1

若果你做不到的話, 請完全按照著我的文章去設定, 我成功了, 沒理由你不能成功

若果照做也不能成功, 那麼請詳細貼出你做過什麼步驟, 一個也不要漏, 再跟你 debug 看看