trasherdk / sieve Goto Github PK
View Code? Open in Web Editor NEWThis project forked from thsmi/sieve
Sieve Script Editor
License: GNU Affero General Public License v3.0
This project forked from thsmi/sieve
Sieve Script Editor
License: GNU Affero General Public License v3.0
Create IMAP folder.
It seems there is no standardised way to directly prepend or append a string to a message's Subject header, but there is a workaround using the editheaders
and variables
extensions:
require "editheader";
require "variables";
# Match/select your message as you see fit
if header :contains "List-Id" ["<foo.lists.example.net>"]
{
# Match the entire subject ...
if header :matches "Subject" "*" {
# ... to get it in a match group that can then be stored in a variable:
set "subject" "${1}";
}
# We can't "replace" a header, but we can delete (all instances of) it and
# re-add (a single instance of) it:
deleteheader "Subject";
# Append/prepend as you see fit
addheader :last "Subject" "[Foo-List] ${subject}";
# Note that the header is added ":last" (so it won't appear before possible
# "Received" headers).
}
Source: https://superuser.com/a/1502589
And my actual use-case:
require ["body","fileinto", "regex", "variables","editheader"];
if header :contains "subject" ["(Issue #","(PR #"] {
# Match the entire subject ...
if header :matches "Subject" "*" {
# ... to get it in a match group that can then be stored in a variable:
set "subject" "${1}";
}
# We can't "replace" a header, but we can delete (all instances of) it and
# re-add (a single instance of) it:
# Append/prepend as you see fit
# Note that the header is added ":last" (so it won't appear before possible
# "Received" headers).
# Closed #873.
if body :raw :contains "Closed #" {
deleteheader "Subject";
addheader :last "Subject" "(Closed) ${subject}";
}
# Merged #310
if body :raw :contains "Merged #" {
deleteheader "Subject";
addheader :last "Subject" "(Merged) ${subject}";
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.