2016-08-18 20:17:04 +02:00
|
|
|
require "variables";
|
|
|
|
require "vacation";
|
|
|
|
require "fileinto";
|
|
|
|
require "envelope";
|
|
|
|
require "mailbox";
|
|
|
|
require "imap4flags";
|
|
|
|
require "regex";
|
|
|
|
require "relational";
|
2017-11-10 16:39:16 +02:00
|
|
|
require "date";
|
2016-08-18 20:17:04 +02:00
|
|
|
require "comparator-i;ascii-numeric";
|
2016-09-29 15:34:43 +02:00
|
|
|
require "spamtestplus";
|
2018-04-03 22:12:08 +02:00
|
|
|
require "editheader";
|
|
|
|
require "index";
|
|
|
|
|
|
|
|
if header :index 2 :matches "Received" "from * by * for <*>; *"
|
|
|
|
{
|
|
|
|
deleteheader "Delivered-To";
|
|
|
|
addheader "Delivered-To" "<${3}>";
|
|
|
|
}
|
2016-08-18 20:14:03 +02:00
|
|
|
|
2018-09-27 08:11:26 +02:00
|
|
|
{% if user.spam_enabled %}
|
|
|
|
if spamtest :percent :value "gt" :comparator "i;ascii-numeric" "{{ user.spam_threshold }}"
|
2016-08-19 21:58:40 +02:00
|
|
|
{
|
2016-09-29 15:34:43 +02:00
|
|
|
setflag "\\seen";
|
|
|
|
fileinto :create "Junk";
|
|
|
|
stop;
|
2016-08-18 20:14:03 +02:00
|
|
|
}
|
2018-09-27 08:11:26 +02:00
|
|
|
{% endif %}
|
2016-04-20 21:20:02 +02:00
|
|
|
|
2017-11-05 17:54:23 +02:00
|
|
|
if exists "X-Virus" {
|
|
|
|
discard;
|
|
|
|
stop;
|
|
|
|
}
|
|
|
|
|
2018-10-16 20:38:18 +02:00
|
|
|
{% if user.reply_active %}
|
2018-12-30 22:44:38 +02:00
|
|
|
vacation :days 1 {% if user.displayed_name != "" %}:from "{{ user.displayed_name }} <{{ user.email }}>"{% endif %} :subject "{{ user.reply_subject }}" "{{ user.reply_body }}";
|
2018-09-27 08:11:26 +02:00
|
|
|
{% endif %}
|