Get parts from username variable

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Get parts from username variable

Matt .
Hi Guys,

When I have a username like foo-bar-candy can I get/seperate foo, bar
and candy as single variables for my storagepath of the usermail ?

Thanks,

Matt
Reply | Threaded
Open this post in threaded view
|

Re: Get parts from username variable

Aki Tuomi-2


On 08.01.2018 03:16, Matt . wrote:
> Hi Guys,
>
> When I have a username like foo-bar-candy can I get/seperate foo, bar
> and candy as single variables for my storagepath of the usermail ?
>
> Thanks,
>
> Matt

The new lua auth backend is probably easiest for this. Dovecot variable
manipulation has no separator handling. Or alternatively some dict based
script backend.

Aki
Reply | Threaded
Open this post in threaded view
|

Re: Get parts from username variable

Timo Sirainen
In reply to this post by Matt .
On 7 Jan 2018, at 20.16, Matt . <[hidden email]> wrote:
>
> Hi Guys,
>
> When I have a username like foo-bar-candy can I get/seperate foo, bar
> and candy as single variables for my storagepath of the usermail ?

If there aren't any @ characters, I think you can kludge this by converting '-' into '@':

auth_username_translation = -@

Then you can use %{username}, %{domain_first} and %{domain_last}