New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/dovecot: add support for sieve extensions, in particular imapsieve and pipe #275031
Conversation
6c895c1
to
e619533
Compare
from = mkOption { | ||
default = null; | ||
description = '' | ||
Only execute the administrator Sieve scripts for the mailbox configured with services.dovecot2.imapsieve.mailbox.${name}.name when the message originates from the indicated mailbox. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if you can refer to ${name}
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you build the manual? I wanted to check how it looks in there when I wrote this but couldn't figure out a way to do it :D
What would you write instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd just do <name>
or *
, this is the convention I usually see.
@@ -459,4 +622,5 @@ in | |||
|
|||
}; | |||
|
|||
meta.maintainers = [lib.maintainers.dblsaiko]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meta.maintainers = [lib.maintainers.dblsaiko]; | |
meta.maintainers = [ lib.maintainers.dblsaiko ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; untested.
e619533
to
a4fcdd4
Compare
a4fcdd4
to
7004ee6
Compare
@2xsaiko This broke my production deployment of dovecot2 with the following error:
|
This probably misinteracts with https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/blob/master/mail-server/dovecot.nix?ref_type=heads#L310-330. |
After manual fixups, that is adding:
It still complains with:
but is now not broken anymore. |
…ipts` NixOS#275031 introduced structured configuration for the dovecot2 sieve plugin, by doing so, it broke SNM configuration doing Sieve configurations. This attempts to fix up the public API to make it possible for SNM to pick up the pieces.
…ipts` NixOS#275031 introduced structured configuration for the dovecot2 sieve plugin, by doing so, it broke SNM configuration doing Sieve configurations. This attempts to fix up the public API to make it possible for SNM to pick up the pieces.
Hmm, that most likely comes from line 31 in dovecot-2.3.21/src/lib-old-stats/stats-connection.c which is called from line 394 in dovecot-2.3.21/src/plugins/old-stats/stats-plugin.c. Are you sure that error wasn't there before? This change isn't loading the old-stats plugin and I'm not getting that error either (it's also deprecated). Either way, it shouldn't be fatal from what I can see. |
You are probably right on the fact this existed before, I am just finishing
mitigating the rest and then I will look further.
Le dim. 14 janv. 2024, 21:22, Marco Rebhan ***@***.***> a
écrit :
… Jan 14 20:43:39 amadeus dovecot2-pre-start[3701122]: sievec: Error: stats: open(/run/dovecot2/old-stats-mail) failed: No such file or directory
Jan 14 20:43:39 amadeus dovecot2-pre-start[3701174]: sievec: Error: stats: open(/run/dovecot2/old-stats-mail) failed: No such file or directory
Jan 14 20:43:40 amadeus dovecot2-pre-start[3701175]: sievec: Error: stats: open(/run/dovecot2/old-stats-mail) failed: No such file or directory
Hmm, that most likely comes from line 31 in
dovecot-2.3.21/src/lib-old-stats/stats-connection.c which is called from
line 394 in dovecot-2.3.21/src/plugins/old-stats/stats-plugin.c. Are you
sure that error wasn't there before? This change isn't loading the
old-stats plugin and I'm not getting that error either (it's also
deprecated). Either way, it shouldn't be fatal from what I can see.
—
Reply to this email directly, view it on GitHub
<#275031 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACMZREWULI3PVG47O5LYKTYOQ5APAVCNFSM6AAAAABAYQEB76VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJRGA3DENJSG4>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
idx: el: | ||
singleton "imapsieve_mailbox${toString idx}_name = ${el.name}" | ||
++ optional (el.from != null) "imapsieve_mailbox${toString idx}_from = ${el.from}" | ||
++ optional (el.causes != null) "imapsieve_mailbox${toString idx}_causes = ${el.causes}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have been a list, I believe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, it should have. My bad!
…ipts` NixOS#275031 introduced structured configuration for the dovecot2 sieve plugin, by doing so, it broke SNM configuration doing Sieve configurations. This attempts to fix up the public API to make it possible for SNM to pick up the pieces.
…ipts` NixOS#275031 introduced structured configuration for the dovecot2 sieve plugin, by doing so, it broke SNM configuration doing Sieve configurations. This attempts to fix up the public API to make it possible for SNM to pick up the pieces.
…ipts` NixOS#275031 introduced structured configuration for the dovecot2 sieve plugin, by doing so, it broke SNM configuration doing Sieve configurations. This attempts to fix up the public API to make it possible for SNM to pick up the pieces.
…ipts` NixOS#275031 introduced structured configuration for the dovecot2 sieve plugin, by doing so, it broke SNM configuration doing Sieve configurations. This attempts to fix up the public API to make it possible for SNM to pick up the pieces.
…ipts` NixOS#275031 introduced structured configuration for the dovecot2 sieve plugin, by doing so, it broke SNM configuration doing Sieve configurations. This attempts to fix up the public API to make it possible for SNM to pick up the pieces.
…ipts` NixOS#275031 introduced structured configuration for the dovecot2 sieve plugin, by doing so, it broke SNM configuration doing Sieve configurations. This attempts to fix up the public API to make it possible for SNM to pick up the pieces.
…ipts` NixOS#275031 introduced structured configuration for the dovecot2 sieve plugin, by doing so, it broke SNM configuration doing Sieve configurations. This attempts to fix up the public API to make it possible for SNM to pick up the pieces.
I can confirm this is an issue. We ran into it after a flake bump yesterday. Can test the PR if desired. |
…ipts` NixOS#275031 introduced structured configuration for the dovecot2 sieve plugin, by doing so, it broke SNM configuration doing Sieve configurations. This attempts to fix up the public API to make it possible for SNM to pick up the pieces.
…ipts` NixOS#275031 introduced structured configuration for the dovecot2 sieve plugin, by doing so, it broke SNM configuration doing Sieve configurations. This attempts to fix up the public API to make it possible for SNM to pick up the pieces.
…ipts` #275031 introduced structured configuration for the dovecot2 sieve plugin, by doing so, it broke SNM configuration doing Sieve configurations. This attempts to fix up the public API to make it possible for SNM to pick up the pieces.
…ipts` NixOS#275031 introduced structured configuration for the dovecot2 sieve plugin, by doing so, it broke SNM configuration doing Sieve configurations. This attempts to fix up the public API to make it possible for SNM to pick up the pieces.
…ipts` NixOS#275031 introduced structured configuration for the dovecot2 sieve plugin, by doing so, it broke SNM configuration doing Sieve configurations. This attempts to fix up the public API to make it possible for SNM to pick up the pieces.
…ipts` NixOS#275031 introduced structured configuration for the dovecot2 sieve plugin, by doing so, it broke SNM configuration doing Sieve configurations. This attempts to fix up the public API to make it possible for SNM to pick up the pieces.
…ipts` NixOS#275031 introduced structured configuration for the dovecot2 sieve plugin, by doing so, it broke SNM configuration doing Sieve configurations. This attempts to fix up the public API to make it possible for SNM to pick up the pieces.
…ipts` NixOS#275031 introduced structured configuration for the dovecot2 sieve plugin, by doing so, it broke SNM configuration doing Sieve configurations. This attempts to fix up the public API to make it possible for SNM to pick up the pieces.
Since NixOS/nixpkgs#275031 things have became more structured when it comes to the sieve plugin. Relies on NixOS/nixpkgs#281001 for full features. Former-commit-id: fe6d325397f35eecb51bc77d04cc1a805c98e249
…ipts` NixOS#275031 introduced structured configuration for the dovecot2 sieve plugin, by doing so, it broke SNM configuration doing Sieve configurations. This attempts to fix up the public API to make it possible for SNM to pick up the pieces.
…ipts` NixOS#275031 introduced structured configuration for the dovecot2 sieve plugin, by doing so, it broke SNM configuration doing Sieve configurations. This attempts to fix up the public API to make it possible for SNM to pick up the pieces.
Description of changes
Finally upstreaming some stuff from my config that I've been running for years. This is used on my mail server, where I use it to drive automatic learning for the spam filter. In action here: https://git.dblsaiko.net/systems/tree/configurations/polaris/dovecot.nix?id=8ea672890c78b059e002920628636234c7541c1f#n54
Adds general support for enabling Sieve plugins/extensions, support for the IMAPSieve plugin and support for specifying which binaries are available from the vnd.dovecot.pipe extension (part of the Extprograms plugin). IMAPSieve is used to trigger Sieve scripts on IMAP user actions, like moving mails around. vnd.dovecot.pipe can be used to run external programs from a Sieve script, for example passing the mail to rspamd to register it as spam.
Documentation for the IMAPSieve plugin: https://doc.dovecot.org/configuration_manual/sieve/plugins/imapsieve/
Documentation for the Extprograms plugin: https://doc.dovecot.org/configuration_manual/sieve/plugins/extprograms/
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.