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

2024-03-13 Thread Joan Moreau via dovecot
No, you don´t understand
There is a core process (/usr/bin/dovecot) running all the time. So I want to
allocate a memory block, the core process keep it and it is retrievable by the
pluging when laded again
At exit of /usr/bin/dovecot, it just does a "delete()" of the said allocation


On 2024-03-14 13:25, Aki Tuomi via dovecot wrote:
 Hi!

 Sorry but that's just not possible, ther is no "core" where to create
 such object. There is no "dovecot" where to store things.

 When user logs in, dovecot executes /usr/libexec/dovecot/imap and
 transfers the connection fd there. then plugins and stuff are loaded,
 and the user does what he does, and then plugins and stuff are
 unloaded and process exists and no longer exists in memory.

 You are clearly asking about memory persistence between sessions, and
 this can be done with

 a) services (internal or external), such as redis, sql, or something
 else
 b) storing things to disk

 Aki

  On 13/03/2024 18:45 EET Joan Moreau via dovecot
   wrote:

   
  No, I am not referring to that

  I want to create an object at first call in memory

  that object would be retrievable at second and furthers
  calls of the
  plugin, as long as dovecot is running

  On 2024-03-13 16:29, Aki Tuomi via dovecot wrote:

   Not really no. You should use e.g. dict inteface
   for storing this kind
   of stateful data. When deinit is called the
   calling core process will
   likely die too.

   Aki

   On 13/03/2024 10:19 EET Joan Moreau
wrote:

   Keep a pointer in memory retrievable each time a
   plugin is called

   So the plugin keep the memory, not has to restart
   everything at each
   call

   On 12 March 2024 08:53:38 Aki Tuomi via dovecot
   
   wrote:

   On 11/03/2024 10:42 EET Joan Moreau
wrote:

   Hi
   Is it possible, from a plugin perspective, to
   create and recover a
   pointer in the core process (i.e. memory not lost
   between 2 calls to
   the plugin, even after the "deinit" of the
   plugin" ) ?

   Thanks
   Hi Joan!

   May I ask what you are attempting to achieve in
   more detail?

   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-
  leave@dovecot.orgNo, I am not referring to that
  I want to create an object at first call in memory
  that object would be retrievable at second and furthers
  calls of the plugin, as
  long as dovecot is running




  On 2024-03-13 16:29, Aki Tuomi via dovecot wrote:
       Not really no. You should use e.g. dict inteface for
  storing this
       kind of stateful data. When deinit is called the
  calling core process
       will likely die too.

       Aki

            On 13/03/2024 10:19 EET Joan Moreau
   wrote:


            Keep a pointer in memory retrievable each time a
  plugin is
            called

            So the plugin keep the memory, not has to restart
            everything at each call



            On 12 March 2024 08:53:38 Aki Tuomi via dovecot
             wrote:

                      On 11/03/2024 10:42 EET Joan Moreau
                       wrote:


                      Hi
                      Is it possible, from a plugin
                      perspective, to create and recover a
                      pointer in the core process (i.e.
                      memory not lost between 2 calls to the
                      plugin, even after the "deinit" of the
                      plugin" ) ?

                      Thanks

                 Hi Joan!

                 May I ask what you are attempting to achieve
  in
                 more detail?

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

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

2024-03-13 Thread Aki Tuomi via dovecot
Hi!

Sorry but that's just not possible, ther is no "core" where to create such 
object. There is no "dovecot" where to store things.

When user logs in, dovecot executes /usr/libexec/dovecot/imap and transfers the 
connection fd there. then plugins and stuff are loaded, and the user does what 
he does, and then plugins and stuff are unloaded and process exists and no 
longer exists in memory.

You are clearly asking about memory persistence between sessions, and this can 
be done with

a) services (internal or external), such as redis, sql, or something else
b) storing things to disk

Aki

> On 13/03/2024 18:45 EET Joan Moreau via dovecot  wrote:
> 
>  
> No, I am not referring to that
> 
> I want to create an object at first call in memory
> 
> that object would be retrievable at second and furthers calls of the 
> plugin, as long as dovecot is running
> 
> On 2024-03-13 16:29, Aki Tuomi via dovecot wrote:
> 
> > Not really no. You should use e.g. dict inteface for storing this kind 
> > of stateful data. When deinit is called the calling core process will 
> > likely die too.
> > 
> > Aki
> > 
> > On 13/03/2024 10:19 EET Joan Moreau  wrote:
> > 
> > Keep a pointer in memory retrievable each time a plugin is called
> > 
> > So the plugin keep the memory, not has to restart everything at each 
> > call
> > 
> > On 12 March 2024 08:53:38 Aki Tuomi via dovecot  
> > wrote:
> > 
> > On 11/03/2024 10:42 EET Joan Moreau  wrote:
> > 
> > Hi
> > Is it possible, from a plugin perspective, to create and recover a 
> > pointer in the core process (i.e. memory not lost between 2 calls to 
> > the plugin, even after the "deinit" of the plugin" ) ?
> > 
> > Thanks
> > Hi Joan!
> > 
> > May I ask what you are attempting to achieve in more detail?
> > 
> > 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-leave@dovecot.orgNo, I am not 
> referring to that
> I want to create an object at first call in memory
> that object would be retrievable at second and furthers calls of the plugin, 
> as
> long as dovecot is running
> 
> 
> 
> 
> On 2024-03-13 16:29, Aki Tuomi via dovecot wrote:
>  Not really no. You should use e.g. dict inteface for storing this
>  kind of stateful data. When deinit is called the calling core process
>  will likely die too.
> 
>  Aki
> 
>   On 13/03/2024 10:19 EET Joan Moreau  wrote:
> 
> 
>   Keep a pointer in memory retrievable each time a plugin is
>   called
> 
>   So the plugin keep the memory, not has to restart
>   everything at each call
> 
> 
> 
>   On 12 March 2024 08:53:38 Aki Tuomi via dovecot
>wrote:
> 
> On 11/03/2024 10:42 EET Joan Moreau
>  wrote:
> 
> 
> Hi
> Is it possible, from a plugin
> perspective, to create and recover a
> pointer in the core process (i.e.
> memory not lost between 2 calls to the
> plugin, even after the "deinit" of the
> plugin" ) ?
> 
> Thanks
> 
>Hi Joan!
> 
>May I ask what you are attempting to achieve in
>more detail?
> 
>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
> 
> ___
> 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-13 Thread Tom Hendrikx via dovecot




On 13-03-2024 17:36, Ralph Seichter via dovecot wrote:

* Lev Serebryakov:


I need to match all messages sent from some specific domain and all
its sub-domains.


I prefer using regular expressions for this kind of tests:

   if address :regex "From" "[@.]example\.(com|org)$" {...}

This will match all addresses for example.com, example.org and their
respective subdomains.



Or in readable sieve:

if anyof (
address :domain :is "From" "example.org",
address :domain :contains "From" ".example.org"
) { keep; }

Which might match "subdomain.example.org.gotcha.com", but how often 
would that happen?


Kind regards,

Tom
___
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-13 Thread Joan Moreau via dovecot
No, I am not referring to that
I want to create an object at first call in memory
that object would be retrievable at second and furthers calls of the plugin, as
long as dovecot is running




On 2024-03-13 16:29, Aki Tuomi via dovecot wrote:
 Not really no. You should use e.g. dict inteface for storing this
 kind of stateful data. When deinit is called the calling core process
 will likely die too.

 Aki

  On 13/03/2024 10:19 EET Joan Moreau  wrote:


  Keep a pointer in memory retrievable each time a plugin is
  called

  So the plugin keep the memory, not has to restart
  everything at each call



  On 12 March 2024 08:53:38 Aki Tuomi via dovecot
   wrote:

On 11/03/2024 10:42 EET Joan Moreau
 wrote:


Hi
Is it possible, from a plugin
perspective, to create and recover a
pointer in the core process (i.e.
memory not lost between 2 calls to the
plugin, even after the "deinit" of the
plugin" ) ?

Thanks

   Hi Joan!

   May I ask what you are attempting to achieve in
   more detail?

   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

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


Re: Question about sieve language

2024-03-13 Thread Ralph Seichter via dovecot
* Lev Serebryakov:

> I need to match all messages sent from some specific domain and all
> its sub-domains.

I prefer using regular expressions for this kind of tests:

  if address :regex "From" "[@.]example\.(com|org)$" {...}

This will match all addresses for example.com, example.org and their
respective subdomains.

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


Question about sieve language

2024-03-13 Thread Lev Serebryakov

Hello!

  I need to match all messages sent from some specific domain and all its 
sub-domains. I can achieve this with:

  if address :match :domain "From" [ "domain.com", "*.domain.com" ] { ... }

  But it looks ugly, especially if repeated for 5-6 domains.

  Is here way better?  `:match ["*domain.com"]` will match "notdomain.com" and `:is [ 
"domain.com" ] doesn't match sub-domains.

  I understand, that it is (slightly?) off-topic, but I can not find any 
sieve-specific resources (all google find ins questions about PronotMail and 
FastMail filters, and these questions are very basic).

Thank you.

--
// Black Lion AKA Lev Serebryakov
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


dovecot and solr clustering

2024-03-13 Thread Maciej Milaszewski
Hi
I have 1 director and ~8 dovecot nodes. I thinking about Solr cluster beacuse
one server solr probably is not enough.
I thinking about SolrCloud Mode but I don't know if it will work with Dovecot

And if not SolrCloud Mode, then what?

I don't have much experience in Solr clustering and I want to choose the most
optimal solution with scalable aand redundancy
(bare metal servers is not problem)



OpenPGP_signature.asc
Description: OpenPGP digital signature
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Re: Dovecot and SNI

2024-03-13 Thread Peter

On 13/03/24 22:30, Stuart Henderson wrote:

I test with this: openssl s_client -connect mail.domain.com:993 -crlf -quie=
t


That's not a valid test. openssl >=1.1.1 s_client uses SNI by default,
with libressl or older openssl you need to use -servername.


Indeed, you want: openssl s_client -connect mail.example.com:993 
-servername mail.example.com -crlf -quiet


-servername works with newer versions of s_client but is required for 
older versions, if you include it in everything you can't go wrong.



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


quota plugin with virtual user

2024-03-13 Thread noemi

Hi,
I'm having some problems after activating the quota plugin: I followed 
the guide from the doc[0] but I'm having problems with some virtual user.
I understand that,with my conf,the quota plugin check the limit of a 
user and then tell postfix to accept/discard the mail. i have some users 
under my main domain [conf in /etc/passwd] and some virtual user/domains 
[conf in virtusertable/virtdomains as files in postfix]. the virtual 
users use their local user for the login, so dovecot doesn't know they 
are virtual. I think the problem is here, because it is clear that the 
quota-status check is made by dovecot using the virtual user and not the 
local user[1].
understanding the problem doesn't help me in the resolution [other than 
burn everything and rebuild with a single management for local/virtual 
users using a db] but i will prefer a more soft approach. any help?

my complete conf below[2]

thanks,
noemi

[0] https://blog.sys4.de/postfix-dovecot-mailbox-quota-en.html

[1] where the virtual user is m...@virtdomain.com and the local user is 
mail_virtdomain the check is done to user 'mail', thus returning a error:
Nov 16 06:36:09 
quota-status(other-user)<129776>: Error: Failed 
to lookup user m...@virtdomain.com: Mail access for users with UID 8 not 
permitted (see first_valid_uid in config file, uid from userdb lookup).


[2]
# 2.3.4.1 (f79e8e7e4): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.4 ()
# OS: Linux 6.1.0-10-amd64 x86_64 Debian 11.7 zfs
# Hostname: mail-ng.pangea.org
auth_mechanisms = plain login
auth_username_format = %Ln
default_client_limit = 3000
disable_plaintext_auth = no
first_valid_uid = 8
log_path = /var/log/mail.log
mail_location = maildir:/home/%n/Maildir
mail_plugins = " quota"
mail_privileged_group = mail
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope 
encoded-character vacation subaddress comparator-i;ascii-numeric 
relational regex imap4flags copy include variables body enotify 
environment mailbox date index ihave duplicate mime foreverypart extracttext

namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
special_use = \Drafts
  }
  mailbox Junk {
special_use = \Junk
  }
  mailbox Sent {
special_use = \Sent
  }
  mailbox "Sent Messages" {
special_use = \Sent
  }
  mailbox Trash {
special_use = \Trash
  }
  prefix =
}
passdb {
  driver = pam
}
plugin {
  quota = maildir:User quota
  quota_exceeded_message = Quota exceeded, please go to 
https://laweb.pangea.org/contacte/ for instructions on how to fix this.

  quota_grace = 10%%
  quota_max_mail_size = 100M
  quota_status_nouser = DUNNO
  quota_status_overquota = 552 5.2.2 Mailbox is full and cannot receive 
any more emails

  quota_warning = storage=95%% quota-warning 95 %u
  quota_warning2 = storage=80%% quota-warning 80 %u
  sieve = file:~/sieve/;active=~/.dovecot.sieve
  sieve_user_log = /var/log/sieve.log
  sieve_vacation_send_from_recipient = yes
}
protocols = " imap lmtp sieve pop3"
service auth {
  unix_listener /var/spool/postfix/private/dovecot-auth {
group = postfix
mode = 0660
user = postfix
  }
}
service imap-login {
  process_limit = 1024
  service_count = 100
}
service imap {
  process_limit = 1024
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
group = postfix
mode = 0600
user = postfix
  }
}
service pop3-login {
  process_limit = 1024
  service_count = 0
}
service pop3 {
  process_limit = 1024
}
service quota-status {
  client_limit = 1
  executable = quota-status -p postfix
  inet_listener {
address = 127.0.0.1
port = 
  }
}
service quota-warning {
  executable = script /usr/local/bin/quota-warning.sh
  unix_listener quota-warning {
mode = 0666
user = vmail
  }
  user = dovecot
}
ssl_cert = 

Re: Dovecot and SNI

2024-03-13 Thread Stuart Henderson
On 2024-03-12, steffan--- via dovecot  wrote:
> I have an old CentOS 7 server using dovecot 2.2.36  and OpenSSL 1.0.2k-fips=
>  that=92s been fine for quite some time. Recently I started getting complai=
> nts related to SNI.
>
> I test with this: openssl s_client -connect mail.domain.com:993 -crlf -quie=
> t
>
> On macOS using OpenSSL LibreSSL 3.3.6 I test and get the default dovecot do=
> main =93SomeWrongDomain.com=94 which causes issues.
>
> On Oracle Linux 9 using OpenSSL 3.0.7 I get the correct response for the do=
> main =93mail.domain.com=94

That's not a valid test. openssl >=1.1.1 s_client uses SNI by default,
with libressl or older openssl you need to use -servername.


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


Possible bug in dovecot doc

2024-03-13 Thread Petr Šorm via dovecot

Dear maintainer,

there is potentially conflicting information in dovecot doc about the 
count quota backend.


According to 
https://doc.dovecot.org/configuration_manual/quota/quota_count/
the count quota backend is the recommended way of calculating quota on 
recent Dovecot

installations.

But according to
https://github.com/dovecot/core/blob/main/doc/example-config/conf.d/90-quota.conf
it is extremely SLOW with Maildir. It'll eat your CPU and disk I/O.

I don't think the information on github is true, but I could be wrong.

Could you fix/clarify this?
Thank you in advance.

Best regards
Petr Sorm
___
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-13 Thread Aki Tuomi via dovecot
Not really no. You should use e.g. dict inteface for storing this kind of 
stateful data. When deinit is called the calling core process will likely die 
too.

Aki

> On 13/03/2024 10:19 EET Joan Moreau  wrote:
> 
> 
> Keep a pointer in memory retrievable each time a plugin is called
> 
> So the plugin keep the memory, not has to restart everything at each call
> 
> 
> 
> On 12 March 2024 08:53:38 Aki Tuomi via dovecot  wrote:
> 
> > > On 11/03/2024 10:42 EET Joan Moreau  wrote:
> > > 
> > > 
> > > Hi
> > > Is it possible, from a plugin perspective, to create and recover a 
> > > pointer in the core process (i.e. memory not lost between 2 calls to the 
> > > plugin, even after the "deinit" of the plugin" ) ?
> > > 
> > > Thanks
> > 
> > Hi Joan!
> > 
> > May I ask what you are attempting to achieve in more detail?
> > 
> > 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: How to get a memory pointer in the core process

2024-03-13 Thread Joan Moreau via dovecot
Keep a pointer in memory retrievable each time a plugin is called

So the plugin keep the memory, not has to restart everything at each call



On 12 March 2024 08:53:38 Aki Tuomi via dovecot  wrote:

  On 11/03/2024 10:42 EET Joan Moreau  wrote:


  Hi
  Is it possible, from a plugin perspective, to create and
  recover a pointer in the core process (i.e. memory not lost
  between 2 calls to the plugin, even after the "deinit" of
  the plugin" ) ?

  Thanks

 Hi Joan!

 May I ask what you are attempting to achieve in more detail?

 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: Dovecot and SNI

2024-03-13 Thread Aki Tuomi via dovecot

> On 12/03/2024 22:54 EET steffan--- via dovecot  wrote:
> 
>  
> I have an old CentOS 7 server using dovecot 2.2.36  and OpenSSL 1.0.2k-fips 
> that’s been fine for quite some time. Recently I started getting complaints 
> related to SNI.
> 
> I test with this: openssl s_client -connect mail.domain.com:993 -crlf -quiet
> 
> On macOS using OpenSSL LibreSSL 3.3.6 I test and get the default dovecot 
> domain “SomeWrongDomain.com” which causes issues.
> 
> On Oracle Linux 9 using OpenSSL 3.0.7 I get the correct response for the 
> domain “mail.domain.com”
> 
> What could cause this?
> 
> 
> Thank you,
> Steffan Cline
> stef...@hldns.com
> 602-793-0014
> 
> 
> I have an old CentOS 7 server using dovecot 2.2.36  and OpenSSL 1.0.2k-fips
> that’s been fine for quite some time. Recently I started getting complaints
> related to SNI.
>  
> I test with this: openssl s_client -connect mail.domain.com:993 -crlf -quiet
>  
> On macOS using OpenSSL LibreSSL 3.3.6 I test and get the default dovecot 
> domain
> “SomeWrongDomain.com” which causes issues.
>  
> On Oracle Linux 9 using OpenSSL 3.0.7 I get the correct response for the 
> domain
> “mail.domain.com”
>  
> What could cause this?
>  
>  
> Thank you,
> Steffan Cline
> stef...@hldns.com
> 602-793-0014 

One reason could be that Dovecot 2.3 does not support openssl3, and there is a 
broken patch flying around. We are close to releasing our next major release, 
which does include support for ossl3.

We can't really debug issues likely caused by 3rd party patch.

Try with RHEL8 or compatible, we have packages for that as well.

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