LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-31-2012, 11:07 PM   #1
Vimuth
Member
 
Registered: Sep 2009
Posts: 59

Rep: Reputation: 15
postfix+mysql+dovecot mail server thunderbird clinet configuration issue


With much attempt I set up my very first mailserver postfix+mysql+dovecot mail server with virtual users/domains support. However when I tried to configure the thundirbird mail client for a valid user account it denies the password provided in the mysql database.

below is the log extract.
Code:
Dec 31 21:46:49 box1 dovecot: config: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:31: userdb static {} has been replaced by userdb { driver=static }
Dec 31 21:46:49 box1 dovecot: pop3-login: Aborted login (no auth attempts): rip=192.168.1.14, lip=192.168.1.68, mpid=0
Dec 31 21:46:49 box1 dovecot: imap-login: Aborted login (no auth attempts): rip=192.168.1.14, lip=192.168.1.68, mpid=0
Dec 31 21:46:49 box1 dovecot: imap-login: Disconnected (no auth attempts): rip=192.168.1.14, lip=192.168.1.68, mpid=0
Dec 31 21:46:49 box1 dovecot: pop3-login: Disconnected (no auth attempts): rip=192.168.1.14, lip=192.168.1.68, mpid=0
Dec 31 21:46:49 box1 postfix/smtpd[6005]: connect from unknown[192.168.1.14]
Dec 31 21:46:49 box1 postfix/smtpd[6005]: improper command pipelining after EHLO from unknown[192.168.1.14]
Dec 31 21:46:49 box1 postfix/smtpd[6005]: disconnect from unknown[192.168.1.14]
Dec 31 21:46:49 box1 postfix/smtpd[6005]: connect from unknown[192.168.1.14]
Dec 31 21:46:49 box1 postfix/smtpd[6005]: lost connection after CONNECT from unknown[192.168.1.14]
Dec 31 21:46:49 box1 postfix/smtpd[6005]: disconnect from unknown[192.168.1.14]
Dec 31 21:46:53 box1 dovecot: auth: Error: mysql: Connect failed to 192.168.1.68 (mail): Host 'box1' is not allowed to connect to this MySQL server - waiting for 1 seconds before retry
Dec 31 21:46:56 box1 postfix/proxymap[6010]: warning: connect to mysql server 192.168.1.68: Host 'box1' is not allowed to connect to this MySQL server
Dec 31 21:46:56 box1 postfix/trivial-rewrite[6018]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
Dec 31 21:46:57 box1 postfix/qmgr[5979]: warning: problem talking to service rewrite: Success
Dec 31 21:46:57 box1 postfix/master[5976]: warning: process /usr/libexec/postfix/trivial-rewrite pid 6018 exit status 1
Dec 31 21:46:57 box1 postfix/master[5976]: warning: /usr/libexec/postfix/trivial-rewrite: bad command startup -- throttling
^C
following is my server setup
mail server - box1.mydomain.rock(192.168.1.68)
client machine - vimut-lap.mydomain.rock(192.168.1.14)

following is my main.cf file
Code:
myhostname = box1.mydomain.rock
mynetworks = 192.168.1.0/24
message_size_limit = 30720000
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_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_use_tls = yes
smtpd_tls_cert_file = /etc/pki/dovecot/certs/dovecot.pem
smtpd_tls_key_file = /etc/pki/dovecot/private/dovecot.pem
virtual_create_maildirsize = yes
virtual_maildir_extended = 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
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
following is my dovecot.conf
Code:
protocols = imap imaps pop3 pop3s
log_timestamp = "%Y-%m-%d %H:%M:%S "
mail_location = maildir:/home/vmail/%d/%n/Maildir

ssl_cert_file = /etc/pki/dovecot/certs/dovecot.pem
ssl_key_file = /etc/pki/dovecot/private/dovecot.pem

namespace private {
    separator = .
    prefix = INBOX.
    inbox = yes
}

protocol lda {
    log_path = /home/vmail/dovecot-deliver.log
    auth_socket_path = /var/run/dovecot/auth-master
    postmaster_address = postmaster@mydomain.rock
}

protocol pop3 {
    pop3_uidl_format = %08Xu%08Xv
}

auth default {
    user = root

    passdb sql {
        args = /etc/dovecot-sql.conf
    }

    userdb static {
        args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes
    }

    socket listen {
        master {
            path = /var/run/dovecot/auth-master
            mode = 0600
            user = vmail
        }

        client {
            path = /var/spool/postfix/private/auth
            mode = 0660
            user = postfix
            group = postfix
        }
    }
}
following is my /etc/postfix/mysql-virtual_domains.cf
Code:
user = mail_admin
password = redhat
dbname = mail
query = SELECT domain AS virtual FROM domains WHERE domain='%s'
hosts = 127.0.0.1
following is my /etc/postfix/mysql-virtual_mailboxes.cf
Code:
user = mail_admin
password = redhat
dbname = mail
query = SELECT CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') FROM users WHERE email='%s'
hosts = 127.0.0.1
following is the extract of my user table
Code:
mysql> use mail
Database changed
mysql> show tables;
+----------------+
| Tables_in_mail |
+----------------+
| domains        |
| forwardings    |
| transport      |
| users          |
+----------------+
4 rows in set (0.00 sec)

mysql> select * from users;
+-------------------+---------------+
| email             | password      |
+-------------------+---------------+
| dee@mydomain.rock | pfJ2wkhf0X8tM |
+-------------------+---------------+
Please can any one of you find something from the info provided above. Please note that I used mutt and read the mails sent by a different user and it worked. Following is the approch taken for that.

Code:
mutt -f /home/vmail/mydomain.rock/dee/Maildir/
PS:No IPTABLES and SeLINUX implementations are in place.

/V
 
Old 01-01-2013, 08:16 AM   #2
fenice
Member
 
Registered: Apr 2006
Distribution: CentOS openSUSE
Posts: 55

Rep: Reputation: 9
If your server has the resources why don't you look at installing the Open Source version of Zimbra, it's easy to install and maintain and has a nice GUI (IMO) with collaboration functions should you nedd them.
 
Old 01-01-2013, 08:39 AM   #3
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
You don't provide sufficient information. If you expect help, you have to start by providing information. You don't mention your program versions, distro and version and which configuration guides you used.

My first guess from the first line in the first log is that you use Dovecot 2.0 and configurations for Dovecot 1.x. Especially in the db drivers syntax there has been a lot of incompatible changes.

Check this web site: http://workaround.org/ispmail/squeeze
I can guarantee this works as advertized, but for Dovecot 1.x. When you go thru the various pages you'll see other users with problems using Dovecot 2.0 as well and pointers to solutions.

In case you are using Debian Wheezy there is an error in one of the config file (*.conf) for Dovecot. A missing '}' IIRC. You have to start Dovecot from the command line to see it.

I also see that you have a problem accessing the mysql database. IIRC that has something to do with Dovecot trying to access the database from 'localhost' instead of '127.0.0.1'. That is very different. As workaround you can grant access to both '127.0.0.1' and 'localhost' to see if that is the problem.

I can't post the contents of my Dovecot 2.0 files, I got it working but I suspended the server temporarily and I cannot access it.

jlinkels

Last edited by jlinkels; 01-01-2013 at 08:44 AM.
 
Old 01-02-2013, 12:39 AM   #4
Vimuth
Member
 
Registered: Sep 2009
Posts: 59

Original Poster
Rep: Reputation: 15
Thank you very much Jinnkles for your concerns. Server OS is RHEL6. n the thunderbird configuration has been tried out on Ubuntu 12.04 which is my desktop.


Thank you very much Fenice, yes I have been considering about zimbra since supposedly it is much pain free. However I still like to get postfix going too for some reason. so appreciate any help provided cos Im sure that Im almost there.

/V
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
postfix+mysql+dovecot mail server thunderbird clinet configuration issue Vimuth Linux - Newbie 2 01-01-2013 04:17 AM
simple mail server issue postfix/dovecot Gil@LQ Linux - Newbie 13 12-04-2011 10:32 PM
Mail server issues (Postfix, MySQL, Dovecot) manijeee Linux - Server 0 08-03-2009 02:38 AM
Postfix/Dovecot - thunderbird queries server fine but finds no mail sneakyimp Linux - Server 1 10-24-2007 07:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration