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 127.0.0.1". Do I have to restart any program?
    Code:
    MYSQL_SERVER localhost
    MYSQL_USERNAME mail_admin
    MYSQL_PASSWORD #######
    MYSQL_PORT 0
    MYSQL_DATABASE mail
    MYSQL_USER_TABLE users
    MYSQL_CRYPT_PWFIELD password
    #MYSQL_CLEAR_PWFIELD password
    MYSQL_UID_FIELD 5000
    MYSQL_GID_FIELD 5000
    MYSQL_LOGIN_FIELD email
    MYSQL_HOME_FIELD "/home/vmail"
    MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
    #MYSQL_NAME_FIELD
    MYSQL_QUOTA_FIELD quota


    Code:
    #
    # 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
    
    authmodulelist="authmysql"
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    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.

    Example:

    This will work:

    MYSQL_USERNAME mail_admin

    This wont work:

    MYSQL_USERNAME mail_admin[WHITESPACE]
     
  3. falko

    falko Super Moderator ISPConfig Developer

    Yes:
    Code:
    /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 Staff Member ISPConfig Developer

    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 ISPConfig Developer

    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.

    Code:
    Nov 10 10:04:00 m34s12 courierpop3login: LOGIN FAILED, ip=[::ffff:62.47.184.28]
    Nov 10 10:04:09 m34s12 courierpop3login: LOGIN FAILED, ip=[::ffff:62.47.184.28]
    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 m34s12.vlinux.de in BOTH mydestination and virtual_mailbox_domains
    
     
    Last edited: Nov 10, 2005
  9. falko

    falko Super Moderator ISPConfig Developer

    Yes, /var/log/mail.log.

    You have m34s12.vlinux.de 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...

    mail.log

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

    Pelle New Member

    Hey!

    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):

    Code:
    Nov <timestamp> lared postfix/trivial-rewrite[9542]: fatal: mysql:/etc/postfix/virtual.cf(0,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 ISPConfig Developer

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

    gus New Member

    postfix version

    Code:
    server:/etc/postfix# postconf -d | grep mail_version
    mail_version = 2.2.4
    user & passwords are ok, i'd tryed loggin directly too:
    Code:
    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.
    
    mysql>
     
  15. falko

    falko Super Moderator ISPConfig Developer

  16. gus

    gus New Member

    postfix file config

    virtual.cf contents:
    Code:
    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 127.0.0.1 too

    My virtual table is:
    Code:
    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): http://lared.dsland.org/tmp/Postfix%20Courier%20y%20MySQL%20.txt that i got from http://valenciawireless.net/weblog/vw/staticpages/index.php?page=2003062417002455

    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 ISPConfig Developer

    Try this in your virtual.cf:

    Code:
    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 mess

    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 ISPConfig Developer

    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: http://www.howtoforge.com/virtual_postfix_mysql_quota_courier?
     
  20. gus

    gus New Member

    thanks

    I'll read it tomorrow after job...

    thanks
     
Thread Status:
Not open for further replies.

Share This Page