Bugs item #1783149, was opened at 2007-08-28 09:17
Message generated for change (Settings changed) made by michaelbeiter
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: Michael Beiter (michaelbeiter)
Date: 2007-10-08 06: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 19: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
|