Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to write a Sieve rule like

if envelope :detail "to" "$x" {
  fileinto "inbox.$x";
}

but for all possible $x? I.e. if the user created a folder inbox.foo I want mail addressed to user+foo@domain to land there automatically. The spec doesn't seem to support this.

share|improve this question
up vote 1 down vote accepted

Turns out that's what the variables extension is for.

require "variables";
if envelope :detail :matches "to" "*" {
  fileinto "inbox.${1}";
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.