die musterdenker

Pitfalls with postfix smpt and db auth

TAGS: None

Now its running! a postfix with courier and sasl on my ubunto server having virtual users stored in a mysql. Regarding the tutorials you can find (e.g. this is a good one in german) it doesn’t seem to be complicated, but just a lot of work. But I had two BIG problems during configuration. Happily I managed to solve them both:

1. After setting up everything I got the error: “pam_mysql – required option “db” is not set”  when trying to send mails. This was very strange as this parameter is not needed and was also not mentioned in any tutorial. After longer research using my big friend (brother?!) google, I realized that my mysql user had a password that contained a “#” which is a illigeal character! Nice error message I have to say :( Somehow the “#” is a character that stops the evaluation of password string. I don’t know if other special chars are also a problem, my password it now only “normal” charecters.

2. My users all had a username like user@domain unfortunately courier does NOT support that type of username. Whenever I tried smpt from my mail client he cut of the “@domain” part and looked up the “user” in my db. One possibility would have been to switch to dovecot which “seems” to support this type of names (howto), but I didn’t want to. Also changin all my users for some different login name was not a solution as I allready had the whole structure of my mail dir like “/domain/user”. So I decided to map the “@” in my usernames to a “#”. Now my user names are like user#domain and still all the mapping to the folders “domain/user” is done. All I had to do was changing

“authmysqlrc” (for outgoing) :

MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,’#',-1),’/',SUBSTRING_INDEX(email,’#',1),’/')

and “mysql-virtual-mailboxes.cf (which contains the mapping on my machine) (for incoming)

query = SELECT CONCAT(SUBSTRING_INDEX(email,’#',-1),’/',SUBSTRING_INDEX(email,’#',1),’/') FROM users WHERE email=REPLACE(’%s’,'@’,'#’)

Now it works … if all I did was bullshit and could have been done in a nicer way, please leave a comment.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • BlinkList
  • LinkedIn
  • MisterWong
  • MySpace
  • Netvibes
  • NewsVine
  • Reddit
  • StumbleUpon
  • Technorati
  • Yahoo! Bookmarks
  • Yahoo! Buzz
  • Yigg

TAGS: None

9 Responses to “Pitfalls with postfix smpt and db auth”


  1. chiffon bridesmaid dresses
    on Jul 26th, 2011
    @ 10:51

    Choose the most suitable and elegant always means texting all the designer bridal showed at this century, and in recent years viewing all different and nice design is acceptable on the famous designers. Only after seeing all the designs that you will be able to make the final decision


  2. Mitchell And Ness Reggie White Jersey
    on Aug 13th, 2011
    @ 04:31

    colleague Mark Heligman keeping his calendar for which teams, clients,


  3. UGG Boots Outlet
    on Okt 28th, 2011
    @ 10:14

    I’ve realized I may have become slightly addicted to UGG boots.


  4. Mulberry Alexa bags chocolate sale
    on Nov 19th, 2011
    @ 08:53

    This bag is currently very in demand and are constantly sold out. The Alexa is both formal and casual, structured and relaxed.


  5. ugg boots clearance
    on Nov 21st, 2011
    @ 09:21

    FEWF56DJ6YEPPP25OF
    You Can Find the Discount Ugg Boots Online


  6. cheap oakley sunglasses
    on Dez 8th, 2011
    @ 09:26

    WMDSHHZSTZDDHZ
    It is amidst Ugg boot


  7. Canada Goose Jacket
    on Dez 26th, 2011
    @ 02:23

    For amplified than fifty countless years,Canada Goose Jacket has prolonged been producing genuine serious surroundings garments Canada Goose Expedition Parka profit founded up of concentrate on and function, Canada Goose Sale,


  8. fake uggs
    on Jan 11th, 2012
    @ 15:48

    Search having a full aside full end result within just in the web sites of the favorite tabloid cup of together with everyone happen to be readily certain to check for a large bunch of super stars owning a a couple of fake uggs. In a large amount cases, the needed among the kind routine with UGG bootsutilized by means of all these ladies will be the UGG Knightsbridge boot. This Knightsbridge is usually fake ugg boots conventional high form that sustains digits secure all of year sale paper.


  9. nike free
    on Jan 14th, 2012
    @ 04:26

    Thank you for sharing information about
    nike free run, which I learned a lot, but also know a lot of knowledge about
    Canada goose

Leave a Reply

© 2009 die musterdenker. All Rights Reserved.

This blog is powered by Wordpress and Magatheme by Bryan Helmig.