Mailing List Archive

Exim 4.94: address suffixes and local delivery to subdirectories in maildir mailboxes
Hello! I try to use Exim 4.94 as my post server and I want to use address suffixes and local delivery to subdirectories in maildir mailboxes.

I've used this decision from the official documentation (ch. 26.5):

directory = /var/mail/$local_part_data\
${if eq{$local_part_suffix}{}{}\
{/.${substr_1:$local_part_suffix}}}
maildirfolder_create_regex = /\.[^/]+$

In my case I use a mail directory inside a home directory and the path '/home/$local_part_data/.maildir' instead of '/var/mail/$local_part_data'.

After that I've got the error "Tainted '/home/user/.maildir/.test' (file or directory name for local_delivery transport) not permitted".

I'm a newbie in Exim and confused about this error. I understand that tainted data may not be used for a directory name, but I don't know how to specify in this case a path to directories that should be created from local part suffixes.

If you know a possible solution for this case, tell me, please.

--
Best Regards,
Ivanov

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Exim 4.94: address suffixes and local delivery to subdirectories in maildir mailboxes [ In reply to ]
Hello again!

I apologize for my persistence, but I would like to know if it is possible with new Exim to create automatically new subdirectories for address suffixes in maildir mailboxes. Or it doesn't work because any destination path should be de-tainted via lookup, and lookup for non-existing directories isn't possible.

Maybe I don't understand something about de-tainting. There is no fresh documentation on my native language and maybe I missed some important things when I read English text.

It is important to me to know should I spend my time trying to find the solution of the issue with Exim or I should look to third-party utilities. Maybe it would be better for me to set up local delivery with Dovecot and Sieve rules.

--
Best Regards,
Ivanov


On Thu, Oct 01, 2020 at 08:37:28AM +0300, ivanov via Exim-users wrote:
> Hello! I try to use Exim 4.94 as my post server and I want to use address suffixes and local delivery to subdirectories in maildir mailboxes.
>
> I've used this decision from the official documentation (ch. 26.5):
>
> directory = /var/mail/$local_part_data\
> ${if eq{$local_part_suffix}{}{}\
> {/.${substr_1:$local_part_suffix}}}
> maildirfolder_create_regex = /\.[^/]+$
>
> In my case I use a mail directory inside a home directory and the path '/home/$local_part_data/.maildir' instead of '/var/mail/$local_part_data'.
>
> After that I've got the error "Tainted '/home/user/.maildir/.test' (file or directory name for local_delivery transport) not permitted".
>
> I'm a newbie in Exim and confused about this error. I understand that tainted data may not be used for a directory name, but I don't know how to specify in this case a path to directories that should be created from local part suffixes.
>
> If you know a possible solution for this case, tell me, please.

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Exim 4.94: address suffixes and local delivery to subdirectories in maildir mailboxes [ In reply to ]
On Fri, Oct 02, 2020 at 12:08:21PM +0300, ivanov via Exim-users wrote:
> I apologize for my persistence, but I would like to know if it is
> possible with new Exim to create automatically new subdirectories
> for address suffixes in maildir mailboxes. Or it doesn't work
> because any destination path should be de-tainted via lookup, and
> lookup for non-existing directories isn't possible.

The "nwildlsearch" lookup type may be used for "general detainting":
https://lists.exim.org/lurker/message/20200719.210026.542b980a.en.html
https://lists.exim.org/lurker/message/20200720.100355.3d99dd1e.en.html
--
Eugene Berdnikov

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Exim 4.94: address suffixes and local delivery to subdirectories in maildir mailboxes [ In reply to ]
On Fri, Oct 02, 2020 at 12:37:21PM +0300, Evgeniy Berdnikov via Exim-users wrote:
> On Fri, Oct 02, 2020 at 12:08:21PM +0300, ivanov via Exim-users wrote:
> > I apologize for my persistence, but I would like to know if it is
> > possible with new Exim to create automatically new subdirectories
> > for address suffixes in maildir mailboxes. Or it doesn't work
> > because any destination path should be de-tainted via lookup, and
> > lookup for non-existing directories isn't possible.
>
> The "nwildlsearch" lookup type may be used for "general detainting":
> https://lists.exim.org/lurker/message/20200719.210026.542b980a.en.html
> https://lists.exim.org/lurker/message/20200720.100355.3d99dd1e.en.html
> --
> Eugene Berdnikov

Great. Thank you very much.

It seems strange to create a separate file with a single regular expression, but it works.

The following configuration works as I expected:

directory = ${home}/.maildir\
${lookup {/.${local_part_suffix_v}} \
nwildlsearch,ret=key {/etc/exim/suffix.pcre} \
{$value} {}}
maildirfolder_create_regex = /\.(?!maildir)[^/]+$

And /etc/exim/suffix.pcre contains:

^\/\.[^/]+$

Thank you again.

--
Best Regards,
Ivanov

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/