Hello Am 14.02.19 um 16:57 schrieb Rémi Razmkhah ([email protected]): > Hi, > > I'd like to share an user case that is not implemented yet to the best > of my knowlegde. > > I would very much use the export of the filter rules so that I don't > have to write the rules again one by one in from mail client to another > mail server or the other way around. > > I don't know if there's a standard for such import/export and I didn't > find thunderbird able to export such filter rules but it may be handy. >
There is no export of filter rules in SOGo web frontend.
You only can get (and set) them with sogo-tool.
/usr/sbin/sogo-tool user-preferences get defaults ${USER1} SOGoSieveFilters
You will get something in json format like:
SOGoSieveFilters: [{"actions": [{"argument": "Spam", "method":
"fileinto"}, {"method": "stop"}], "name": "Spam-Filter", "rules":
[{"field": "header", "operator": "is", "custom_header": "X-Spam-Flag",
"value": "YES"}], "match": "all", "active": 1}, {"actions":
[{"argument": "Test\/Nr0", "method": "fileinto"}], "name": "sieve nach
Test\/Nr0", "rules": [{"field": "subject", "operator": "contains",
"value": "sieve"}], "match": "all", "active": 1}, {"actions":
[{"argument": "Test\/Nr0\/Frühling", "method": "fileinto"}], "name":
"April nach Test\/Nr0\/Frühling", "rules": [{"field": "subject",
"operator": "contains", "value": "April"}], "match": "any", "active":
1}, {"actions": [{"method": "discard"}], "name": "alles wegwerfen",
"rules": [{"field": "to_or_cc", "operator": "contains", "value":
"[email protected]"}, {"field": "to_or_cc", "operator":
"contains", "value": "[email protected]"}], "match": "any",
"active": 0}, {"actions": [{"argument": "Archiv", "method":
"fileinto"}], "name": "Testfilter", "rules": [{"field": "subject",
"operator": "contains", "value": "whatever Test"}], "match": "any",
"active": 1}]
E.g. this will set a Filter named "Spam-Filter" which filters emails
with header "X-Spam-Flag: YES" into the "Spam" folder:
/usr/sbin/sogo-tool user-preferences set defaults ${USER1} -p
/etc/sogo/sieve.creds SOGoSieveFilters -f newSieveFilter.json
Content of newSieveFilter.json:
{
"SOGoSieveFilters":[
{
"actions":[
{
"argument":"Spam",
"method":"fileinto"
},
{
"argument":"<null>",
"method":"stop"
}
],
"active":"<*I1>",
"match":"any",
"name":"Spam-Filter",
"rules":[
{
"custom_header":"X-Spam-Flag",
"field":"header",
"operator":"is",
"value":"YES"
}
]
}
]
}
Kind regards,
Christian Mack
--
Christian Mack
Universität Konstanz
Kommunikations-, Informations-, Medienzentrum (KIM)
Abteilung Basisdienste
78457 Konstanz
+49 7531 88-4416
smime.p7s
Description: S/MIME Cryptographic Signature
