[ingo] %u or %U variables for maildrop backend vfs_path not always is "User"

Nethub Online - Ming nethubonline at gmail.com
Thu Mar 5 02:29:38 UTC 2015


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.


More information about the ingo mailing list