PDA

View Full Version : Mail directory problem need help


tkp1969
17th March 2009, 04:40
I have installed http://www.howtoforge.org/virtual-users-domains-postfix-courier-mysql-squirrelmail-debian-lenny document everything work, but when I create user with mailx (mailx tkp1969@npru.ac.th) it not create mailbox user, I find in /home/vmail this not show directory of tkp1969.
How I can do?
Best regards.

falko
17th March 2009, 15:29
What's in your mail log when you send a welcome message?

Flash
17th March 2009, 16:01
You should send a message to the user which will create the home directory. If that does not work, indeed send mail log as said above.

tkp1969
17th March 2009, 16:33
today I try install on ubuntu 8.04 and found problem too.

mylog

Mar 17 21:15:38 mail postfix/cleanup[21403]: 342FE620E0: message-id=<20090317141538.342FE620E0@mail.npru.ac.th>
Mar 17 21:15:38 mail postfix/qmgr[21398]: 342FE620E0: from=<root@mail.npru.ac.th>, size=296, nrcpt=1 (queue active)
Mar 17 21:15:44 mail postfix/smtpd[21411]: connect from localhost.localdomain[127.0.0.1]
Mar 17 21:15:44 mail postfix/smtpd[21411]: 3489D620D9: client=localhost.localdomain[127.0.0.1]
Mar 17 21:15:44 mail postfix/cleanup[21403]: 3489D620D9: message-id=<20090317141538.342FE620E0@mail.npru.ac.th>
Mar 17 21:15:44 mail postfix/smtpd[21411]: disconnect from localhost.localdomain[127.0.0.1]
Mar 17 21:15:44 mail postfix/qmgr[21398]: 3489D620D9: from=<root@mail.npru.ac.th>, size=748, nrcpt=1 (queue active)
Mar 17 21:15:44 mail amavis[21092]: (21092-03) Passed CLEAN, <root@mail.npru.ac.th> -> <tkp1969@npru.ac.th>, Message-ID: <20090317141538.342FE620E0@mail.npru.ac.th>, mail_id: VjLxQQccolOq, Hits: -0.001, size: 296, queued_as: 3489D620D9, 6000 ms
Mar 17 21:15:44 mail postfix/smtp[21406]: 342FE620E0: to=<tkp1969@npru.ac.th>, relay=127.0.0.1[127.0.0.1]:10024, delay=6, delays=0.03/0/0/6, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 3489D620D9)
Mar 17 21:15:44 mail postfix/qmgr[21398]: 342FE620E0: removed
Mar 17 21:15:44 mail postfix/smtp[21415]: 3489D620D9: to=<tkp1969@npru.ac.th>, relay=none, delay=0.02, delays=0.01/0/0/0, dsn=5.4.6, status=bounced (mail for mail.npru.ac.th loops back to myself)
Mar 17 21:15:44 mail postfix/cleanup[21403]: 3C48E620E1: message-id=<20090317141544.3C48E620E1@mail.npru.ac.th>
Mar 17 21:15:44 mail postfix/bounce[21416]: 3489D620D9: sender non-delivery notification: 3C48E620E1
Mar 17 21:15:44 mail postfix/qmgr[21398]: 3C48E620E1: from=<>, size=2585, nrcpt=1 (queue active)
Mar 17 21:15:44 mail postfix/qmgr[21398]: 3489D620D9: removed
Mar 17 21:15:44 mail postfix/local[21417]: 3C48E620E1: to=<h50544b@mail.npru.ac.th>, orig_to=<root@mail.npru.ac.th>, relay=local, delay=0.02, delays=0.01/0/0/0.01, dsn=2.0.0, status=sent (delivered to mailbox)
Mar 17 21:15:44 mail postfix/qmgr[21398]: 3C48E620E1: removed

mypostfix config

root@mail:~# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = amavis:[127.0.0.1]:10024
html_directory = /usr/share/doc/postfix/html
inet_interfaces = all
mailbox_size_limit = 0
mydestination = mail.npru.ac.th, localhost, localhost.localdomain, 202.29.9.20
myhostname = mail.npru.ac.th
mynetworks = 127.0.0.0/8
myorigin = /etc/mailname
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
readme_directory = /usr/share/doc/postfix
receive_override_options = no_address_mappings
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf

regards.

falko
18th March 2009, 20:00
Mar 17 21:15:44 mail postfix/smtp[21415]: 3489D620D9: to=<tkp1969@npru.ac.th>, relay=none, delay=0.02, delays=0.01/0/0/0, dsn=5.4.6, status=bounced (mail for mail.npru.ac.th loops back to myself)Please add mail.npru.ac.th to mydestination in your main.cf and restart Postfix.

tkp1969
22nd March 2009, 03:53
Please add mail.npru.ac.th to mydestination in your main.cf and restart Postfix.

main.cf in postfix

mydestination = mail.npru.ac.th, localhost, localhost.localdomain, 202.29.9.20

falko
22nd March 2009, 16:30
Did you restart Postfix?

tkp1969
24th March 2009, 03:20
Did you restart Postfix?

Sure I restart postfix and restart the server. When I test mailx again the problem is same.
I test implement the server with ubuntu 8.10, debian 4.0 and debian 5.0 again but, this same.

falko
24th March 2009, 18:55
What are the outputs of hostname and hostname -f, and what's in /etc/hosts and /etc/mailname?

BTW, does this look correct?

mh1:~# dig mail.npru.ac.th

; <<>> DiG 9.3.4 <<>> mail.npru.ac.th
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5796
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;mail.npru.ac.th. IN A

;; ANSWER SECTION:
mail.npru.ac.th. 38400 IN CNAME mail2.npru.ac.th.
mail2.npru.ac.th. 38400 IN A 202.29.9.47

;; Query time: 670 msec
;; SERVER: 145.253.2.75#53(145.253.2.75)
;; WHEN: Tue Mar 24 18:02:12 2009
;; MSG SIZE rcvd: 69

mh1:~#

tkp1969
27th March 2009, 05:41
hostname and hostname -f
root@mail:~# hostname
mail.npru.ac.th
root@mail:~# hostname -f
mail.npru.ac.th

in /etc/host
root@mail:~# cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
202.29.9.20 mail.npru.ac.th mail

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

in /etc/mailname
root@mail:~# cat /etc/mailname
mail.npru.ac.th

mh1:~# dig mail.npru.ac.th

; <<>> DiG 9.3.4 <<>> mail.npru.ac.th
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5796
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;mail.npru.ac.th. IN A

;; ANSWER SECTION:
mail.npru.ac.th. 38400 IN CNAME mail2.npru.ac.th.
mail2.npru.ac.th. 38400 IN A 202.29.9.47

;; Query time: 670 msec
;; SERVER: 145.253.2.75#53(145.253.2.75)
;; WHEN: Tue Mar 24 18:02:12 2009
;; MSG SIZE rcvd: 69

mh1:~#
This you see is correct, but when dig mail.npru.ac.th, I configure mail.npru.ac.th into my dns server, I remove old mail in my dns and reconfigure agian this show

root@mail:~# dig mail.npru.ac.th

; <<>> DiG 9.4.2-P2 <<>> mail.npru.ac.th
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14162
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;mail.npru.ac.th. IN A

;; ANSWER SECTION:
mail.npru.ac.th. 38400 IN A 202.29.9.20


when I test again mail.log this show
Mar 27 10:45:47 mail postfix/pickup[20650]: 4B9E8620E1: uid=0 from=<root>
Mar 27 10:45:47 mail postfix/cleanup[20712]: 4B9E8620E1: message-id=<20090327034547.4B9E8620E1@mail.npru.ac.th>
Mar 27 10:45:47 mail postfix/qmgr[6272]: 4B9E8620E1: from=<root@mail.npru.ac.th>, size=294, nrcpt=1 (queue active)
Mar 27 10:46:00 mail postfix/smtpd[20720]: connect from localhost.localdomain[127.0.0.1]
Mar 27 10:46:00 mail postfix/trivial-rewrite[20722]: warning: do not list domain mail.npru.ac.th in BOTH mydestination and virtual_alias_domains
Mar 27 10:46:00 mail postfix/trivial-rewrite[20722]: warning: do not list domain npru.ac.th in BOTH mydestination and virtual_mailbox_domains
Mar 27 10:46:00 mail postfix/smtpd[20720]: ADD3D620E0: client=localhost.localdomain[127.0.0.1]
Mar 27 10:46:00 mail postfix/cleanup[20712]: ADD3D620E0: message-id=<20090327034547.4B9E8620E1@mail.npru.ac.th>
Mar 27 10:46:00 mail postfix/smtpd[20720]: disconnect from localhost.localdomain[127.0.0.1]
Mar 27 10:46:00 mail postfix/qmgr[6272]: ADD3D620E0: from=<root@mail.npru.ac.th>, size=746, nrcpt=1 (queue active)
Mar 27 10:46:00 mail postfix/trivial-rewrite[20722]: warning: do not list domain npru.ac.th in BOTH mydestination and virtual_mailbox_domains
Mar 27 10:46:00 mail amavis[5783]: (05783-04) Passed CLEAN, <root@mail.npru.ac.th> -> <tkp1969@npru.ac.th>, Message-ID: <20090327034547.4B9E8620E1@mail.npru.ac.th>, mail_id: Znzo5KG3xLdZ, Hits: 1.901, size: 294, queued_as: ADD3D620E0, 13394 ms
Mar 27 10:46:00 mail postfix/smtp[20715]: 4B9E8620E1: to=<tkp1969@npru.ac.th>, relay=127.0.0.1[127.0.0.1]:10024, delay=13, delays=0.04/0/0/13, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as ADD3D620E0)
Mar 27 10:46:00 mail postfix/qmgr[6272]: 4B9E8620E1: removed
Mar 27 10:46:00 mail postfix/smtp[20723]: ADD3D620E0: to=<tkp1969@npru.ac.th>, relay=none, delay=0.02, delays=0.01/0/0/0, dsn=5.4.6, status=bounced (mail for mail.npru.ac.th loops back to myself)
Mar 27 10:46:00 mail postfix/cleanup[20712]: B3DC6620E2: message-id=<20090327034600.B3DC6620E2@mail.npru.ac.th>
Mar 27 10:46:00 mail postfix/bounce[20724]: ADD3D620E0: sender non-delivery notification: B3DC6620E2
Mar 27 10:46:00 mail postfix/qmgr[6272]: B3DC6620E2: from=<>, size=2583, nrcpt=1 (queue active)
Mar 27 10:46:00 mail postfix/trivial-rewrite[20722]: warning: do not list domain mail.npru.ac.th in BOTH mydestination and virtual_alias_domains
Mar 27 10:46:00 mail postfix/qmgr[6272]: ADD3D620E0: removed
Mar 27 10:46:00 mail postfix/smtp[20723]: B3DC6620E2: to=<root@mail.npru.ac.th>, relay=none, delay=0.01, delays=0.01/0/0/0, dsn=5.4.6, status=bounced (mail for mail.npru.ac.th loops back to myself)
Mar 27 10:46:00 mail postfix/qmgr[6272]: B3DC6620E2: removed

and I don't understand mail.log show
Mar 27 10:46:00 mail postfix/trivial-rewrite[20722]: warning: do not list domain mail.npru.ac.th in BOTH mydestination and virtual_alias_domains
Mar 27 10:46:00 mail postfix/trivial-rewrite[20722]: warning: do not list domain npru.ac.th in BOTH mydestination and virtual_mailbox_domains

falko
27th March 2009, 16:10
mh1:~# dig mail.npru.ac.th

; <<>> DiG 9.3.4 <<>> mail.npru.ac.th
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51856
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;mail.npru.ac.th. IN A

;; ANSWER SECTION:
mail.npru.ac.th. 38400 IN CNAME mail2.npru.ac.th.
mail2.npru.ac.th. 38400 IN A 202.29.9.47

;; Query time: 534 msec
;; SERVER: 145.253.2.75#53(145.253.2.75)
;; WHEN: Fri Mar 27 15:15:08 2009
;; MSG SIZE rcvd: 69

mh1:~#I'm still seeing the wrong IP, so maybe something went wrong in your DNS configuration.

BTW, MX records must point to A records, not to CNAME records:

mh1:~# dig mx mail.npru.ac.th

; <<>> DiG 9.3.4 <<>> mx mail.npru.ac.th
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43883
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;mail.npru.ac.th. IN MX

;; ANSWER SECTION:
mail.npru.ac.th. 38375 IN CNAME mail2.npru.ac.th.
mail2.npru.ac.th. 38400 IN MX 40 ppcatmast.cattelecom.com.
mail2.npru.ac.th. 38400 IN MX 50 ppcatagt.cattelecom.com.

;; Query time: 258 msec
;; SERVER: 145.253.2.75#53(145.253.2.75)
;; WHEN: Fri Mar 27 15:15:33 2009
;; MSG SIZE rcvd: 118

mh1:~#
Please change that.

Mar 27 10:46:00 mail postfix/trivial-rewrite[20722]: warning: do not list domain mail.npru.ac.th in BOTH mydestination and virtual_alias_domains
You cannot use mail.npru.ac.th as a virtual domain in the databasse if this is the hostname of the server at the same time. Either rename the server or use a different domain in the database.

tkp1969
27th March 2009, 18:52
This now I change dns record to correct

when dig mx npru.ac.th this now show

root@mail:~# dig mx npru.ac.th

; <<>> DiG 9.4.2-P2 <<>> mx npru.ac.th
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46010
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 2, ADDITIONAL: 3

;; QUESTION SECTION:
;npru.ac.th. IN MX

;; ANSWER SECTION:
npru.ac.th. 38400 IN MX 30 ppcatagt.cattelecom.com.
npru.ac.th. 38400 IN MX 10 mail.npru.ac.th.
npru.ac.th. 38400 IN MX 20 ppcatmast.cattelecom.com.

;; Query time: 0 msec
;; SERVER: 202.29.9.48#53(202.29.9.48)
;; WHEN: Fri Mar 27 23:37:12 2009
;; MSG SIZE rcvd: 210

dig mx mail.npru.ac.th
root@mail:~# dig mx mail.npru.ac.th

; <<>> DiG 9.4.2-P2 <<>> mx mail.npru.ac.th
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26262
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3

;; QUESTION SECTION:
;mail.npru.ac.th. IN MX

;; ANSWER SECTION:
mail.npru.ac.th. 38400 IN MX 100 mail.npru.ac.th.

;; Query time: 0 msec
;; SERVER: 202.29.9.48#53(202.29.9.48)
;; WHEN: Fri Mar 27 23:41:11 2009
;; MSG SIZE rcvd: 145

when I test mailx again mail.log show
Mar 27 23:45:09 mail postfix/pickup[23939]: 7928C620E1: uid=0 from=<root>
Mar 27 23:45:09 mail postfix/cleanup[23962]: 7928C620E1: message-id=<20090327164509.7928C620E1@mail.npru.ac.th>
Mar 27 23:45:09 mail postfix/qmgr[6272]: 7928C620E1: from=<root@mail.npru.ac.th>, size=294, nrcpt=1 (queue active)
Mar 27 23:45:23 mail postfix/smtpd[23968]: connect from localhost.localdomain[127.0.0.1]
Mar 27 23:45:23 mail postfix/trivial-rewrite[23957]: warning: do not list domain mail.npru.ac.th in BOTH mydestination and virtual_alias_domains
Mar 27 23:45:23 mail postfix/trivial-rewrite[23957]: warning: do not list domain npru.ac.th in BOTH mydestination and virtual_mailbox_domains
Mar 27 23:45:23 mail postfix/smtpd[23968]: 785D0620E0: client=localhost.localdomain[127.0.0.1]
Mar 27 23:45:23 mail postfix/cleanup[23962]: 785D0620E0: message-id=<20090327164509.7928C620E1@mail.npru.ac.th>
Mar 27 23:45:23 mail postfix/smtpd[23968]: disconnect from localhost.localdomain[127.0.0.1]
Mar 27 23:45:23 mail postfix/qmgr[6272]: 785D0620E0: from=<root@mail.npru.ac.th>, size=746, nrcpt=1 (queue active)
Mar 27 23:45:23 mail postfix/trivial-rewrite[23957]: warning: do not list domain npru.ac.th in BOTH mydestination and virtual_mailbox_domains
Mar 27 23:45:23 mail amavis[5784]: (05784-05) Passed CLEAN, <root@mail.npru.ac.th> -> <tkp1969@npru.ac.th>, Message-ID: <20090327164509.7928C620E1@mail.npru.ac.th>, mail_id: auZBNqBgdHk9, Hits: 1.96, size: 294, queued_as: 785D0620E0, 14009 ms
Mar 27 23:45:23 mail postfix/smtp[23963]: 7928C620E1: to=<tkp1969@npru.ac.th>, relay=127.0.0.1[127.0.0.1]:10024, delay=14, delays=0.03/0/0/14, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 785D0620E0)
Mar 27 23:45:23 mail postfix/qmgr[6272]: 7928C620E1: removed
Mar 27 23:45:23 mail postfix/smtp[23969]: 785D0620E0: to=<tkp1969@npru.ac.th>, relay=none, delay=0.03, delays=0.02/0.01/0/0, dsn=5.4.6, status=bounced (mail for mail.npru.ac.th loops back to myself)
Mar 27 23:45:23 mail postfix/cleanup[23962]: 831C9620E2: message-id=<20090327164523.831C9620E2@mail.npru.ac.th>
Mar 27 23:45:23 mail postfix/bounce[23970]: 785D0620E0: sender non-delivery notification: 831C9620E2
Mar 27 23:45:23 mail postfix/qmgr[6272]: 831C9620E2: from=<>, size=2583, nrcpt=1 (queue active)
Mar 27 23:45:23 mail postfix/trivial-rewrite[23957]: warning: do not list domain mail.npru.ac.th in BOTH mydestination and virtual_alias_domains
Mar 27 23:45:23 mail postfix/qmgr[6272]: 785D0620E0: removed
Mar 27 23:45:23 mail postfix/smtp[23969]: 831C9620E2: to=<root@mail.npru.ac.th>, relay=none, delay=0.01, delays=0.01/0/0/0, dsn=5.4.6, status=bounced (mail for mail.npru.ac.th loops back to myself)
Mar 27 23:45:23 mail postfix/qmgr[6272]: 831C9620E2: removed

falko
28th March 2009, 20:33
You cannot use mail.npru.ac.th as a virtual domain in the databasse if this is the hostname of the server at the same time. Either rename the server or use a different domain in the database.