Re: Notifications to over-quota accounts

2024-03-15 Thread Urban Loesch via dovecot

Hi,

I'm sending warnings to accounts when their quota gets up to 80% and again on 
95%.

Relevant parts from "doveconf -n":

...
service quota-warning {
  executable = script /usr/local/bin/quota-warning.sh
  unix_listener quota-warning {
user = mailstore
  }
  user = mailstore
}


plugin {
...
  quota = count:User quota
  quota_rule2 = Trash:storage=+100M
  quota_status_nouser = DUNNO
  quota_status_overquota = 552 5.2.2 Mailbox is full
  quota_status_success = DUNNO
  quota_vsizes = yes
  quota_warning = storage=95%% quota-warning 95 %u
  quota_warning2 = storage=80%% quota-warning 80 %u
...
}

Bash script:
...
#!/bin/sh
PERCENT=$1
USER=$2
DATE=`date`
MSGID_P1=`date '+%Y%m%d%H%M%S'`
MSGID_P2=`hostname`
MSGID=$MSGID_P1@$MSGID_P2
logger -p mail.info -t dovecot "$PERCENT% Quota-warning sent to $USER"
cat << EOF | /usr/lib/dovecot/dovecot-lda -d $USER -o "plugin/quota=count:User 
quota:noenforcing"
From: 
To: <$USER>
Subject: $PERCENT% Mail quota warning
Message-ID: <$MSGID>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Date: $DATE

Your text
...


Best
Urban




Am 15.03.24 um 12:58 schrieb N V:

Hello!
I'm trying to allow a system email address to send notifications to over-quota
accounts.
Is there a way to do it?

Thanks in advance!


___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Re: Question about sieve language

2024-03-15 Thread Tom Hendrikx via dovecot




On 14-03-2024 12:51, Ralph Seichter via dovecot wrote:

* Tom Hendrikx via dovecot:


Or in readable sieve: [...]


Do you mean to imply that regular expressions are not readable? ;-) All
it takes is a little practice. Besides, regex are more efficient. It is
well worth learning about them, and regex are really not as bad as some
make them out to be.



In general, I think regular expressions are fine, but less readable than 
simple statements (I'm well versed in regex).


The one thing that made me fall in love with sieve is the fact that the 
syntax is so wonderfully clear and self-documenting, almost readable as 
normal language. I never need to add comments to a sieve script 
explaining to my future self what a specific rule tries to achieve.


And given the amount of work that a sieve script does, I don't think 
that optimization is something you should strive for, when you have to 
trade it for readability and clarity.


Just my preference :)

Kind regards,
Tom
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Re: Notifications to over-quota accounts

2024-03-15 Thread Markus Bach

Hi,


The only way to deliver mails to accounts that are over quota that I can 
think of is using the lda.


There is an example in the manual 
(https://doc.dovecot.org/configuration_manual/quota/#example-configuration) 
that shows how to do that.



Mit freundlichen Grüßen

Markus Bach

IT-Systemadministration

PEGASUS GmbH Gesellschaft für
soziale/gesundheitliche Innovation
IT-Systemleistungen
Brunowstr. 52
13507 Berlin

Hotline: +49 (30) 31 98 31 200
E-Mail: supp...@pegasusgmbh.de
Web: https://www.pegasusgmbh.de

Sitz der Gesellschaft:
PEGASUS GmbH Gesellschaft für
soziale/gesundheitliche Innovation
Potsdamer Str. 98
10785 Berlin

Geschäftsführer: Friedrich Kiesinger
Registergericht: Amtsgericht Berlin Charlottenburg
Registernummer: HRB 69935 B

Hinweise im Umgang mit personenbezogenen Daten: 
https://www.pegasusgmbh.de/datenschutz

On 3/15/24 12:58, N V wrote:

Hello!
I'm trying to allow a system email address to send notifications to over-quota
accounts.
Is there a way to do it?

Thanks in advance!

___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Notifications to over-quota accounts

2024-03-15 Thread N V
Hello!
I'm trying to allow a system email address to send notifications to over-quota
accounts.
Is there a way to do it?

Thanks in advance!
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Re: antispoofing with dovecot submission

2024-03-15 Thread Kees van Vloten



On 15-03-2024 08:10, Aki Tuomi via dovecot wrote:

On 14/03/2024 17:28 EET dovecot--- via dovecot  wrote:

  

it is possible to do antispoofing, like
reject_authenticated_sender_login_mismatch from postfix ?


I could be wrong, but i believe dovecot submission is only a proxy to postfix 
submission. Dovecot does not directly delivery mail to the world. Meaning the 
mail is still passing through postfix and 
reject_authenticated_sender_login_mismatch would still be applied.


Indeed it does, I use this exact configuration and it works as expected.

- Kees.



My follow up question would be does dovecot queue the mail or proxy it live? If 
postfix rejected the submission based on something like 
reject_authenticated_sender_login_mismatch does the email client get sent the 
error live by dovecot submission, or would a type of backscatter bounce be 
created between postfix and dovecot?

Dovecot submission is only a relay. It will not queueing or anything like that, 
it always requires a live, functional MTA to back it up. If MTA does not reject 
the mail during sending, then what happens next is up to the MTA.

Aki
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Re: [EXT] Re: How to get a memory pointer in the core process

2024-03-15 Thread Jochen Bern

On 14.03.24 21:21, Joan Moreau wrote:

I am trying to avoid closing/ reopening a file pointer to the exact same file
between each call to the plugin


That's still a "what" and not a "why". Long before you'll run into any 
serious resource problem, that file will be firmly seated in the disk 
cache and (r/o) accessing it will *effectively* be done in RAM; probably 
still not quite as efficient as Shared Memory, but.


I seriously doubt that the dovecot developers will want to make their 
software into the plugins' new memory manager, replacing the kernel in 
that role - having a plugin run amok and cause the master dovecot 
process to abort due to OOM sounds like creating an even worse problem, 
frankly ...


Kind regards,
--
Jochen Bern
Systemingenieur

Binect GmbH


smime.p7s
Description: S/MIME Cryptographic Signature
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Re: dovecot panic

2024-03-15 Thread Aki Tuomi via dovecot

> On 15/03/2024 10:53 EET Michael Grant via dovecot  wrote:
> 
>  
> I'm running dovecot 2.3.19.1 on debian stable.  I just started seeing a 
> slew of these in my log:
> 
> Mar 14 10:02:38 strange.networkguild.org dovecot[865654]: 
> imap(mgrant)<1939553>: Panic: file istream-header-filter.c: 
> line 663 (i_stream_header_filter_snapshot_free): assertion failed: 
> (snapshot->mstream->snapshot_pending)
> Mar 14 10:02:38 strange.networkguild.org dovecot[865654]: 
> imap(mgrant)<1939553>: Error: Raw backtrace: #0 
> test_subprocess_fork[0x7f1a33d7ca20] -> #1 backtrace_append[0x7f1a33d7cc90] 
> -> #2 backtrace_get[0x7f1a33d7ce20] -> #3 execvp_const[0x7f1a33d89f90] -> #4 
> i_syslog_fatal_handler[0x7f1a33d8a900] -> #5 i_panic[0x7f1a33ce00a4] -> #6 
> fs_wrapper_unlock[0x7f1a33cdb71d] -> #7 
> i_stream_snapshot_free[0x7f1a33d96110] -> #8 i_stream_unref[0x7f1a33d96180] 
> -> #9 index_mail_get_virtual_size[0x7f1a33f2d190] -> #10 
> index_mail_save_finish[0x7f1a33f2d470] -> #11 
> index_mail_get_special[0x7f1a33f2d690] -> #12 
> mail_get_special[0x7f1a33eaf950] -> #13 cmd_select[0x560714f983e0] -> #14 
> imap_fetch_begin[0x560714f9d170] -> #15 imap_fetch_more[0x560714f9d550] -> 
> #16 cmd_fetch[0x560714f91c00] -> #17 command_exec[0x560714f9a880] -> #18 
> cmd_x_cancel[0x560714fa0510] -> #19 cmd_x_cancel[0x560714fa0510] -> #20 
> cmd_x_cancel[0x560714fa0510] -> #21 client_handle_input[0x560714fa0880] -> 
> #22 client_input[0x560714fa0d80] -> #23 io_loop_call_io[0x7f1a33da1c70] -> 
> #24 io_loop_handler_run_internal[0x7f1a33da3970] -> #25 
> io_loop_handler_run[0x7f1a33da3b00] -> #26 io_loop_run[0x7f1a33da3cd0] -> #27 
> master_service_run[0x7f1a33d14180] -> #28 main[0x560714f8ca00] -> #29 
> __libc_init_first[0x7f1a33ac51d0] -> #30 __libc_start_main[0x7f1a33ac5280] -> 
> #31 _start[0x560714f8d000]
> 
> I realize this is a slightly old version of dovecot but this is what's in 
> debian's stable package repository.  I see 2.3.21+dfsg1-2 in testing and 
> 2.3.21+dfsg1-3 in unstable.  I really try to avoid installing this on 
> production.
> 
> I didn't recently change anything in my configs on the server.  I did start 
> recently using 'eM Client' on Windows a couple days ago, could that have 
> caused this?  Mail seems to continue to come in to my imap clients, but these 
> errors in the log are worrying!
> 
> Michael GrantI'm running dovecot 2.3.19.1 on debian stable.  I just started 
> seeing a slew of
> these in my log:
> 
> Mar 14 10:02:38 strange.networkguild.org dovecot[865654]: imap
> (mgrant)<1939553>: Panic: file istream-header-filter.c: line
> 663 (i_stream_header_filter_snapshot_free): assertion failed: (snapshot-
> >mstream->snapshot_pending)
> Mar 14 10:02:38 strange.networkguild.org dovecot[865654]: imap
> (mgrant)<1939553>: Error: Raw backtrace: #0
> test_subprocess_fork[0x7f1a33d7ca20] -> #1 backtrace_append[0x7f1a33d7cc90] -
> > #2 backtrace_get[0x7f1a33d7ce20] -> #3 execvp_const[0x7f1a33d89f90] -> #4
> i_syslog_fatal_handler[0x7f1a33d8a900] -> #5 i_panic[0x7f1a33ce00a4] -> #6
> fs_wrapper_unlock[0x7f1a33cdb71d] -> #7 i_stream_snapshot_free[0x7f1a33d96110]
> -> #8 i_stream_unref[0x7f1a33d96180] -> #9 index_mail_get_virtual_size
> [0x7f1a33f2d190] -> #10 index_mail_save_finish[0x7f1a33f2d470] -> #11
> index_mail_get_special[0x7f1a33f2d690] -> #12 mail_get_special[0x7f1a33eaf950]
> -> #13 cmd_select[0x560714f983e0] -> #14 imap_fetch_begin[0x560714f9d170] -
> > #15 imap_fetch_more[0x560714f9d550] -> #16 cmd_fetch[0x560714f91c00] -> #17
> command_exec[0x560714f9a880] -> #18 cmd_x_cancel[0x560714fa0510] -> #19
> cmd_x_cancel[0x560714fa0510] -> #20 cmd_x_cancel[0x560714fa0510] -> #21
> client_handle_input[0x560714fa0880] -> #22 client_input[0x560714fa0d80] -> #23
> io_loop_call_io[0x7f1a33da1c70] -> #24 io_loop_handler_run_internal
> [0x7f1a33da3970] -> #25 io_loop_handler_run[0x7f1a33da3b00] -> #26 io_loop_run
> [0x7f1a33da3cd0] -> #27 master_service_run[0x7f1a33d14180] -> #28 main
> [0x560714f8ca00] -> #29 __libc_init_first[0x7f1a33ac51d0] -> #30
> __libc_start_main[0x7f1a33ac5280] -> #31 _start[0x560714f8d000]
> 
> I realize this is a slightly old version of dovecot but this is what's in
> debian's stable package repository.  I see 2.3.21+dfsg1-2 in testing and
> 2.3.21+dfsg1-3 in unstable.  I really try to avoid installing this on
> production.
> 
> I didn't recently change anything in my configs on the server.  I did start
> recently using 'eM Client' on Windows a couple days ago, could that have 
> caused
> this?  Mail seems to continue to come in to my imap clients, but these errors
> in the log are worrying!
> 
> 

Would you be open to using https://repo.dovecot.org in your production? These 
are debian-compatible packages.

Aki
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


dovecot panic

2024-03-15 Thread Michael Grant via dovecot
I'm running dovecot 2.3.19.1 on debian stable.  I just started seeing a slew of
these in my log:

Mar 14 10:02:38 strange.networkguild.org dovecot[865654]: imap
(mgrant)<1939553>: Panic: file istream-header-filter.c: line
663 (i_stream_header_filter_snapshot_free): assertion failed: (snapshot-
>mstream->snapshot_pending)
Mar 14 10:02:38 strange.networkguild.org dovecot[865654]: imap
(mgrant)<1939553>: Error: Raw backtrace: #0
test_subprocess_fork[0x7f1a33d7ca20] -> #1 backtrace_append[0x7f1a33d7cc90] -
> #2 backtrace_get[0x7f1a33d7ce20] -> #3 execvp_const[0x7f1a33d89f90] -> #4
i_syslog_fatal_handler[0x7f1a33d8a900] -> #5 i_panic[0x7f1a33ce00a4] -> #6
fs_wrapper_unlock[0x7f1a33cdb71d] -> #7 i_stream_snapshot_free[0x7f1a33d96110]
-> #8 i_stream_unref[0x7f1a33d96180] -> #9 index_mail_get_virtual_size
[0x7f1a33f2d190] -> #10 index_mail_save_finish[0x7f1a33f2d470] -> #11
index_mail_get_special[0x7f1a33f2d690] -> #12 mail_get_special[0x7f1a33eaf950]
-> #13 cmd_select[0x560714f983e0] -> #14 imap_fetch_begin[0x560714f9d170] -
> #15 imap_fetch_more[0x560714f9d550] -> #16 cmd_fetch[0x560714f91c00] -> #17
command_exec[0x560714f9a880] -> #18 cmd_x_cancel[0x560714fa0510] -> #19
cmd_x_cancel[0x560714fa0510] -> #20 cmd_x_cancel[0x560714fa0510] -> #21
client_handle_input[0x560714fa0880] -> #22 client_input[0x560714fa0d80] -> #23
io_loop_call_io[0x7f1a33da1c70] -> #24 io_loop_handler_run_internal
[0x7f1a33da3970] -> #25 io_loop_handler_run[0x7f1a33da3b00] -> #26 io_loop_run
[0x7f1a33da3cd0] -> #27 master_service_run[0x7f1a33d14180] -> #28 main
[0x560714f8ca00] -> #29 __libc_init_first[0x7f1a33ac51d0] -> #30
__libc_start_main[0x7f1a33ac5280] -> #31 _start[0x560714f8d000]

I realize this is a slightly old version of dovecot but this is what's in
debian's stable package repository.  I see 2.3.21+dfsg1-2 in testing and
2.3.21+dfsg1-3 in unstable.  I really try to avoid installing this on
production.

I didn't recently change anything in my configs on the server.  I did start
recently using 'eM Client' on Windows a couple days ago, could that have caused
this?  Mail seems to continue to come in to my imap clients, but these errors
in the log are worrying!

Michael Grant
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Re: antispoofing with dovecot submission

2024-03-15 Thread Aki Tuomi via dovecot


> On 14/03/2024 17:28 EET dovecot--- via dovecot  wrote:
> 
>  
> > it is possible to do antispoofing, like
> > reject_authenticated_sender_login_mismatch from postfix ?
> 
> 
> I could be wrong, but i believe dovecot submission is only a proxy to postfix 
> submission. Dovecot does not directly delivery mail to the world. Meaning the 
> mail is still passing through postfix and 
> reject_authenticated_sender_login_mismatch would still be applied.
> 
> My follow up question would be does dovecot queue the mail or proxy it live? 
> If postfix rejected the submission based on something like 
> reject_authenticated_sender_login_mismatch does the email client get sent the 
> error live by dovecot submission, or would a type of backscatter bounce be 
> created between postfix and dovecot?

Dovecot submission is only a relay. It will not queueing or anything like that, 
it always requires a live, functional MTA to back it up. If MTA does not reject 
the mail during sending, then what happens next is up to the MTA.

Aki
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org