Questions tagged [sieve-language]

Sieve is a programming language that can be used to create filters for email.

Sieve is a programming language that can be used to create filters for email. It owes its creation to the CMU Cyrus Project, creators of Cyrus IMAP server.

The language is not tied to any particular operating system or mail architecture. The current version of Sieve's base specification is outlined in RFC 5228, published in January 2008.

Sieve differs from traditional programming languages in that it is highly limited – the base standard has no variables, and no loops, preventing runaway programs and limiting the language to simple filtering operations. Although extensions have been devised to extend the language to include variables and, to a limited degree, loops, the language is still highly restricted, and thus unsuitable for running user-devised programs as part of the mail system.

There are also a significant number of restrictions on the grammar of the language, in order to reduce the complexity of parsing the language, but the language also supports the use of multiple methods for comparing localized strings, and is fully Unicode-aware.

The scripts are transferred to the mail server in a server-dependent way. The ManageSieve protocol (defined in RFC 5804) allows users to manage their Sieve scripts on a remote server. Mail servers with local users may allow the scripts to be stored in e.g. a .sieve file in the users' home directories.

34 questions
4
votes
1 answer

Sieve addflag "$label1" does not show in Thunderbird

I am filtering my mails with sieve. I would like to mark certain messages so that they show up in Thunderbird with the corresponding tag. The examples say that require "imap4flags"; followed by an addflag "$label1"; in a statement is supposed to…
Vince42
  • 215
  • 1
  • 9
3
votes
1 answer

How to replace a character by another in a variable

I want to know if there is a way to replace a character by another in a variable. For example replacing every dots with underscores in a string variable.
madjack
  • 508
  • 5
  • 15
3
votes
2 answers

sieve and multiple ACTIVE scripts

Is there a reason the email filter sieve can only activate one single script? > list "mailinglists.sieve" "spam.sieve" ACTIVE > activate mailinglists.sieve > list "mailinglists.sieve" ACTIVE "spam.sieve" > I can't see the logic here ... I…
Fu86
  • 3,245
  • 5
  • 35
  • 57
3
votes
1 answer

How to match everything inside the first pair of square brackets

I'm trying to create a regular expression in sieve. The implementation of sieve that I'm using is Dovecot Pigeonhole I'm subscribed to github project updates and I receive emails from github with the subject in the format that looks like this: Re:…
Andrew Savinykh
  • 22,530
  • 13
  • 90
  • 143
3
votes
1 answer

sieve mail regular expression not working

I'm using smartsieve web gui to manage my sieve filters. I have a problem with regular expression match. I'm sending myself a test email with subject in format: testXX (where X is a number between 0 and 9). When I define a filter: If message…
Deus777
  • 1,736
  • 18
  • 18
2
votes
1 answer

Regex match time from "Received" e-mail header

I am trying to match header to set in a filter on roundcube. I have found another question about this and i tried the answers, but it doesn't work. The regex works when tested in RegExr, but roundcube simply denies to save it. This is my regex:…
Andy
  • 2,482
  • 1
  • 21
  • 31
2
votes
1 answer

Sieve randomly assigns mails to folders

I'm using sieve rules like the following to sort logs from normal mails: require ["fileinto", "envelope", "subaddress", "variables", "mailbox"]; # rule:[asdf-logs] if anyof (address "From" "nagios@mail.com", address "From" "root@mail.com", address…
Hoeze
  • 473
  • 3
  • 15
2
votes
2 answers

Arch Dovecot spamtestplus sieve not working

I followed the guide at https://wiki.archlinux.org/index.php/Dovecot#Sieve In one portion it says to create /var/lib/dovecot/sieve/global_sieves/move_to_spam_folder.sieve with: require "spamtestplus"; require "fileinto"; require…
2
votes
0 answers

How to deploy Sieve scripts on Apache James

I have spent two days trying to find a clear instructions on how Sieve scripts are deployed on Apache James. I found some hints that scripts go into "../apps/james/var/" with name such as "username@host.sieve", but doing just that did not work for…
Daniil Shevelev
  • 10,633
  • 11
  • 43
  • 63
1
vote
1 answer

Invalid preceding regular expression given by Sieve

I am attempting to write a filter that matches the regex ^[a-zA-Z0-9_.+-]+@(?:(?:[a-zA-Z0-9-]+\.)?[a-zA-Z]+\.)?(example)\.com$. (I want to capture every email that is from a specific domain). However, it keeps returning the error Invalid preceding…
RHPT
  • 2,362
  • 4
  • 28
  • 42
1
vote
0 answers

How to change recipient of a VACATION autoresponder mail to one in sender's mail header section [Reply-to] purely in Sieve Language?

I need to set an autoresponder that will send a message like "We got You mail! We will get back to you ASAP". The problem is that the sender of customer email is not customer itself (i.e. customer@privatemail.com), but some global mail (i.e.…
Krystian
  • 47
  • 5
1
vote
1 answer

What is the correct way to format a Sieve script to include MIME with HTML?

I am trying to implement autoresponders on a server using Dovecot Sieve. I have managed to produce sieve scripts with simple html which works, however, when trying to implement more complex html I am receiving syntax errors. How can I formulate the…
Lee Colarelli
  • 150
  • 2
  • 13
1
vote
1 answer

Regex capture groups in Sieve script

I want to put emails that are forwarded to my main mailbox (from another domain) into specific sub-folders. For example: foo@bar goes to INBOX/bar/foo. require ["fileinto", "envelope", "regex", "mailbox"]; if header :regex "delivered-to"…
madjack
  • 508
  • 5
  • 15
1
vote
1 answer

How to use sieve to send HTML email

I am using sieve to send external notification emails about our internal emails. if header :matches "X-Forward-To" "*" { set "forwardTo" "${1}"; set :encodeurl "message" "Message"; notify :from "no-reply@mycompany.com" :importance "1" …
Autumn Leonard
  • 463
  • 9
  • 18
1
vote
2 answers

Dovecot Sieve filters not working

I'm having an issue where dovecot-sieve is not working for me from within Roundcube. In the Roundcube web interface the filters tab is there as well as the vacation tab. I can edit, save, enable, and disable filters just fine, but despite the…
Creibold
  • 23
  • 1
  • 6
1
2 3