Code Monkey home page Code Monkey logo

dovecot-autoresponder's Introduction

dovecot-autoresponder

Small script that can trigger customizable, automatic email repsonses from within Dovecot/sieve scripts.

Installation

Configure Dovecot to allow execution of script through the extprogram plugin. Include into /etc/dovecot/conf.d/90-sieve.conf:

sieve_plugins = sieve_extprograms
sieve_extensions = +vnd.dovecot.execute

And in /etc/dovecot/conf.d/90-sieve-extprograms.conf:

sieve_execute_bin_dir = /usr/lib/dovecot/sieve-execute

Then, copy autoresponder.py into the specified directory (/usr/lib/dovecot/sieve-execute in this case), make it owned by root:root and give it 0755 permissions.

Now in your user's sieve script, you need to require the execution plugin:

require ["fileinto","imap4flags","vnd.dovecot.execute"];

Then, you can simply specify rules:

if header :contains "to" ["[email protected]","[email protected]"]
{
	addflag "\\Seen";
	fileinto "Some Spam";
	execute :input "spamresponder" "autoresponder.py";
	stop;
}

The identifier given (in this case spamresponder) refers to the identifier given to the autoresponder script on the command line. You can try it out by running (as your local user):

$ echo spamresponder | [email protected] /usr/lib/dovecot/sieve-execute/autoresponder.py

This will trigger the "spamresponder" action, as specified by the database entry in ~/.mail/autoresponder.sqlite3 (the database is created on first running the script). There is a "test" action defined that you can try out to get a feeling for it.

License

GNU GPL-3.

dovecot-autoresponder's People

Contributors

johndoe31415 avatar

Watchers

 avatar  avatar

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.