Filtering Spam in RainLoop, AutoReply and Email Filters with Sieve

Yeah I’ve been thinking about it, it’s mostly because I disagree with the ghettoforge path, I feel it’ll just repeat itself next security update versus the official repo, it’s the state of centos repo, try to find a yum repo for imagick for lsphp. So naturally, I prefer to answer other path, until I get 10+ dm of endless text from people adamant they’ll never ever try official repos, then I give up.

It’s like your solution to OWASP issues "This domain does not exists" error - #10 by Dreamer which is “disable 949-BLOCKING-EVALUATION”, this remove any blocking and evaluation, makes the whole ruleset useless. It’s useful in a way, like you can fix any firewall issues if you just open all the ports. This is appalling to me, but I guess super useful if you don’t know.

What is your point to even be here?
To be arrogant, rude, try make people feel idiot whith your god tier knowledge?
You don’t need to be arrogant when helping people on forums, if you get annoyed from people asking maybe better not even try

Exactly the question I ask you, what you contribute to this discussion? Are you having an issue with sieve? Something to contribute to fix the problem? I answered everything and fixed the issue, I think I can be frustrated when people refuse to send their errors or even try to install a package themselves and instead send me endless messages non technical message like you do

So sorry if I hurt your feelings. :cry:

Yeah we know you have no solution, or nothing to contribute to the discussion, some might say you just join to complain about me… almost attack…

Like I mentioned, I don’t like the solution, because to remind you, I found the solution. I think it’s better to move to official repo than expecting ghettoforge long term to not mess up, but people disagree, so I presented both solution ( after much DM and much pushing because people apparently hate dovecot official repo ), let people pick. It’s like I disagree to your solution that any OWASP issues can be fixed by removing the one file that actually do any rejecting making the whole thing useless, but it works, just like removing reject in firewalls. It’s related to the solution. I personally don’t care how people run their server, or if they listen to you, more money for me when things breaks! Maybe next time I’ll be inspired by you and just teach people to downgrade, it used to work!

You are “bragging” and complaining in the same post.

You brag that you found a solution that does NOT work.

You also complain about people posting blurred/painted-over photos, where NOTHING was capped out of the image, except for unneeded commands done over the line posted.

damn the drama on this thread…

What doesn’t work about it? Like mentioned many times, you need to install dovecot-pigeonhole to go over your error message it was so secretive I had to ask many time for you to send it. I did the whole handholding since “install dovecot-pigeonhole” was too cryptic.

Either ghettoforge or official dovecot, up to you.

For CentOS 8 and AlmaLinux, the correct way is actually yum install --enablerepo=gf-plus dovecot23-pigeonhole -y.

Hi!
I followed all steps in a test fresh installed CentOS 7 server, first I was unable to install Sieve using the command in the post:

sudo yum install –enablerepo=gf-plus install dovecot23-pigeonhole -y

But I was able to install it using the following command, thanks to @entoutcas :

yum --enablerepo=gf-plus -y install dovecot23-pigeonhole

But after I finished all steps except adding the Sieve filter as the interface is different and complicated, I tried to check if email is still working as normal, but the server is no more receiving emails, and when checked logs and googled a lot, I came to the following error in dovecot-lda-errors.log file:

2022-10-28 09:54:12 lda(2098): Fatal: Plugin 'autocreate' not found from directory /usr/lib64/dovecot

Googling about it clarify that the latest version of dovecot is no more using autocreate plugin, but it is using namespace instead, but I can’t modify the dovecot config file to use the new syntax:
https://doc.dovecot.org/settings/plugin/autocreate-plugin/
Any help please?

Magento 2 Payment Restrictions limits additionally make use of superior catalog alternatives and coupon codes. You can restrict fee alternatives while a purchaser makes use of a chit code or a product is sure with the aid of using sure catalog policies. For example, you may save your, clients, from the usage of “coins on transport” or “loose transport” as a fee alternative while making use of a sure coupon code.

I cannot execute this step due to the following error. Could someone please help?

root@debian9mail:~# chown vmail: -R /etc/dovecot/sieve
chown: invalid spec: ‘vmail:’
root@debian9mail:~# 

Here is a problem when i use this i don’t recive mails :slight_smile:

service auth {
unix_listener auth-client {
group = postfix
mode = 0660
user = postfix
}

unix_listener auth-master {
    group = vmail
    mode = 0660
    user = vmail
}

user = root

}

service managesieve-login {
inet_listener sieve {
port = 4190
}
}
service managesieve {
}
protocol sieve {
managesieve_max_line_length = 65536
managesieve_implementation_string = dovecot
log_path = /var/log/dovecot-sieve-errors.log
info_log_path = /var/log/dovecot-sieve.log
}
plugin {
sieve = /home/vmail/dovecot.sieve
sieve_global_path = /etc/dovecot/sieve/default.sieve
sieve_dir = /home/vmail/sieve
sieve_global_dir = /etc/dovecot/sieve/global/
}
lda_mailbox_autocreate = yes
lda_mailbox_autosubscribe = yes
protocol lda {
mail_plugins = $mail_plugins autocreate sieve quota
postmaster_address = [email protected]
hostname = mail.mydomain.com
auth_socket_path = /var/run/dovecot/auth-master
log_path = /var/log/dovecot-lda-errors.log
info_log_path = /var/log/dovecot-lda.log
}
protocol lmtp {
mail_plugins = $mail_plugins autocreate sieve quota
log_path = /var/log/dovecot-lmtp-errors.log
info_log_path = /var/log/dovecot-lmtp.log
}[quote=“crazy92, post:46, topic:30637, full:true”]
service auth {
unix_listener auth-client {
group = postfix
mode = 0660
user = postfix
}

unix_listener auth-master {
    group = vmail
    mode = 0660
    user = vmail
}

user = root

}

service managesieve-login {
inet_listener sieve {
port = 4190
}
}
service managesieve {
}
protocol sieve {
managesieve_max_line_length = 65536
managesieve_implementation_string = dovecot
log_path = /var/log/dovecot-sieve-errors.log
info_log_path = /var/log/dovecot-sieve.log
}
plugin {
sieve = /home/vmail/dovecot.sieve
sieve_global_path = /etc/dovecot/sieve/default.sieve
sieve_dir = /home/vmail/sieve
sieve_global_dir = /etc/dovecot/sieve/global/
}
lda_mailbox_autocreate = yes
lda_mailbox_autosubscribe = yes
protocol lda {
mail_plugins = $mail_plugins autocreate sieve quota
postmaster_address = [email protected]
hostname = mail.mydomain.com
auth_socket_path = /var/run/dovecot/auth-master
log_path = /var/log/dovecot-lda-errors.log
info_log_path = /var/log/dovecot-lda.log
}
protocol lmtp {
mail_plugins = $mail_plugins autocreate sieve quota
log_path = /var/log/dovecot-lmtp-errors.log
info_log_path = /var/log/dovecot-lmtp.log
}

Hi,
My mailserver is working and a testing score 10/10. Now want to implement this feature. But have some doubt on it. I will point out my setting before implementing.

  1. Protocols are imap & pop3. It just says add sieve, but seems need to add lmtp and sieve as protocol.

  2. In the instructions says to add the config at the end of dovecot, but some settings have been set up before:

unix_listener auth-master {
mode = 0660
user = vmail
}
Do I need to add the group? as:
unix_listener auth-master {
group = vmail
mode = 0660
user = vmail
}

  1. auth-client wasn’t there and it authenticated. Is it necessary to add the following?
    unix_listener auth-client {
    group = postfix
    mode = 0660
    user = postfix
    }

  2. The protocol lda block was set. I suppose I need to merge it with your provided lines rather than add another block.
    protocol lda {
    mail_plugins = $mail_plugins autocreate sieve quota

    log_path = /var/log/dovecot-lda-errors.log
    info_log_path = /var/log/dovecot-lda.log
    }

That’s it, thankyou!


Append “sieve” after ‘lmtp’ in protocols on the first line:

protocols = imap pop3 lmtp sieve

After that, add the following lines at the end of the config file and save the file:

service auth {
    unix_listener auth-client {
        group = postfix
        mode = 0660
        user = postfix
    }

    unix_listener auth-master {
        group = vmail
        mode = 0660
        user = vmail
    }

    user = root
}

service managesieve-login {
  inet_listener sieve {
    port = 4190
  }
}
service managesieve {
}
protocol sieve {
    managesieve_max_line_length = 65536
    managesieve_implementation_string = dovecot
    log_path = /var/log/dovecot-sieve-errors.log
    info_log_path = /var/log/dovecot-sieve.log
}
plugin {
    sieve = /home/vmail/dovecot.sieve
    sieve_global_path = /etc/dovecot/sieve/default.sieve
    sieve_dir = /home/vmail/sieve
    sieve_global_dir = /etc/dovecot/sieve/global/
}
lda_mailbox_autocreate = yes
lda_mailbox_autosubscribe = yes
protocol lda {
    mail_plugins = $mail_plugins autocreate sieve quota
    postmaster_address = [email protected]
    hostname = mail.mydomain.com
    auth_socket_path = /var/run/dovecot/auth-master
    log_path = /var/log/dovecot-lda-errors.log
    info_log_path = /var/log/dovecot-lda.log
}
protocol lmtp {
    mail_plugins = $mail_plugins autocreate sieve quota
    log_path = /var/log/dovecot-lmtp-errors.log
    info_log_path = /var/log/dovecot-lmtp.log
}

Are filters applied to all accounts? Doesn’t it matter if they are from different domains?

Filter is managed on every email.
They do not work with other emails.
Unless you have already forwarded the other emails to 1 email.
Then you can use that filter on 1 email to move emails forwarded from another email.

Same here.
Ubuntu server 22.04

Nov 30 11:35:35 localhost postfix/qmgr[77609]: 25018129E8D: from=[email protected], size=8031, nrcpt=1 (queue active)
Nov 30 11:35:35 localhost postfix/pipe[77613]: 25018129E8D: to=[email protected], relay=dovecot, delay=0.05, delays=0.03/0/0/0.02, dsn=4.3.0, status=deferred (temporary failure)

I had same problem with ubuntu 22.04, it seems like there is no more autocreate plugin on latest dovecot version. autocreate plugin — Dovecot documentation

you can just remove all autocreate from mail_plugins.

I still have one error:
lda([email protected])<124352>: Error: User [email protected] doesn’t have home dir set, disabling duplicate database

sending and receiving is working after removing autocreate plugin from config.

I’m facing a problem where the vacation day interval isn’t being honored. I checked if it’s actually in the sieve script and it is :days 3

Any ideas? Thanks.

I can confirm the original post is working on Ubuntu 22.04 LTS with the following fixes and caveats:

  1. Always run sudo apt-get update or equivalent before making changes to CyperPanel and its components. Otherwise you risk mismatch in component versions.

  2. In step 2, append “sieve” AND ‘lmtp’ in protocols on the first line of /etc/dovecot/dovecot.conf:

protocols = imap pop3 lmtp sieve

  1. Again in dovecot.conf pay attention to these lines and replace with your domain:
postmaster_address = [email protected]
hostname = mail.mydomain.com

@usmannasir it would be nice to point this out in the guide, since the code snippet is long and it’s not immediately apparent that changes should be made to it.

  1. Again in dovecot.conf: the autocreate plugin has been deprecated for a long time and is no more included in dovecot. So remove it from the list of active plugins in this line:
    mail_plugins = $mail_plugins autocreate sieve quota
    THE LINE APPEARS TWICE, under protocol lda { and protocol lmtp {
    it should then read:
    mail_plugins = $mail_plugins sieve quota
    I did NOT remove the line lda_mailbox_autocreate = yes

  2. The fixed line in Step 4, when doing nano /etc/postfix/master.cf is wrong, as it is identical to the outdated one. The correct one is available in the linked reference and reads:

dovecot   unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient}

It should already be in master.cf though, so check before adding it.

I’m waiting for expiration of a vacation day interval to check if I get the same problem as @T21 . I installed Sieve today, so it will take some time.

This post summarizes various threads and comments, that I cannot recall and credit. But I’d like to thank all the users whose posts helped me to get Sieve working.

Have a nice day

In my case, the filter applies to all accounts and domains equally, what would be the problem?

[root@MYSERVER /home] # locate .sieve
/home/vmail/dovecot.sieve
/home/vmail/sieve/SPAM-TEST.sieve
/home/vmail/sieve/rainloop.user.sieve

Support snappymail
" Just what i thought. Somehow your configuration has a fault.
Sieve should be configured per user."

I share the solution to my problem

plugin {
    sieve = /home/vmail/%d/dovecot.sieve
    sieve_global_path = /etc/dovecot/sieve/default.sieve
    sieve_dir = /home/vmail/%d/sieve
    sieve_global_dir = /etc/dovecot/sieve/global/
}

create a configuration for each domain