imapsieve environment variables missing?
RFC6785 says imap.user and imap.email environment variables should be made available but I can't access them no matter what I try. Are they not implemented because vnd.dovecot.environment already provides the username? (which does work for me)
If imap.user and imap.email are there, can you provide an example how to access them so I can see what I did wrong?
Op 5-12-2016 om 13:28 schreef MRob:
RFC6785 says imap.user and imap.email environment variables should be made available but I can't access them no matter what I try. Are they not implemented because vnd.dovecot.environment already provides the username? (which does work for me)
If imap.user and imap.email are there, can you provide an example how to access them so I can see what I did wrong?
That should work.
Do you have an example script demonstrating what your trying to do?
Regards,
Stephan.
Ugh.
s/your/you're/.
Op 5-12-2016 om 13:38 schreef Stephan Bosch:
Op 5-12-2016 om 13:28 schreef MRob:
RFC6785 says imap.user and imap.email environment variables should be made available but I can't access them no matter what I try. Are they not implemented because vnd.dovecot.environment already provides the username? (which does work for me)
If imap.user and imap.email are there, can you provide an example how to access them so I can see what I did wrong?
That should work.
Do you have an example script demonstrating what your trying to do?
Regards,
Stephan.
On 2016-12-05 04:38, Stephan Bosch wrote:
Op 5-12-2016 om 13:28 schreef MRob:
RFC6785 says imap.user and imap.email environment variables should be made available but I can't access them no matter what I try. Are they not implemented because vnd.dovecot.environment already provides the username? (which does work for me)
If imap.user and imap.email are there, can you provide an example how to access them so I can see what I did wrong?
That should work.
Do you have an example script demonstrating what your trying to do?
Trying to access as a variable:
\${imap.user}
Also tried:
if environment :matches "imap.user" "*" { set "username" "${1}"; }
Also tried prefixing with "env." or removing "imap."
Result is always empty string (dumped with debug_log)
Script is run during COPY operations, newest tarball releases installed for dovecot and pigeonhole.
Op 5-12-2016 om 14:32 schreef MRob:
On 2016-12-05 04:38, Stephan Bosch wrote:
Op 5-12-2016 om 13:28 schreef MRob:
RFC6785 says imap.user and imap.email environment variables should be made available but I can't access them no matter what I try. Are they not implemented because vnd.dovecot.environment already provides the username? (which does work for me)
If imap.user and imap.email are there, can you provide an example how to access them so I can see what I did wrong?
That should work.
Do you have an example script demonstrating what your trying to do?
Trying to access as a variable:
\${imap.user}
Also tried:
if environment :matches "imap.user" "*" { set "username" "${1}"; }
Also tried prefixing with "env." or removing "imap."
Result is always empty string (dumped with debug_log)
Script is run during COPY operations, newest tarball releases installed for dovecot and pigeonhole.
Could you show me your full script? I am mainly interested in the require statements involved.
Regards,
Stephan.
On 2016-12-05 06:13, Stephan Bosch wrote:
Op 5-12-2016 om 14:32 schreef MRob:
On 2016-12-05 04:38, Stephan Bosch wrote:
Op 5-12-2016 om 13:28 schreef MRob:
RFC6785 says imap.user and imap.email environment variables should be made available but I can't access them no matter what I try. Are they not implemented because vnd.dovecot.environment already provides the username? (which does work for me)
If imap.user and imap.email are there, can you provide an example how to access them so I can see what I did wrong?
That should work.
Do you have an example script demonstrating what your trying to do?
Trying to access as a variable:
\${imap.user}
Also tried:
if environment :matches "imap.user" "*" { set "username" "${1}"; }
Also tried prefixing with "env." or removing "imap."
Result is always empty string (dumped with debug_log)
Script is run during COPY operations, newest tarball releases installed for dovecot and pigeonhole.
Could you show me your full script? I am mainly interested in the require statements involved.
I don't know how I managed to compile only using direct access of ${imap.user} before since now I get an unknown namespace error on my test script.
But doing it this way compiles:
require ["environment", "variables", "vnd.dovecot.debug"];
if environment :matches "imap.user" "*" { set "u" "${1}"; } debug_log "Found username: \${u}"; if environment :matches "name" "*" { set "n" "${1}"; } debug_log "Found product name: \${n}";
The output is:
DEBUG: Found username: DEBUG: Found product name: Pigeonhole Sieve
Op 5-12-2016 om 16:10 schreef MRob:
On 2016-12-05 06:13, Stephan Bosch wrote:
Op 5-12-2016 om 14:32 schreef MRob:
Could you show me your full script? I am mainly interested in the require statements involved.
I don't know how I managed to compile only using direct access of ${imap.user} before since now I get an unknown namespace error on my test script.
But doing it this way compiles:
require ["environment", "variables", "vnd.dovecot.debug"];
if environment :matches "imap.user" "*" { set "u" "${1}"; } debug_log "Found username: \${u}"; if environment :matches "name" "*" { set "n" "${1}"; } debug_log "Found product name: \${n}";
The output is:
DEBUG: Found username: DEBUG: Found product name: Pigeonhole Sieve
- For the "imap.user" environment item, you need to add:
require "imapsieve";
This also means that this script will only run from IMAP.
- For the "${imap.user}" variable, you need to add:
require "vnd.dovecot.environment";
This implicitly requires "environment", so that could be removed.
It is all in the specifications. :)
Regards,
Stephan.
Op 5-12-2016 om 16:22 schreef Stephan Bosch:
Op 5-12-2016 om 16:10 schreef MRob:
On 2016-12-05 06:13, Stephan Bosch wrote:
Op 5-12-2016 om 14:32 schreef MRob:
Could you show me your full script? I am mainly interested in the require statements involved.
I don't know how I managed to compile only using direct access of ${imap.user} before since now I get an unknown namespace error on my test script.
But doing it this way compiles:
require ["environment", "variables", "vnd.dovecot.debug"];
if environment :matches "imap.user" "*" { set "u" "${1}"; } debug_log "Found username: \${u}"; if environment :matches "name" "*" { set "n" "${1}"; } debug_log "Found product name: \${n}";
The output is:
DEBUG: Found username: DEBUG: Found product name: Pigeonhole Sieve
- For the "imap.user" environment item, you need to add:
require "imapsieve";
This also means that this script will only run from IMAP.
- For the "${imap.user}" variable, you need to add:
Uhm, this should be ${env.imap.user} of course.
Regards,
Stephan.
On 2016-12-05 07:22, Stephan Bosch wrote:
Op 5-12-2016 om 16:10 schreef MRob:
On 2016-12-05 06:13, Stephan Bosch wrote:
Op 5-12-2016 om 14:32 schreef MRob:
Could you show me your full script? I am mainly interested in the require statements involved.
I don't know how I managed to compile only using direct access of ${imap.user} before since now I get an unknown namespace error on my test script.
But doing it this way compiles:
require ["environment", "variables", "vnd.dovecot.debug"];
if environment :matches "imap.user" "*" { set "u" "${1}"; } debug_log "Found username: \${u}"; if environment :matches "name" "*" { set "n" "${1}"; } debug_log "Found product name: \${n}";
The output is:
DEBUG: Found username: DEBUG: Found product name: Pigeonhole Sieve
- For the "imap.user" environment item, you need to add:
require "imapsieve";
Hmm, I had tried that and get this:
error: require command: unknown Sieve capability `imapsieve'
I've already got imapsieve working (per above output, which was triggered by a COPY action) so it clearly is installed and configured.
This also means that this script will only run from IMAP.
Seems as though it won't compile outside of IMAP either :)
- For the "${imap.user}" variable, you need to add:
require "vnd.dovecot.environment";
This implicitly requires "environment", so that could be removed.
It is all in the specifications. :)
You're saying that to access the new imap. namespace vars for imapsieve that vnd.dovecot.environment is required? I don't find anything in the specifications that say this.
The RFC says those vars MUST be made available, so presumably it would be referring to the RFC-standard environment extension and not some vendor specific one.
Of course it's easy to work with that if this is how it's been built, but as noted above I can't get it to compile anyway. Though what's the point of trying to figure out imap.user or imap.email if I'm required to use vnd.dovecot.environment which already has "username"? :)
Op 12/5/2016 om 10:25 PM schreef MRob:
On 2016-12-05 07:22, Stephan Bosch wrote:
Op 5-12-2016 om 16:10 schreef MRob:
On 2016-12-05 06:13, Stephan Bosch wrote:
Op 5-12-2016 om 14:32 schreef MRob:
Could you show me your full script? I am mainly interested in the require statements involved.
I don't know how I managed to compile only using direct access of ${imap.user} before since now I get an unknown namespace error on my test script.
But doing it this way compiles:
require ["environment", "variables", "vnd.dovecot.debug"];
if environment :matches "imap.user" "*" { set "u" "${1}"; } debug_log "Found username: \${u}"; if environment :matches "name" "*" { set "n" "${1}"; } debug_log "Found product name: \${n}";
The output is:
DEBUG: Found username: DEBUG: Found product name: Pigeonhole Sieve
- For the "imap.user" environment item, you need to add:
require "imapsieve";
Hmm, I had tried that and get this:
error: require command: unknown Sieve capability `imapsieve'
I've already got imapsieve working (per above output, which was triggered by a COPY action) so it clearly is installed and configured.
This also means that this script will only run from IMAP.
Seems as though it won't compile outside of IMAP either :)
Not if you're not using the sieve_imapsieve plugin for the Sieve interpreter (sieve_plugins = sieve_imapsieve).
- For the "${imap.user}" variable, you need to add:
require "vnd.dovecot.environment";
This implicitly requires "environment", so that could be removed.
It is all in the specifications. :)
You're saying that to access the new imap. namespace vars for imapsieve that vnd.dovecot.environment is required? I don't find anything in the specifications that say this.
The RFC says those vars MUST be made available, so presumably it would be referring to the RFC-standard environment extension and not some vendor specific one.
Of course it's easy to work with that if this is how it's been built, but as noted above I can't get it to compile anyway. Though what's the point of trying to figure out imap.user or imap.email if I'm required to use vnd.dovecot.environment which already has "username"? :)
The standard "environment" extension [1] does not register a variables namespace [2] for environment items. So, using a "${env.imap.user}" variable requires the Dovecot-specific "vnd.dovecot.environment" extension [3]. In contrast, the normal alternative for this variable using the "imap.user" environment item will work once the "imapsieve" extension [4] is require'd. That is a bit cumbersome though, since you need to put that in a variable with a statement like: if environment :matches "imap.user" "*" { set "imap_user" "${1}"; }. The standard [1] provides no alternative.
Relevant specifications:
[1] http://tools.ietf.org/html/rfc5183/ [2] http://tools.ietf.org/html/rfc5229/ [3] https://raw.githubusercontent.com/dovecot/pigeonhole/master/doc/rfc/spec-bos... [4] https://tools.ietf.org/html/rfc6785
Regards,
Stephan.
I don't know how I managed to compile only using direct access of ${imap.user} before since now I get an unknown namespace error on my test script.
But doing it this way compiles:
require ["environment", "variables", "vnd.dovecot.debug"];
if environment :matches "imap.user" "*" { set "u" "${1}"; } debug_log "Found username: \${u}"; if environment :matches "name" "*" { set "n" "${1}"; } debug_log "Found product name: \${n}";
The output is:
DEBUG: Found username: DEBUG: Found product name: Pigeonhole Sieve
- For the "imap.user" environment item, you need to add:
require "imapsieve";
Hmm, I had tried that and get this:
error: require command: unknown Sieve capability `imapsieve'
I've already got imapsieve working (per above output, which was triggered by a COPY action) so it clearly is installed and configured.
This also means that this script will only run from IMAP.
Seems as though it won't compile outside of IMAP either :)
Not if you're not using the sieve_imapsieve plugin for the Sieve interpreter (sieve_plugins = sieve_imapsieve).
Forgive me, but what other way is there to set it up? Is there any way to successfully compile a script with a require of "imapsieve" from the command line?
- For the "${imap.user}" variable, you need to add:
require "vnd.dovecot.environment";
This implicitly requires "environment", so that could be removed.
It is all in the specifications. :)
You're saying that to access the new imap. namespace vars for imapsieve that vnd.dovecot.environment is required? I don't find anything in the specifications that say this.
The RFC says those vars MUST be made available, so presumably it would be referring to the RFC-standard environment extension and not some vendor specific one.
Of course it's easy to work with that if this is how it's been built, but as noted above I can't get it to compile anyway. Though what's the point of trying to figure out imap.user or imap.email if I'm required to use vnd.dovecot.environment which already has "username"? :)
The standard "environment" extension [1] does not register a variables namespace [2] for environment items. So, using a "${env.imap.user}" variable requires the Dovecot-specific "vnd.dovecot.environment" extension [3].
But this doesn't work:
require ["environment", "variables", "vnd.dovecot.debug", "vnd.dovecot.environment"]; debug_log "Username: ${env.imap.user}";
Output when running from a COPY event is:
DEBUG: Username:
What did I do wrong here?
In contrast, the normal alternative for this variable using the "imap.user" environment item will work once the "imapsieve" extension [4] is require'd. That is a bit cumbersome though, since you need to put that in a variable with a statement like: if environment :matches "imap.user" "*" { set "imap_user" "${1}"; }.
I don't see that being too cumbersome, as it's the standard way the environment extension is used, and it's what I expect from reading the RFC. But I understand your point that it's more lengthy than just accessing the variable directly.
So the only issue I see is that the script won't compile on the CLI with the needed require. Is it simply a requirement to have Sieve do run-time compilation for this to work?
Op 12/6/2016 om 12:23 AM schreef MRob:
I don't know how I managed to compile only using direct access of ${imap.user} before since now I get an unknown namespace error on my test script.
But doing it this way compiles:
require ["environment", "variables", "vnd.dovecot.debug"];
if environment :matches "imap.user" "*" { set "u" "${1}"; } debug_log "Found username: \${u}"; if environment :matches "name" "*" { set "n" "${1}"; } debug_log "Found product name: \${n}";
The output is:
DEBUG: Found username: DEBUG: Found product name: Pigeonhole Sieve
- For the "imap.user" environment item, you need to add:
require "imapsieve";
Hmm, I had tried that and get this:
error: require command: unknown Sieve capability `imapsieve'
I've already got imapsieve working (per above output, which was triggered by a COPY action) so it clearly is installed and configured.
This also means that this script will only run from IMAP.
Seems as though it won't compile outside of IMAP either :)
Not if you're not using the sieve_imapsieve plugin for the Sieve interpreter (sieve_plugins = sieve_imapsieve).
Forgive me, but what other way is there to set it up? Is there any way to successfully compile a script with a require of "imapsieve" from the command line?
I mean that adding "sieve_imapsieve" to sieve_plugins should fix it for you:
plugin { sieve_plugins = sieve_imapsieve }
Regards,
Stephan.
On 2016-12-05 15:26, Stephan Bosch wrote:
Op 12/6/2016 om 12:23 AM schreef MRob:
I don't know how I managed to compile only using direct access of ${imap.user} before since now I get an unknown namespace error on my test script.
But doing it this way compiles:
require ["environment", "variables", "vnd.dovecot.debug"];
if environment :matches "imap.user" "*" { set "u" "${1}"; } debug_log "Found username: \${u}"; if environment :matches "name" "*" { set "n" "${1}"; } debug_log "Found product name: \${n}";
The output is:
DEBUG: Found username: DEBUG: Found product name: Pigeonhole Sieve
- For the "imap.user" environment item, you need to add:
require "imapsieve";
Hmm, I had tried that and get this:
error: require command: unknown Sieve capability `imapsieve'
I've already got imapsieve working (per above output, which was triggered by a COPY action) so it clearly is installed and configured.
This also means that this script will only run from IMAP.
Seems as though it won't compile outside of IMAP either :)
Not if you're not using the sieve_imapsieve plugin for the Sieve interpreter (sieve_plugins = sieve_imapsieve).
Forgive me, but what other way is there to set it up? Is there any way to successfully compile a script with a require of "imapsieve" from the command line?
I mean that adding "sieve_imapsieve" to sieve_plugins should fix it for you:
plugin { sieve_plugins = sieve_imapsieve }
Darn, botched configuration settings. I apologize for the unnecessary thread.
On 2016-12-05 15:29, MRob wrote:
On 2016-12-05 15:26, Stephan Bosch wrote:
Op 12/6/2016 om 12:23 AM schreef MRob:
> I don't know how I managed to compile only using direct access of > ${imap.user} before since now I get an unknown namespace error on > my > test script. > > But doing it this way compiles: > > require ["environment", "variables", "vnd.dovecot.debug"]; > > if environment :matches "imap.user" "*" { > set "u" "${1}"; } > debug_log "Found username: \${u}"; > if environment :matches "name" "*" { > set "n" "${1}"; } > debug_log "Found product name: \${n}"; > > The output is: > > DEBUG: Found username: > DEBUG: Found product name: Pigeonhole Sieve
- For the "imap.user" environment item, you need to add:
require "imapsieve";
Hmm, I had tried that and get this:
error: require command: unknown Sieve capability `imapsieve'
I've already got imapsieve working (per above output, which was triggered by a COPY action) so it clearly is installed and configured.
This also means that this script will only run from IMAP.
Seems as though it won't compile outside of IMAP either :)
Not if you're not using the sieve_imapsieve plugin for the Sieve interpreter (sieve_plugins = sieve_imapsieve).
Forgive me, but what other way is there to set it up? Is there any way to successfully compile a script with a require of "imapsieve" from the command line?
I mean that adding "sieve_imapsieve" to sieve_plugins should fix it for you:
plugin { sieve_plugins = sieve_imapsieve }
Darn, botched configuration settings. I apologize for the unnecessary thread.
What a supreme waste of your time. I'm sorry this probably happens to you all the time. I had had this set up but for various reasons, commented it out temporarily. When I put it back, the software works as advertised - little surprise. Can't say enough how much the software and support is appreciated.
participants (2)
-
MRob
-
Stephan Bosch