[Dovecot] Doing %var-substitutions in a plugin...

Johannes Berg johannes at sipsolutions.net
Fri Mar 2 12:44:46 EET 2007


On Fri, 2007-03-02 at 13:36 +0100, Nicolas Boullis wrote:

> I'm trying to write a plugin that need to do some %var-substitution. Is
> there a way to get the var_expand_table used by the process?
> 
> If not, I guess I could use getenv("USER") (for %u, %n and %d) and
> getenv("HOME") (for %h); but what for the other ones?

As far as I know there isn't such a way. I recently worked around this
by appending something to the mail path, i.e.

default_mail_env = maildir:/home/%u/.mail/:MYPLUGIN=%u-%n-%d

and then reading the MAIL environment and parsing out the :MYPLUGIN=
part. Works great.

johannes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20070302/8c05b67d/attachment.pgp 


More information about the dovecot mailing list