HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP-AUTH, Quota, SpamAs (http://www.howtoforge.com/forums/showthread.php?t=7056)

k1piee 24th September 2006 23:21

Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP-AUTH, Quota, SpamAs
 
hello!

i have a problem whit my mail server. i can't loggin with the users I add to the mysql-database.
I get this error in /var/log/mail.log :

Quote:

Sep 24 22:05:10 server1 courierpop3login: Connection, ip=[::ffff:85.228.206.67]
Sep 24 22:05:34 server1 courierpop3login: LOGIN FAILED, ip=[::ffff:85.228.206.67]
and i get some other errors too:

Quote:

Sep 24 21:46:10 server1 postfix/proxymap[10120]: warning: connect to mysql server 127.0.0.1: Can't connect to MySQL server on '127.0.0.1' (111)
Sep 24 21:46:10 server1 postfix/proxymap[10120]: warning: connect to mysql server 127.0.0.1: Can't connect to MySQL server on '127.0.0.1' (111)
Sep 24 21:46:10 server1 postfix/trivial-rewrite[10495]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,100): table lookup problem
Sep 24 21:46:10 server1 postfix/trivial-rewrite[10496]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,100): table lookup problem
Sep 24 21:46:10 server1 postfix/trivial-rewrite[10497]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,100): table lookup problem
Sep 24 21:46:11 server1 postfix/smtpd[10119]: warning: premature end-of-input on private/rewrite socket while reading input attribute name
Sep 24 21:46:11 server1 postfix/smtpd[10356]: warning: premature end-of-input on private/rewrite socket while reading input attribute name
Sep 24 21:46:11 server1 postfix/master[10077]: warning: process /usr/lib/postfix/trivial-rewrite pid 10495 exit status 1
Sep 24 21:46:11 server1 postfix/smtpd[10119]: warning: problem talking to service rewrite: Success
Sep 24 21:46:11 server1 postfix/smtpd[10356]: warning: problem talking to service rewrite: Connection reset by peer
Sep 24 21:46:11 server1 postfix/master[10077]: warning: /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling
Sep 24 21:46:11 server1 postfix/smtpd[10357]: warning: premature end-of-input on private/rewrite socket while reading input attribute name
Sep 24 21:46:11 server1 postfix/smtpd[10125]: warning: premature end-of-input on private/rewrite socket while reading input attribute name
Sep 24 21:46:11 server1 postfix/master[10077]: warning: process /usr/lib/postfix/trivial-rewrite pid 10496 exit status 1
Sep 24 21:46:11 server1 postfix/smtpd[10357]: warning: problem talking to service rewrite: Success
Sep 24 21:46:11 server1 postfix/smtpd[10125]: warning: problem talking to service rewrite: Connection reset by peer
Sep 24 21:46:11 server1 postfix/smtpd[10355]: warning: premature end-of-input on private/rewrite socket while reading input attribute name
Sep 24 21:46:11 server1 postfix/smtpd[10442]: warning: premature end-of-input on private/rewrite socket while reading input attribute name
Sep 24 21:46:11 server1 postfix/master[10077]: warning: process /usr/lib/postfix/trivial-rewrite pid 10497 exit status 1
Sep 24 21:46:11 server1 postfix/smtpd[10355]: warning: problem talking to service rewrite: Success
Sep 24 21:46:11 server1 postfix/smtpd[10442]: warning: problem talking to service rewrite: Connection reset by peer
Sep 24 21:46:12 server1 postfix/smtpd[10498]: fatal: /etc/postfix/mysql-virtual_email2email.cf: bad string length 0 < 1: table =
Sep 24 21:46:13 server1 postfix/master[10077]: warning: process /usr/lib/postfix/smtpd pid 10498 exit status 1
Sep 24 21:46:13 server1 postfix/master[10077]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling
these files are exakt like he describes in the howto!
exept the passwoef! :p
Quote:

-rw-r----- 1 root postfix 134 2006-09-24 22:02 mysql-virtual_domains.cf
-rw-r----- 1 root postfix 127 2006-09-24 22:03 mysql-virtual_email2email.cf
-rw-r----- 1 root postfix 140 2006-09-24 22:03 mysql-virtual_forwardings.cf
-rw-r----- 1 root postfix 196 2006-09-24 22:03 mysql-virtual_mailboxes.cf
-rw-r----- 1 root postfix 127 2006-09-24 22:04 mysql-virtual_mailbox_limit_maps.cf
-rw-r----- 1 root postfix 136 2006-09-24 22:04 mysql-virtual_transports.cf
and my main.cf :
Quote:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

myhostname = Dad3L.org
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = Dad3L.org, localhost, localhost.localdomain
relayhost =
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
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
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_use_tls = yes
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_overquota_bounce = yes
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
content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings
someone who knows what the problem is?
sorry for my bad english! :p

k1piee 25th September 2006 11:24

i don't understand why I get this error:

Quote:

Sep 24 21:46:10 server1 postfix/proxymap[10120]: warning: connect to mysql server 127.0.0.1: Can't connect to MySQL server on '127.0.0.1' (111)
Sep 24 21:46:10 server1 postfix/proxymap[10120]: warning: connect to mysql server 127.0.0.1: Can't connect to MySQL server on '127.0.0.1' (111)
becuse i can connect to mysql whith phpmyadmin
and the password are right in the mysql-virtual_domains.cf and the other files,
someone please help me!! I need to get my mail-server up running as soon as possible!!!

falko 25th September 2006 14:30

What's the output of
Code:

netstat -tap
?

k1piee 25th September 2006 14:36

here is my netstat -tap:
Quote:

Dad3L:~# netstat -tap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:glftpd *:* LISTEN 5206/inetd
tcp 0 0 localhost.localdo:10024 *:* LISTEN 18214/amavisd (mast
tcp 0 0 localhost.localdo:10025 *:* LISTEN 19969/master
tcp 0 0 *:ftp *:* LISTEN 10245/proftpd: (acc
tcp 0 0 *:smtp *:* LISTEN 19969/master
tcp6 0 0 *:imaps *:* LISTEN 18094/couriertcpd
tcp6 0 0 *:pop3s *:* LISTEN 18010/couriertcpd
tcp6 0 0 *:pop3 *:* LISTEN 19796/couriertcpd
tcp6 0 0 *:imap2 *:* LISTEN 19811/couriertcpd
tcp6 0 0 *:www *:* LISTEN 7705/apache2
tcp6 0 0 *:ssh *:* LISTEN 1997/sshd
tcp6 0 0 *:smtp *:* LISTEN 19969/master
tcp6 0 0 *:https *:* LISTEN 7705/apache2
tcp6 0 0 ::ffff:192.168.0.4:ssh ::ffff:192.168.0.:39888 ESTABLISHED18339/sshd: k1piee
Dad3L:~#
I see that mysql isn't there!
but what should I do to get it working?

k1piee 25th September 2006 15:41

i've got mysql working proporly now, i think :p
but now i get this in tunderbird when i try to update my mail:

Sending of password did not succseed. Mail server Dad3L.org responded: Maildir: No such file or directory.

whats wrong now?

k1piee 25th September 2006 15:57

haha, i can send mail without a problem, but when i recive i mail, its not in /home/vmail, its in /var/mail/k1piee.

this is my main.cf :

Quote:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

myhostname = Dad3L.org
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = Dad3L.org, localhost, localhost.localdomain
relayhost =
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps =mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_use_tls = yes
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
transport_maps = mysql:/etc/postfix/mysql-virtual_transports.cf
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_overquota_bounce = yes
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
content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings
i tought that virtual_mailbox_base = /home/vmail put the mail in "/home/vmail" but apperently not!
any idea what i should do?

k1piee 25th September 2006 20:44

isn't there anyone who can help me?
please, I need to get this working!
the only problem now is that the mails i receive is in /var/mail/<user>
and not in /home/vmail/<domain-name>/...and so on.
here is som files you can take o look at if you want, and maybe can find the problem!
main.cf
master.cf
mysql-virtual_domains.cf
mysql-virtual_email2email.cf
mysql-virtual_forwardings.cf
mysql-virtual_mailboxes.cf
mysql-virtual_mailbox_limit_maps.cf
mysql-virtual_transports.cf
authmysqlrc

k1piee 26th September 2006 00:22

never mind! got the shit worikng now :D
apparently i couldn't have "mydestination" and "virtual_alias_domains" as the same value or something, so I change "mydestination" and now it works just fine :D

tommytomato 26th September 2006 03:46

Quote:

Originally Posted by k1piee
never mind! got the shit worikng now :D
apparently i couldn't have "mydestination" and "virtual_alias_domains" as the same value or something, so I change "mydestination" and now it works just fine :D

thats what I get in my log as well "mydestination" and "virtual_alias_domains"

my log errors are like so, /var/log/mail.err

Code:

Sep 25 14:48:16 localhost courierpop3login: LOGIN FAILED, ip=[::ffff:192.168.1.7]
Sep 25 15:05:48 localhost dccproc[20028]: socket(UDP): Address family not supported by protocol

/var/log/mail.warn
Code:

Sep 26 00:40:29 localhost postfix/trivial-rewrite[20927]: warning: do not list domain rockinghamgateway.com in BOTH mydestination and virtual_mailbox_domains
/etc/postfix/mail.cf
Code:

recipient_delimiter = +
inet_interfaces = all
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
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_use_tls = yes
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_overquota_bounce = yes
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
content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings

How do I correct the prolbem :confused:

TT

falko 26th September 2006 18:20

Have a look here: http://www.howtoforge.com/forums/sho...7&postcount=12


All times are GMT +2. The time now is 23:55.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.