Coder Social home page Coder Social logo

sieve_to_sogo-import's Introduction

Sieve_to_SOGo sieve import

  • These scripts import old sieve .script files and integrate them with SOGo. It works with smartsieve
  • To customize for your configurations :)

Description

  • The sieve directory is parsed by a bash script.
  • For each user to find, it executes "sieve_to_sogo-import.pl smartsieve.script $username"
  • Temporary files are created in /tmp/sieveimport/ in json format,
  • The SOGo command is to execute or display it is to modify in the script (exec = 0/1)

Migration exemple

  • Deactivate the current sieve editor (in our case smartsieve to deactivate from the apache server)
  • Zip the sieve folder of the imapd server (cd /var/lib/imap/sieve/; zip -r /tmp/all_sieve.zip ./)
  • From the IMAPD server send the zip to the SOGo server (scp /tmp/all_sieve.zip root @ sogo:/tmp /)
  • From the SOGo server edit and use parser_sieve_folder.sh to browse the sieve directory and proceed with the import.
  • By default the program lists the sogo-tool commands to perform and create the .json files, this allows to see if all the rules are well recognized in which case it will be necessary either to modify the original sieve, or to modify the perl if it is too redundant.
  • If you are sure, you can set the exec variable to execute the sogo-tool commands
yum install unzip git
mkdir /opt/oldsieve/
mkdir /tmp/sieveimport/
unzip /root/all_sieve.zip -d /opt/oldsieve/

git clone https://github.com/wixaw/sieve_to_sogo-import.git /opt/sieve_to_sogo-import
cd /opt/sieve_to_sogo-import/
edit **parser_sieve_folder.sh**  # DIR="/opt/oldsieve/"
edit **sieve_to_sogo-import.pl** # Remplacer smartsieve par le nom de votre ancien sieve manager
edit **sieve_to_sogo-import.pl** # $exec=1 pour executer les commandes sogo-tool, uniquement si vous êtes sur 
edit **roots.cred** qui contient les identifiants du compte root imapd

# Execution du parser
./parser_sieve_folder.sh

# Résultat à executer: 
sogo-tool user-preferences set defaults toto -p root.creds SOGoSieveFilters -f /tmp/sieveimport/toto_sieve.json
sogo-tool user-preferences set defaults titi -p root.creds Forward -f /tmp/sieveimport/titi_forward.json
sogo-tool user-preferences set defaults tata -p root.creds Vacation -f /tmp/sieveimport/tata_vacation.json

# Utilisation de la commande perl pour debuger 
perl sieve_to_sogo-import.pl opt/oldsieve/t/toto/smartsieve.script # Affiche tout dans la console
perl sieve_to_sogo-import.pl opt/oldsieve/t/toto/smartsieve.script toto # Creer les fichiers json et affiche la commande sogo-tool

Known issue

  • In the sieve.script file, if an argument like a mail subject contains a comma, the split does not work. The rule is in error. The solution is to remove this one and add it to the json file once created.
  • I had to deal with a few .script files which seemed to be compiled

sieve_to_sogo-import's People

Contributors

wixaw avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

brian-maloney

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.