[Dovecot] Doing %var-substitutions in a plugin...
Hi,
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?
Cheers,
Nicolas
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
Johannes Berg wrote:
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.
Oh... I just figured out that the plugin configuration in /etc/dovecot/dovecot.conf already gets %var-substituted, so I don't need to perform any veriable-substitution in the plugin.
Thanks anyway for the suggestion,
Nicolas
On Fri, 2007-03-02 at 15:16 +0100, Nicolas Boullis wrote:
Oh... I just figured out that the plugin configuration in /etc/dovecot/dovecot.conf already gets %var-substituted, so I don't need to perform any veriable-substitution in the plugin.
Good point, I guess I'll change mine.
johannes
participants (2)
-
Johannes Berg
-
Nicolas Boullis