Problems with postfix-mysql

Discussion in 'Installation/Configuration' started by Pelle, Nov 6, 2005.

Thread Status:
Not open for further replies.
  1. oaky

    oaky New Member

    I tried it also with "MYSQL_SERVER". Do I have to restart any program?
    MYSQL_SERVER localhost
    MYSQL_USERNAME mail_admin
    MYSQL_PASSWORD #######
    MYSQL_HOME_FIELD "/home/vmail"

    # The authentication modules that are linked into authdaemond.  The
    # default list is installed.  You may selectively disable modules simply
    # by removing them from the following list.  The available modules you
    # can use are: authcustom authcram authuserdb authldap authmysql authpam
  2. till

    till Super Moderator

    Please check the courier config files if you have any whitespces behind the values. Courier is very picky with that. I had this in one setup and searched for hours until i found the whitespace... Most other programs are ignoring whitespaces behind values in config files.


    This will work:

    MYSQL_USERNAME mail_admin

    This wont work:

  3. falko

    falko Super Moderator

    /etc/init.d/courier-authdaemon restart
    Is the uid/gid of user/group vmail really 5000?
  4. oaky

    oaky New Member

    I had whitespaces after mail_admin and password. :eek:

    ...but nothing has changed, do I have to restart any program?
  5. till

    till Super Moderator

    Yes. Go to /etc/init.d/ and restart everything with courier in the name.
  6. oaky

    oaky New Member

    Thank you, that was one problem! :)

    But now I get:

    "Unable to open the maildir for this account -- the maildir doesn't exist or has incorrect ownership or permissions."

    I will search for this problem in the forum.... :confused:
  7. falko

    falko Super Moderator

    When does it happen? When you send an email to that account, or when you try to fetch emails with POP3/IMAP? In the latter case you first have to send an email to the account in question - the Maildir will then be created.
  8. oaky

    oaky New Member

    It happens when I want to fetch emails with sqwebmail.

    I wrote allready an email to this account.

    Should there be a folder in /home/vmail ? Because there is no folder.

    Is there a log where I can see if the mail has arrived at my mailserver because I get no "undeliverable" message from my provider.

    Nov 10 10:04:00 m34s12 courierpop3login: LOGIN FAILED, ip=[::ffff:]
    Nov 10 10:04:09 m34s12 courierpop3login: LOGIN FAILED, ip=[::ffff:]
    Nov 10 10:05:25 m34s12 last message repeated 2 times
    Nov 10 10:06:07 m34s12 postfix/trivial-rewrite[24810]: warning: do not list domain in BOTH mydestination and virtual_mailbox_domains
    Last edited: Nov 10, 2005
  9. falko

    falko Super Moderator

    Yes, /var/log/mail.log.

    You have in both mydestination and in the domains table in the database. Remove it from one of them and restart Postfix!
  10. oaky

    oaky New Member

    I removed it and restarted postfix...


    Nov 10 10:48:16 m34s12 postfix/smtpd[1789]: connect from[]
    Nov 10 10:48:16 m34s12 postfix/smtpd[1789]: 2B590333D5:[]
    Nov 10 10:48:16 m34s12 postfix/cleanup[1797]: 2B590333D5: message-id=<>
    Nov 10 10:48:16 m34s12 postfix/qmgr[1702]: 2B590333D5: from=<>, size=1030, nrcpt=1 (queue active)
    Nov 10 10:48:16 m34s12 postfix/qmgr[1702]: 2B590333D5: to=<>, relay=none, delay=0, status=deferred (delivery temporarily suspended: connect to[]: server dropped connection without sending the initial SMTP greeting)
    Nov 10 10:48:16 m34s12 postfix/smtpd[1789]: disconnect from[]
  11. Pelle

    Pelle New Member


    Thank you very much for the help here! I cant explain the problem, but the solution have been:

    Have seperate users for the database and restart!

    Of some reason it helped when I created a new user!

    I found that, because of some mistake when editing some of the mysql*.cf files I removed the user line! and then the /var/log/mail.log told me that it was the wrong username and password?!

    And now my mail server works! thank you for the help!

    NOTE! The user for the database I first used worked well and is still in use now, just only for pureftpd-mysql!
  12. gus

    gus New Member

    same problem, distinct solution

    Hi all

    I've a Debian sarge testing server (i'd tried with stable too) and a month ago i'd to reinstall, but the server never was the same :(

    in the past I was running with courier+postfix+mysql but at reinstallation i've the same error every time i try to connect via smtp (courier pop & imap are ok):

    Nov <timestamp> lared postfix/trivial-rewrite[9542]: fatal: mysql:/etc/postfix/,100): table lookup problem
    i've tried using mysql 4.1 and 5.0 (i don't remember what version of mysql-server was running before), it's all ok, all users, all passwords... i tried with root user too!!

    any idea??
  13. falko

    falko Super Moderator

    Make sure that the MySQL user and password are correct. Which Postfix version do you use? Run
    postconf -d | grep mail_version
    to find that out.
  14. gus

    gus New Member

    postfix version

    server:/etc/postfix# postconf -d | grep mail_version
    mail_version = 2.2.4
    user & passwords are ok, i'd tryed loggin directly too:
    server:/etc/postfix# mysql -u <user>
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 101 to server version: 5.0.13-rc-Debian_1-log
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
  15. falko

    falko Super Moderator

  16. gus

    gus New Member

    postfix file config contents:
    user = [I]<user_name>[/I]
    password = [I]-> I left blank password while errors[/I]
    dbname = maildb
    table = virtual
    select_field = goto
    where_field = address
    hosts = [I]server[/I]
    server = computer name = LAN IP Address... don't rules with localhost and too

    My virtual table is:
    CREATE TABLE virtual (
    address varchar(255) NOT NULL default '',
    goto varchar(255) NOT NULL default '',
    UNIQUE KEY address (address)
    ) TYPE=MyISAM;
    My guide to config was this (in spanish): that i got from

    My server was running with sarge testing from june to october (postfix was running perfect), stable in october (problems) and testing again three weeks ago (still having problems)

    Now... How we name the baby?
    Last edited: Nov 12, 2005
  17. falko

    falko Super Moderator

    Try this in your

    user = <user_name>
    password = <password>
    hosts = server
    dbname = maildb
    query = SELECT goto FROM virtual WHERE address='%s'
    and restart Postfix.
  18. gus

    gus New Member

    a great amount of shit

    nothing happens

    the problem is there yet

    no incoming / outgoing mail throught postfix :(

    I should change all .cf files 'cause all appears at /var/log/mail.err with a "table lookup problem" message

    I think the problem isn't in postfix configuration, is in the postfix-mysql connector.

    how could I downgrade postfix with aptitude?

    thanks for your help
  19. falko

    falko Super Moderator

    I don't think it's a problem with the Postfix package (your Postfix package is from testing, not unstable), but rather with the configuration.
    Did you have a look at this tutorial:
  20. gus

    gus New Member


    I'll read it tomorrow after job...

Thread Status:
Not open for further replies.

Share This Page