[ingo] %u or %U variables for maildrop backend vfs_path not always is "User"
Nethub Online - Ming
nethubonline at gmail.com
Fri Mar 6 09:42:04 UTC 2015
Hi Jan,
Thanks for your info. I am sorry that I don't get your point.
I may described too complicated in previous post. I wanna make it simple
here:
The incorrect path is only the part on variable $USER (while email is $USER@
$DOMAIN).
%U is always = vfs username when vfs username is set, so that %U never give
me the $USER variable
%U will only = $USER when vfs username is NOT set.
In my server, I cannot create many FTP accounts for so many email users,
hence I must set vfs username to use single FTP account to upload all
users' .mailfilter , and the vfs path (or even vfsroot) requires
$DOMAIN/$USER variables (/path/to/vo.demo360.net/test)
. In this case it seems never meet my requirement and I need to modify the
PHP src.
2015-03-05 17:37 GMT+08:00 Jan Schneider <jan at horde.org>:
>
> Zitat von Nethub Online - Ming <nethubonline at gmail.com>:
>
> Hi every one,
>>
>> I am testing Ingo for maildrop via FTP, I found that the variables for
>> maildrop backend vfs_path are not what I want usually. Below is my testing
>> result, and my solution is at bottom.
>>
>> ============================================================
>> ==================================================================
>> Horde Groupware Webmail Edition: 5.2.5
>> Imp [Mail]: H5 (6.2.7)
>> Ingo [Filters]: H5 (3.2.4)
>>
>> Full email address (example): test at vo.demo360.net
>> Email home dir: /home/vpopmail/domains/vo.demo360.net/test
>> FTP user: vpopmail
>> ============================================================
>> ==================================================================
>> Conditions A:
>> 1. hooks.php: don't specify vfs username/password
>> 2. 'vfstype' => 'ftp',
>> 3. 'vfs_path' => '/domains/%d/%u',
>>
>> Result:
>> 1. FTP login username will be using: test (failure as no such user)
>> ============================================================
>> ==================================================================
>> Conditions B:
>> 1. hooks.php: don't specify vfs username/password
>> 2. 'vfstype' => 'ftp',
>> 3. 'vfs_path' => '/domains/%d/%U',
>>
>> Result:
>> 1. FTP login username will be using: test (failure as no such user)
>> ============================================================
>> ==================================================================
>> Conditions C:
>> 1. hooks.php: specify vfs username/password to use correct FTP username
>> (vpopmail) & password
>> 2. 'vfstype' => 'ftp',
>> 3. 'vfs_path' => '/domains/%d/%u',
>>
>> Result:
>> 1. FTP login username will be using: vpopmail (success login)
>> 2. .mailfilter will be uploaded to : /home/vpopmail/domains/
>> vo.demo360.net/test at vo.demo360.net/.mailfilter (wrong path)
>> ============================================================
>> ==================================================================
>> Conditions D:
>> 1. hooks.php: specify vfs username/password to use correct FTP username
>> (vpopmail) & password
>> 2. 'vfstype' => 'ftp',
>> 3. 'vfs_path' => '/domains/%d/%U',
>>
>> Result:
>> 1. FTP login username will be using: vpopmail (success login)
>> 2. .mailfilter will be uploaded to : /home/vpopmail/domains/
>> vo.demo360.net/vpopmail/.mailfilter (wrong path)
>> ============================================================
>> ==================================================================
>> Conditions E:
>> 1. hooks.php: don't specify vfs username/password
>> 2. 'vfstype' => 'file',
>> 3. 'vfs_path' => '/domains/%d/%u',
>>
>> Result:
>> 1. .mailfilter will be put to : /home/vpopmail/domains/
>> vo.demo360.net/test at vo.demo360.net (wrong path)
>> ============================================================
>> ==================================================================
>> Conditions F:
>> 1. hooks.php: don't specify vfs username/password
>> 2. 'vfstype' => 'file',
>> 3. 'vfs_path' => '/domains/%d/%U',
>>
>> Result:
>> 1. .mailfilter will be put to : /home/vpopmail/domains/vo.
>> demo360.net/test
>> (correct path)
>> ============================================================
>> ==================================================================
>>
>>
>>
>> Problem:
>> In https://bugs.horde.org/ticket/11957, Jan suggested to use %U for
>> "User"
>> (while "User"@"Domain"). However while vfs username is set, %U will be
>> changed to the vfs username and no longer be "User"
>>
>> From the testing result above, only condition F works without problem,
>> however my horde and mail server are installed in 2 different servers, so
>> that using vfstype=file is not applicable for me.
>>
>> Solution:
>> In https://bugs.horde.org/ticket/11957, Rob provided a temp "solution".
>> Rather than modify %u value, I prefer to add one more variable for "User"
>> (while "User"@"Domain"), so I updated lib/Transport/Vfs.php
>>
>> array('%u', '%d', '%U'),
>> array(Ingo::getUser(), Ingo::getDomain(),
>> $this->_params['username']),
>> ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
>> array('%u', '%d', '%U','%p'),
>> array(Ingo::getUser(), Ingo::getDomain(),
>> $this->_params['username'], Ingo::getUser(false)),
>>
>> Now it works as what I want:
>> ============================================================
>> ==================================================================
>> Conditions G:
>> 1. hooks.php: specify vfs username/password to use correct FTP username
>> (vpopmail) & password
>> 2. 'vfstype' => 'ftp',
>> 3. 'vfs_path' => '/domains/%d/%p',
>>
>> Result:
>> 1. FTP login username will be using: vpopmail (success login)
>> 2. .mailfilter will be uploaded to : /home/vpopmail/domains/
>> vo.demo360.net/test/.mailfilter (correct path)
>> ============================================================
>> ==================================================================
>>
>> I am not sure if above solution is best way, plz correct me if I am wrong.
>> And I hope it could be include in future update and help people who want
>> SSH/FTP as vfs.
>> --
>> ingo mailing list
>> Frequently Asked Questions: http://wiki.horde.org/FAQ
>> To unsubscribe, mail: ingo-unsubscribe at lists.horde.org
>>
>
> The incorrect path when using FTP is cause by the FTP home directory set
> for the vpopmail user. Either set the FTP home to / in the FTP server
> configuration. Or set the vfsroot Parameter.
>
> --
> Jan Schneider
> The Horde Project
> http://www.horde.org/
> https://www.facebook.com/hordeproject
>
> --
> ingo mailing list
> Frequently Asked Questions: http://wiki.horde.org/FAQ
> To unsubscribe, mail: ingo-unsubscribe at lists.horde.org
More information about the ingo
mailing list