Menu

Mailbox path

wayne
2012-03-02
2013-01-23
  • wayne

    wayne - 2012-03-02

    hello world !!!

    I try to get PA to work, but there is a problem with the mailbox paths :
    $CONF = 'NO';
    $CONF = 'YES';

    should result in directories like /var/vmail/user@domain.tld, that´s what I want.
    But reality : domain.tld/user

    Already restarted Psotfix, MySQL, Apache, Dovecot and rebooted the system, but PA does not recognise any changes in
    config.inc.php  (identical in /etc/postfixadmin and /usr/share/postfixadmin)

     
  • Christian Boltz

    Christian Boltz - 2012-03-02

    The changed values in $CONF and $CONF are only used for new mailboxes that you create after the $CONF change.

    The maildir of existing mailboxes won't be changed when you change $CONF - otherwise those mailboxes would get broken (because PostfixAdmin can't rename the on-disk directories).

    If your problem also applies to newly created mailboxes, please show the database row of this mailbox from the mailbox table (except the password of course).

     
  • wayne

    wayne - 2012-03-05

    Just tries again, but it still does not work.
    Section of config.inc.php :

    // Mailboxes
    // If you want to store the mailboxes per domain set this to 'YES'.
    // Examples:
    //   YES: /usr/local/virtual/domain.tld/username@domain.tld
    //   NO:  /usr/local/virtual/username@domain.tld
    $CONF['domain_path'] = 'NO';
    // If you don't want to have the domain in your mailbox set this to 'NO'.
    // Examples:
    //   YES: /usr/local/virtual/domain.tld/username@domain.tld
    //   NO:  /usr/local/virtual/domain.tld/username
    // Note: If $CONF['domain_path'] is set to NO, this setting will be forced to YES.
    $CONF['domain_in_mailbox'] = 'YES';
    // If you want to define your own function to generate a maildir path set this to the name of the function.
    // Notes:
    //   - this configuration directive will override both domain_path and domain_in_mailbox
    //   - the maildir_name_hook() function example is present below, commented out
    //   - if the function does not exist the program will default to the above domain_path and domain_in_mailbox settings
    $CONF['maildir_name_hook'] = 'NO';
    

    Row in DB :

    | wayne10@test.padmin.<mydomain>.de | 43dd5461ea090b1115a4eaab4ee7c80e   | wayne | wayne10@test.padmin.<mydomain>.de@test.padmin.<mydomain>.de | 1048576000 | wayne10    | test.padmin.<mydomain>.de  | 2012-03-05 12:22:17 | 2012-03-05 12:22:17 |      1 |
    

    Path to generated Mailbox :

    /var/vmail/test.padmin.<mydomain>.de/
    

    For <mydomain> I have the real entry, of course.

    The 'maildir' in the DB looks a bit weird and does not fit the real value.

     
  • wayne

    wayne - 2012-03-05

    Solution is a bit closer now:

    Changed config.inc.php to use maildir_name_hook function.

    function maildir_name_hook($domain, $user) {
       return sprintf("%s%s",$user,'');
    }
    

    Now I get the correct maildir in the DB.
    The directories are created in the same form as mentioned above.
    Still need help on that.

     
  • Christian Boltz

    Christian Boltz - 2012-03-05

    Indeed, having the domain in the maildir twice (in your example "wayne10@test.padmin.<mydomain>.de@test.padmin.<mydomain>.de") looks really strange.

    It's good to know that you can workaround with a hook function, but that doesn't solve the problem ;-)
    Unfortunately I'm unable to reproduce the bug (with both 2.3.5 and SVN trunk). Reading the code also didn't bring up something that could cause this issue. In other words: I have no idea what happens in your case, which makes it quite difficult to reproduce and fix this bug :-(

    Which version do you use exactly?
    Did you install from the tarball, deb, rpm?
    Which $CONF settings did you change? (a diff against the original config.inc.php will answer this, and BTW, if you move your settings to config.local.php, updates will be easier)

    Just to be sure you aren't doing something strange - can you please describe step by step what you enter/select in the create-mailbox form?

    If nothing else helps, the good old way of adding some debug output (or error_log()ing) in create-mailbox.php might bring some insights. You should especially have a look at $maildir.

     
  • wayne

    wayne - 2012-03-06

    Step by step :

    Benutzername:          wayne26
    Passwort:                 wayne
    Passwort (nochmal): wayne
    Name: Voller Name  wayne
    Quota: 1000
    Aktiv: check
    Mailbox anlegen: check

    Version is now 2.3.5 (latest version) was 2.3.1 from deb-package.

    12c12
    <  * @version $Id: config.inc.php 828 2010-05-17 22:56:23Z christian_boltz $
    ---
    >  * @version $Id: config.inc.php 935 2011-01-02 21:33:13Z christian_boltz $
    26c26
    < $CONF['configured'] = true;
    ---
    > $CONF['configured'] = false;
    31c31
    < $CONF['setup_password'] = 'c8b50b1dc81568dfabbcc5b318eb7626:3a3f3d8820155f80fc2ad3ae1744ffb07c8e4765';
    ---
    > $CONF['setup_password'] = 'changeme';
    36c36
    < $CONF['postfix_admin_url'] = 'padmin.<mydomain>.de/padmin';
    ---
    > $CONF['postfix_admin_url'] = '';
    43c43
    < $CONF['default_language'] = 'de';
    ---
    > $CONF['default_language'] = 'en';
    49,50c49
    <
    < $CONF['database_type'] = 'mysqli';
    ---
    > $CONF['database_type'] = 'mysql';
    52,55c51,53
    < $CONF['database_user'] = 'postfixadmin';
    < $CONF['database_password'] = '<password>';
    < $CONF['database_name'] = 'postfixadmin';
    < $CONF['database_prefix'] = '';
    ---
    > $CONF['database_user'] = 'postfix';
    > $CONF['database_password'] = 'postfixadmin';
    > $CONF['database_name'] = 'postfix';
    84c82
    < $CONF['admin_email'] = '<mymail>';
    ---
    > $CONF['admin_email'] = 'postmaster@change-this-to-your.domain.tld';
    101c99
    < $CONF['encrypt'] = 'md5';
    ---
    > $CONF['encrypt'] = 'md5crypt';
    108c106
    < //$CONF['authlib_default_flavor'] = 'crypt';
    ---
    > $CONF['authlib_default_flavor'] = 'md5raw';
    135,138c133,136
    <     'abuse' => 'abuse@padmin.<mydomain>.de',
    <     'hostmaster' => 'hostmaster@padmin.<mydomain>.de',
    <     'postmaster' => 'postmaster@padmin.<mydomain>.de',
    <     'webmaster' => 'webmaster@padmin.<mydomain>.de'
    ---
    >     'abuse' => 'abuse@change-this-to-your.domain.tld',
    >     'hostmaster' => 'hostmaster@change-this-to-your.domain.tld',
    >     'postmaster' => 'postmaster@change-this-to-your.domain.tld',
    >     'webmaster' => 'webmaster@change-this-to-your.domain.tld'
    152c150
    < $CONF['domain_in_mailbox'] = 'NO';
    ---
    > $CONF['domain_in_mailbox'] = 'YES';
    158c156
    < $CONF['maildir_name_hook'] = 'maildir_name_hook';
    ---
    > $CONF['maildir_name_hook'] = 'NO';
    173c171
    <
    ---
    > /*
    179,180c177
    < //    return sprintf("%s/%s/%s/", $dir, $domain, $user);
    <    return sprintf("%s%s",$user,'');
    ---
    >     return sprintf("%s/%s/%s/", $dir, $domain, $user);
    182c179
    <
    ---
    > */
    189c186
    < $CONF['maxquota'] = '1000';
    ---
    > $CONF['maxquota'] = '10';
    193c190
    < $CONF['quota'] = 'YES';
    ---
    > $CONF['quota'] = 'NO';
    195c192
    < $CONF['quota_multiplier'] = '1048576';
    ---
    > $CONF['quota_multiplier'] = '1024000';
    219c216
    < $CONF['vacation_domain'] = 'autoreply.padmin.<mydomain>.de';
    ---
    > $CONF['vacation_domain'] = 'autoreply.change-this-to-your.domain.tld';
    233a231,232
    >
    > // Alias control for superadmins
    236,237c235
    < // Alias Control for admins
    < // Set to 'NO' if your domain admins shouldn't be able to edit user aliases.
    ---
    > // Alias Control for domain admins
    241c239,240
    < // Set to 'NO' if your domain admins shouldn't be able to edit default aliases.
    ---
    > // Set to 'NO' if your domain admins shouldn't be able to edit the default aliases
    > // as defined in $CONF['default_aliases']
    284c283
    < $CONF['user_footer_link'] = "http://padmin.<mydomain>.de/main";
    ---
    > $CONF['user_footer_link'] = "http://change-this-to-your.domain.tld/main";
    290,291c289,290
    < $CONF['footer_text'] = 'Return to padmin.<mydomain>.de';
    < $CONF['footer_link'] = 'http://padmin.<mydomain>.de';
    ---
    > $CONF['footer_text'] = 'Return to change-this-to-your.domain.tld';
    > $CONF['footer_link'] = 'http://change-this-to-your.domain.tld';
    366c365
    <  $CONF['mailbox_postdeletion_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postdeletion.sh';
    ---
    > // $CONF['mailbox_postdeletion_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postdeletion.sh';
    373c372
    < // Parameters: (1) username
    ---
    > // Parameters: (1) domain
    381c380
    < // Parameters: (1) username
    ---
    > // Parameters: (1) domain
    404c403
    < $CONF['used_quotas'] = 'YES';
    ---
    > $CONF['used_quotas'] = 'NO';
    408c407
    < $CONF['new_quota_table'] = 'YES';
    ---
    > $CONF['new_quota_table'] = 'NO';
    

    this minor changes should not confuse PA.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.