[ postfixadmin-Bugs-1783149 ] Username in maildir path is not converted to lowercase
Brought to you by:
christian_boltz,
gingerdog
From: SourceForge.net <no...@so...> - 2007-10-08 11:53:32
|
Bugs item #1783149, was opened at 2007-08-28 11:17 Message generated for change (Comment added) made by christian_boltz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937964&aid=1783149&group_id=191583 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Core Group: None Status: Closed Resolution: Fixed Priority: 5 Private: No Submitted By: Michael Beiter (michaelbeiter) Assigned to: Nobody/Anonymous (nobody) Summary: Username in maildir path is not converted to lowercase Initial Comment: The entered username is not converted to lowercase in the maildir when adding a new mailbox. If the username is entered as i.e. Te...@do...valid, the resulting username (for login) will be te...@do...valid, what is correct. When the maildir is chosen to be made up of domain and username, it will result as domain.invalid/TeST - what is incorrect, as at least maildrop in my setup won't be able to deliver mails: it expects domain.invalid/test as maildir (what is only consequent). The fix is easy, it is sufficient to add a "strtolower" function call at the appropriate lines: admin/create-mailbox.php 143c143 < $maildir = $fDomain . "/" . escape_string ($_POST['fUsername']) . "/"; --- > $maildir = $fDomain . "/" . strtolower(escape_string ($_POST['fUsername'])) . "/"; create-mailbox.php 154c154 < $maildir = $fDomain . "/" . escape_string ($_POST['fUsername']) . "/"; --- > $maildir = $fDomain . "/" . strtolower(escape_string ($_POST['fUsername'])) . "/"; ---------------------------------------------------------------------- >Comment By: Christian Boltz (christian_boltz) Date: 2007-10-08 13:53 Message: Logged In: YES user_id=593261 Originator: NO > Probably you didn't expect these difficulties because you use the > alternative maildir structure (domain_in_mailbox==YES [...] I use the same setting as you do and even tested it: the maildir is created with uppercase letters. However this didn't matter on my system because maildrop reads the maildir from the database itsself ("WHERE username=...") instead of using the value it got from postfix. I tested: - delivery with postfix / maildrop - fetching mails with courier and everything worked with the uppercase maildir name. ---------------------------------------------------------------------- Comment By: Michael Beiter (michaelbeiter) Date: 2007-10-08 08:46 Message: Logged In: YES user_id=76720 Originator: YES Regarding my maildroprc: I used the username and domainname as provided by the database to create the maildirs. However, postfix always provides lowercase credentials when it delivers a mail to maildrop. Probably you didn't expect these difficulties because you use the alternative maildir structure (domain_in_mailbox==YES, what actually is the default IIRC). This results in using $fUsername on which a strtolower is applied in an earlier step somewhere around line 80. Unfortunately, at that place $fUsername ist tainted with the domain name, what requires using the POST-variable as described to restore $fUsername to its original value. In other words: I could use a strtolower when creating the maildir in my maildroprc. However, this could lead to inconsistencies in other applications. As imlemented by postfixadmin in the alternative maildir structure, user- and domainnames should be lowercase - and that's why I reported :-) HTH, Michael ---------------------------------------------------------------------- Comment By: Christian Boltz (christian_boltz) Date: 2007-10-07 21:52 Message: Logged In: YES user_id=593261 Originator: NO Just curious: How does your maildroprc look like? (I'm also using maildrop and using uppercase mailbox names works without problems.) Anyway: Your change won't do any harm or backwards compatibility issues (because it only affects creation of new mailboxes). I just applied your patch to create-mailbox.php in the SVN. Thanks for reporting this! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937964&aid=1783149&group_id=191583 |