trash-email-alias/README.md

56 lines
2.2 KiB
Markdown
Raw Normal View History

2017-01-17 07:55:35 +01:00
# Trash-email-alias
A dovecot sieve 's script and configuration to generate a temporary random alias.
2017-01-16 19:32:29 +01:00
2017-01-17 07:55:35 +01:00
# Usage
2017-01-16 19:32:29 +01:00
Just send an email to the configured em-mail generator. It will respond you and indicate what is your alias.
2017-01-17 07:55:35 +01:00
You can test it by sending a mail to [ getalias Arobaze tinad.fr ].
2017-01-17 07:50:54 +01:00
2017-01-16 19:32:29 +01:00
# Configure
2017-01-17 07:50:54 +01:00
You need an e-mail server with dovecot and sieve. The mail box structure is the classical one.
2017-01-17 13:45:06 +01:00
Add a column named "temporary" type Boolean, default 0 to the table alias. So alias table structure is:
2017-01-17 07:50:54 +01:00
2017-01-17 07:52:36 +01:00
+-----------+--------------+------+-----+---------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------------------+-------+
| address | varchar(255) | NO | PRI | | |
| goto | text | NO | | NULL | |
| domain | varchar(255) | NO | | | |
| created | datetime | NO | | 0000-00-00 00:00:00 | |
| modified | datetime | NO | | 0000-00-00 00:00:00 | |
| active | tinyint(1) | NO | | 1 | |
| temporary | tinyint(1) | NO | | 0 | |
+-----------+--------------+------+-----+---------------------+-------+
2017-01-17 07:50:54 +01:00
2017-01-16 19:32:29 +01:00
On /etc/dovecot/dovecot.conf my plugin section looks like:
2017-01-16 19:34:45 +01:00
plugin {
(...)
sieve = ~/dovecot.sieve
sieve_after = /var/www/vmail/sieve/global.sieve
sieve_dir = ~/sieve
#vacation
sieve_extensions = +vacation-seconds
sieve_vacation_min_period = 30m
sieve_vacation_default_period = 10d
sieve_vacation_max_period = 30d
2017-01-16 19:32:29 +01:00
2017-01-16 19:34:45 +01:00
#ExtPrograms
sieve_plugins = sieve_extprograms
sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.filter +vnd.dovecot.execute
2017-01-16 19:32:29 +01:00
2017-01-16 19:34:45 +01:00
sieve_pipe_bin_dir = /etc/sieve-pipe/bin
sieve_filter_bin_dir = /etc/sieve-pipe/filter
sieve_execute_bin_dir = /etc/sieve-pipe/execute
(...)
}
2017-01-16 19:32:29 +01:00
2017-01-17 07:50:54 +01:00
Change your mysql credentials on cron/purge.sh and execute/genalias.sh
In my case, this files are owned by the unix user "dovecot".
Add purge.sh on your crontab. Evrey 10 minutes is enougth.
2017-01-17 07:55:35 +01:00
2017-01-17 13:45:06 +01:00
Add the filters on yours sieve rules. Sample on this repo ./global.sieve file.