Virtual Users And Domains With Postfix, Courier And MySQL (Ubuntu 7.10)

Discussion in 'HOWTO-Related Questions' started by Merrigan, Dec 6, 2007.

  1. Merrigan

    Merrigan New Member

    HI All,

    I have been following this HOWTO for the better part of my day.

    Everything went perfectly according to the howto, except that it could not log into the MySQL server. I changed it all - and it seems to be working more than just a little bit perfectly now.

    The Problem is the following:

    I am unable to send mail to any local user on the machine itself - Thunderbird reports no errors, but my mail log spits out the following:

    Code:
    Dec  6 12:30:51 ubuntuer postfix/smtpd[4894]: connect from unknown[192.168.0.15]
    Dec  6 12:30:51 ubuntuer postfix/smtpd[4894]: DA2A21F36A9: client=unknown[192.168.0.15], sasl_method=PLAIN, sasl_username=merrigan@lewendewoord.co.za
    Dec  6 12:30:51 ubuntuer postfix/cleanup[4898]: DA2A21F36A9: message-id=<4757CFBE.5030005@lewendewoord.co.za>
    Dec  6 12:30:51 ubuntuer postfix/qmgr[4657]: DA2A21F36A9: from=<merrigan@lewendewoord.co.za>, size=544, nrcpt=2 (queue active)
    Dec  6 12:30:52 ubuntuer postfix/smtpd[4894]: disconnect from unknown[192.168.0.15]
    Dec  6 12:30:52 ubuntuer postfix/smtpd[4901]: connect from localhost[127.0.0.1]
    Dec  6 12:30:52 ubuntuer postfix/smtpd[4901]: 1179F1F36AA: client=localhost[127.0.0.1]
    Dec  6 12:30:52 ubuntuer postfix/cleanup[4898]: 1179F1F36AA: message-id=<4757CFBE.5030005@lewendewoord.co.za>
    Dec  6 12:30:52 ubuntuer postfix/qmgr[4657]: 1179F1F36AA: from=<merrigan@lewendewoord.co.za>, size=896, nrcpt=2 (queue active)
    Dec  6 12:30:52 ubuntuer postfix/trivial-rewrite[4914]: warning: do not list domain lewendewoord.co.za in BOTH mydestination and virtual_mailbox_domains
    Dec  6 12:30:52 ubuntuer postfix/trivial-rewrite[4914]: warning: do not list domain lewendewoord.co.za in BOTH mydestination and virtual_mailbox_domains
    Dec  6 12:30:52 ubuntuer postfix/local[4917]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
    Dec  6 12:30:52 ubuntuer postfix/smtpd[4901]: disconnect from localhost[127.0.0.1]
    Dec  6 12:30:52 ubuntuer amavis[4021]: (04021-05) Passed CLEAN, LOCAL [192.168.0.15] [192.168.0.15] <merrigan@lewendewoord.co.za> -> <merrigan@lewendewoord.co.za>,<wimmel@lewendewoord.co.za>, Message-ID: <4757CFBE.5030005@lewendewoord.co.za>, mail_id: DbZm8+wFUp4E, Hits: -, queued_as: 1179F1F36AA, 205 ms
    Dec  6 12:30:52 ubuntuer postfix/smtp[4899]: DA2A21F36A9: to=<merrigan@lewendewoord.co.za>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.29, delays=0.08/0/0.01/0.21, dsn=2.6.0, status=sent (250 2.6.0 Ok, id=04021-05, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 1179F1F36AA)
    Dec  6 12:30:52 ubuntuer postfix/smtp[4899]: DA2A21F36A9: to=<wimmel@lewendewoord.co.za>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.29, delays=0.08/0/0.01/0.21, dsn=2.6.0, status=sent (250 2.6.0 Ok, id=04021-05, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 1179F1F36AA)
    Dec  6 12:30:52 ubuntuer postfix/qmgr[4657]: DA2A21F36A9: removed
    Dec  6 12:30:52 ubuntuer postfix/local[4902]: 1179F1F36AA: to=<merrigan@lewendewoord.co.za>, relay=local, delay=0.12, delays=0.04/0/0/0.07, dsn=5.1.1, status=bounced (unknown user: "merrigan")
    Dec  6 12:30:53 ubuntuer postfix/local[4917]: 1179F1F36AA: to=<wimmel@lewendewoord.co.za>, relay=local, delay=1.3, delays=0.04/0.02/0/1.2, dsn=5.1.1, status=bounced (unknown user: "wimmel")
    Dec  6 12:30:53 ubuntuer postfix/cleanup[4898]: 558771F36A9: message-id=<20071206103053.558771F36A9@lewendewoord.co.za>
    Dec  6 12:30:53 ubuntuer postfix/qmgr[4657]: 558771F36A9: from=<>, size=2953, nrcpt=1 (queue active)
    Dec  6 12:30:53 ubuntuer postfix/trivial-rewrite[4914]: warning: do not list domain lewendewoord.co.za in BOTH mydestination and virtual_mailbox_domains
    Dec  6 12:30:53 ubuntuer postfix/bounce[4903]: 1179F1F36AA: sender non-delivery notification: 558771F36A9
    Dec  6 12:30:53 ubuntuer postfix/qmgr[4657]: 1179F1F36AA: removed
    Dec  6 12:30:53 ubuntuer postfix/local[4902]: 558771F36A9: to=<merrigan@lewendewoord.co.za>, relay=local, delay=0.04, delays=0.02/0/0/0.02, dsn=5.1.1, status=bounced (unknown user: "merrigan")
    Dec  6 12:30:53 ubuntuer postfix/qmgr[4657]: 558771F36A9: removed
    
    This server is only for testing the HOWTO, and is luckily not the production one.

    Also - I am unable to send any mail to any user outside of the domain, which is weird as well - since I set the transport table with the following:

    Code:
    +--------------------+------------------------------+
    | domain             | transport                    |
    +--------------------+------------------------------+
    | lewendewoord.co.za | :                            | 
    | *                  | smtp:mail.lewendewoord.co.za | 
    +--------------------+------------------------------+
    
    Any help would be much appreciated?

    Thanx a LOT!
     
  2. Tashio

    Tashio New Member

    Hey Merrigan

    Dec 6 12:30:52 ubuntuer postfix/trivial-rewrite[4914]: warning: do not list domain lewendewoord.co.za in BOTH mydestination and virtual_mailbox_domains

    This line is one of the culprits, I have had the same problem for last day or two just fixed it now.

    in /etc/postfix/main.cf you probably have

    mydestination = lewendewoord.co.za, localhost, localhost.localdomain

    change this to
    mydestination = SERVERNAME , localhost, localhost.localdomain

    so if your server is called myserver then insert myserver where SERVERNAME is.

    Tashio
     
  3. Merrigan

    Merrigan New Member

    Hey,

    Thanks a lot tashio, It has fixed the internal issue - now to get the mail sent externally :p
     
    Last edited: Dec 6, 2007
  4. Tashio

    Tashio New Member

    Yea I'm still getting relay access denied errors when trying to send email to external addresses but my current main problem is I can't logon to the pop3 server, for some reason getting access denied on the authdaemond. I've checked all the files that contain user/password information for connecting to the sql server but it's still throwing it out.

    authdaemond: failed to connect to mysql server (server=localhost, userid=mail_admin): Access denied for user 'mail_admin'@'localhost' (using password: YES)
     
  5. Merrigan

    Merrigan New Member

    Mine did that as well - and I suspect it is a user setup issue - try using your root username and PW - i did that and Mine is now working. I'll try and figure out the REAL issue - I just wanted to check where the problem was ;)
     
  6. Tashio

    Tashio New Member

    Found the login problem, you need to go back and check all the /etc/postfix/mysql_virtual.*.cf files make sure that there is NO space after the username and password, IE the cursor stops at the last letter of the user/pass, for some reason vi puts a space as soon as you finish a word and escape out, so odds are there is a space after user or password
    also need to check

    /etc/pam.d/smtp
    and the primary culprit

    /etc/courier/authmysqlrc

    Now to get external mail going out.

    EDIT: External Working, you need to set your mail client to authenticate for SMTP
     
    Last edited: Dec 6, 2007
  7. Merrigan

    Merrigan New Member

    I Did that, but it's not working. I can send mail to any of the mailboxes I created on the machine, but not outside the machine to for instance my GMail account...
     
  8. Merrigan

    Merrigan New Member

    Ok...

    I got the mail sending outward much better so far, sometimes it's successful - sometimes not - but I think It's a remote smtp server issue.

    I was wondering whether anyone knows how to setup fetchmail to deliver mail into a virtual user inbox. I used the normal one that delivers into the home directories and it didn't work - how does one setup it to deliver into the virtual box?

    Thanx all!!!
     
  9. Tashio

    Tashio New Member

    What is the error message you'r getting when you try send external?
     
  10. Merrigan

    Merrigan New Member

    Well To me it seems to have been A DNS Server issue. I put the mail server's IP in the transport into [square brackets] and all is well now, sending like mad.

    Does anyone know how to make fetchmail or anything else for that matter, drop mail into the virtual mailbox?

    Thanx all!
     

Share This Page