PDA

View Full Version : Virtual Users And Domains With Postfix, Courier And MySQL


Torsson
18th March 2006, 21:41
Hi, the howto guide is great, but i have a little problem.

First when i had done everything in the howto i had problem with

-ERR Maildir: No such file or directory

but when i changed from

MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
to
MYSQL_MAILDIR_FIELD Maildir

i stoped get those messages.

but then i get

-ERR Login failed

And i have tryed to send a mail to the user

And i get another strange thing, but this time with imap.
when i do telnet localhost 143 and write login user@domain.com mypassword
i get this

login NO Error in IMAP command received by server.


telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2004 Double Precision, Inc. See COPYING for distribution information.
login torsson@aitd-gaming.net mypassword
login NO Error in IMAP command received by server.



What have i done wrong?.

falko
18th March 2006, 23:26
Hi, the howto guide is great, but i have a little problem.

First when i had done everything in the howto i had problem with

-ERR Maildir: No such file or directory

You must send an email to that user first. The Maildir gets created when the first email arrives.

Torsson
19th March 2006, 12:12
When i try to send mail to the user my other mail said this:

This is an automatically generated Delivery Status Notification.

Delivery to the following recipients failed.

torsson@aitd-gaming.net

Anywhon know what is wrong?... hmm maby firewall problems, but what ports needs to be open ?

falko
19th March 2006, 13:41
When i try to send mail to the user my other mail said this:

This is an automatically generated Delivery Status Notification.

Delivery to the following recipients failed.

torsson@aitd-gaming.net

There must be a reason mentioned in the mail.
What's in the mail log when the delivery fails?

Torsson
19th March 2006, 13:46
Now when i open port 25 110 i dont get a falied but it still says
-ERR Maildir: No such file or directory when i try with telnet

And with opera pop3 mail

falko
19th March 2006, 14:45
What's in the mail log?

Torsson
19th March 2006, 15:23
Maby this is the problem:

telnet localhost 25
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

Mail log dosent say anything about why he didnt receve the mail. postfix and everything is started.

things from mail.log that seems strange:
Mar 19 08:55:08 localhost postfix/master[880]: fatal: /etc/postfix/master.cf: li

ne 127: bad transport type: smtp_data_done_timeout=1200

Mar 19 08:54:19 localhost dccifd[660]: 1.2.74 listening to /var/lib/dcc/dccifd <-- shuld it be 1.2.74 ?

Mar 19 14:14:14 localhost dccproc[934]: socket(UDP): Address family not supported by protocol

falko
20th March 2006, 13:45
Please post the output of netstat -tap and the content of /etc/postfix/master.cf.

Torsson
20th March 2006, 17:21
Netstat:


Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:imaps *:* LISTEN 629/couriertcpd
tcp 0 0 *:pop3s *:* LISTEN 652/couriertcpd
tcp 0 0 localhost.localdo:10024 *:* LISTEN 548/amavisd (master
tcp 0 0 localhost.localdo:mysql *:* LISTEN 733/mysqld
tcp 0 0 *:pop3 *:* LISTEN 638/couriertcpd
tcp 0 0 *:imap2 *:* LISTEN 615/couriertcpd
tcp 0 0 *:sunrpc *:* LISTEN 379/portmap
tcp 0 0 *:www *:* LISTEN 916/apache2
tcp 0 0 *:auth *:* LISTEN 668/inetd
tcp 0 0 *:659 *:* LISTEN 901/rpc.statd
tcp 0 0 *:ssh *:* LISTEN 896/sshd
tcp 0 0 192.168.0.2:ssh 192.168.0.110:4219 ESTABLISHED940/0
tcp 0 0 localhost.localdom:pop3 localhost.localdom:1038 TIME_WAIT -



Master.cf

smtp inet n - - - - smtpd
#submission inet n - - - - smtpd
# -o smtpd_etrn_restrictions=reject
#628 inet n - - - - qmqpd
pickup fifo n - - 60 1 pickup
cleanup unix n - - - 0 cleanup
qmgr fifo n - - 300 1 qmgr
#qmgr fifo n - - 300 1 oqmgr
rewrite unix - - - - - trivial-rewrite
bounce unix - - - - 0 bounce
defer unix - - - - 0 bounce
trace unix - - - - 0 bounce
verify unix - - - - 1 verify
flush unix n - - 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - - - - smtp
relay unix - - - - - smtp
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - - - - showq
error unix - - - - - error
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
#
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# maildrop. See the Postfix MAILDROP_README file for details.
#
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -d -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}

# only used by postfix-tls
#tlsmgr fifo - - n 300 1 tlsmgr
#smtps inet n - n - - smtpd -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
#587 inet n - n - - smtpd -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes

amavis unix - - - - 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
127.0.0.1:10025 inet n - - - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,rej ect
-o mynetworks=127.0.0.0/8
-o strict_rfc821_envelopes=yes
-o receive_override_options=no_unknown_recipient_chec ks,no_header_body_checks
-o smtpd_bind_address=127.0.0.1

Torsson
20th March 2006, 17:44
I can have found the problem, my domain holder havent changed the MX record on a proper way. but i still need to solve the telnet localhost 25 problem

falko
21st March 2006, 00:17
Please remove -o smtp_data_done_timeout=1200 from /etc/postfix/master.cf and restart Postfix.

Torsson
24th March 2006, 14:26
I want to thank you falko for your time you took to help me. i bought a new server pc and did your guide and it works great!. you are then man!!! :)

szizso
23rd May 2006, 20:07
Hi

i dont understand, why :confused: ???

May 23 18:00:28 localhost postfix/master[15854]: daemon started -- version 2.1.5
May 23 18:00:28 localhost postfix/proxymap[15859]: warning: request for unapproved table: "mysql:/etc/postfix/mysql-virtual_forwardings.cf"
May 23 18:00:28 localhost postfix/proxymap[15859]: warning: to approve this table for proxymap access, list proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf in main.cf:proxy_read_maps
May 23 18:00:28 localhost postfix/cleanup[15858]: fatal: proxymap service is not configured for table "mysql:/etc/postfix/mysql-virtual_forwardings.cf"
May 23 18:00:29 localhost postfix/master[15854]: warning: process /usr/lib/postfix/cleanup pid 15858 exit status 1
May 23 18:00:29 localhost postfix/master[15854]: warning: /usr/lib/postfix/cleanup: bad command startup -- throttling

falko
23rd May 2006, 20:24
What's the value of proxy_read_maps in /etc/postfix/main.cf?

szizso
24th May 2006, 14:33
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf,proxy:mysql:/etc/postfix/mysql-virtual_email2email.cf

proxy_read_maps = $local_recipient_maps$mydestination$virtual_alias_ maps$virtual_alias_domains$virtual_mailbox_maps$vi rtual_mailbox_domains$relay_recipient_maps$relay_d omains$canonical_maps$sender_canonical_maps$recipi nt_canonical_maps$relocated_maps$transport_maps$my networks$virtual_mailbox_limit_maps

falko
24th May 2006, 19:30
proxy_read_maps = $local_recipient_maps$mydestination$virtual_alias_ maps$virtual_alias_domains$virtual_mailbox_maps$vi rtual_mailbox_domains$relay_recipient_maps$relay_d omains$canonical_maps$sender_canonical_maps$recipi nt_canonical_maps$relocated_maps$transport_maps$my networks$virtual_mailbox_limit_maps
You need spaces between the variables...
Restart Postfix afterwards.

szizso
25th May 2006, 19:36
yesssssss, thx

szizso
29th May 2006, 14:59
May 29 13:43:41 localhost postfix/smtpd[27010]: fatal: unknown receive_override_options value "no_unknown_recepient_checks" in "no_unknown_recepient_checks,no_header_body_checks"
May 29 13:43:42 localhost postfix/master[26223]: warning: process /usr/lib/postfix/smtpd pid 27010 exit status 1
May 29 13:43:42 localhost postfix/master[26223]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling

why ???

master.cf
amavis unix - - - - 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
127.0.0.1:10025 inet n - - - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recepient_restrictions=permit_mynetworks,rej ect
-o mynetworks=127.0.0.0/8
-o strict_rfc821_envelopes=yes
-o receive_override_options=no_unknown_recepient_chec ks,no_header_body_checks
-o smtpd_bind_address=127.0.0.1

falko
29th May 2006, 16:40
You have a typo there:

-o receive_override_options=no_unknown_recepient_chec ks,no_header_body_checks

should be

-o receive_override_options=no_unknown_recipient_chec ks,no_header_body_checks

szizso
30th May 2006, 18:01
:eek: sorry I dont behold, thxxxxxxxx