Re: Failing to archive many messages

2024-05-09 Thread Francis Augusto Medeiros-Logeay via dovecot



> On 9 May 2024, at 19:45, dovecot-requ...@dovecot.org wrote:
> 
> Francis Augusto Medeiros-Logeay via dovecot skrev den 2024-05-09 12:29:
> 
>>> If you want to analyze emails, why not do it with scheduled crons 
>>> after they are archived?
> 
> maybe ask for skip older then one day in here 
> https://github.com/isbg/isbg/tree/master
> 
> while roundcube just set the needed flag for retest ?
> 
>> wouldn't it reanalyze all archived messages anyway?
> 
> sometimes email is ham at recpt stage, while its spam later on test, 
> this is why isbg is made imho :)


I see.

But I wonder if there is something wrong with what I already have. It worked 
fine for years, and it works fine for most of my users. I tested with a few 
accounts, and Archving (with its sa-learn script) works blazingly fast. But 
with one user - happens to be mine - it is super slow when archiving, most 
likely due the sa-learn.

Best,

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


Re: Authentication questions

2024-05-09 Thread Christopher Wensink via dovecot

This may help, see the post from 9/9/2021:
https://github.com/goauthentik/authentik/issues/1234

On 5/9/2024 2:50 PM, Francis Augusto Medeiros-Logeay via dovecot wrote:



On 9 May 2024, at 19:45, Aki Tuomi  wrote:

  

On 09/05/2024 20:15 EEST Francis Augusto Medeiros-Logeay via dovecot 
mailto:dovecot@dovecot.org>> wrote:
  
  
Hi,
  
I was wondering:
  
1 - Is it possible to configure authentication methods per user? For example, oauth2 for most users, but plain for others?

2 - I had a feeling that when oauth2 authentication fails, dovecot tries to 
authenticate via plain with the received token. Doesn’t seem logical, but I get 
my user blocked on my directory server (freeipa) after a few failed oath 
authentications. If so, can this be prevented?
  
Best,
  
Francis

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


Yep. See 
https://doc.dovecot.org/configuration_manual/authentication/password_databases_passdb/#passdb-setting
  
you can filter by mechanism.
  
Aki

The weird thing is that I get this still:

May 09 21:45:47 auth: Error: oauth2(myu...@mydomain.com,48.237.124.127): oauth2 
failed: Introspection failed: No username returned
May 09 21:45:47 auth: Error: ldap(myu...@mydomain.com,48.237.124.127): 
ldap_bind() failed: Constraint violation

Even when I have my configuration like this:

auth_mechanisms = $auth_mechanisms xoauth2 oauthbearer


passdb {
   driver = oauth2
   mechanisms = xoauth2 oauthbearer
   args = /etc/dovecot/dovecot-oauth2.conf.ext
   result_failure=return-fail
}

What could be the cause?

Best,
Francis


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



--
Christopher Wensink
IS Administrator
Five Star Plastics, Inc
1339 Continental Drive
Eau Claire, WI 54701
Office:  715-831-1682
Mobile:  715-563-3112
Fax:  715-831-6075
cwens...@five-star-plastics.com
www.five-star-plastics.com

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


Re: Authentication questions

2024-05-09 Thread Francis Augusto Medeiros-Logeay via dovecot


> On 9 May 2024, at 19:45, Aki Tuomi  wrote:
> 
>  
>> On 09/05/2024 20:15 EEST Francis Augusto Medeiros-Logeay via dovecot 
>> mailto:dovecot@dovecot.org>> wrote:
>>  
>>  
>> Hi,
>>  
>> I was wondering:
>>  
>> 1 - Is it possible to configure authentication methods per user? For 
>> example, oauth2 for most users, but plain for others?
>> 2 - I had a feeling that when oauth2 authentication fails, dovecot tries to 
>> authenticate via plain with the received token. Doesn’t seem logical, but I 
>> get my user blocked on my directory server (freeipa) after a few failed oath 
>> authentications. If so, can this be prevented?
>>  
>> Best,
>>  
>> Francis
>> ___
>> dovecot mailing list -- dovecot@dovecot.org 
>> To unsubscribe send an email to dovecot-le...@dovecot.org 
>>  
> Yep. See 
> https://doc.dovecot.org/configuration_manual/authentication/password_databases_passdb/#passdb-setting
>  
> you can filter by mechanism.
>  
> Aki

The weird thing is that I get this still: 

May 09 21:45:47 auth: Error: oauth2(myu...@mydomain.com,48.237.124.127): oauth2 
failed: Introspection failed: No username returned
May 09 21:45:47 auth: Error: ldap(myu...@mydomain.com,48.237.124.127): 
ldap_bind() failed: Constraint violation

Even when I have my configuration like this:

auth_mechanisms = $auth_mechanisms xoauth2 oauthbearer


passdb {
  driver = oauth2
  mechanisms = xoauth2 oauthbearer
  args = /etc/dovecot/dovecot-oauth2.conf.ext
  result_failure=return-fail
}

What could be the cause? 

Best,
Francis 


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


Re: Authentication questions

2024-05-09 Thread Francis Augusto Medeiros-Logeay via dovecot


> On 9 May 2024, at 19:45, Aki Tuomi  wrote:
> 
>  
>> On 09/05/2024 20:15 EEST Francis Augusto Medeiros-Logeay via dovecot 
>> mailto:dovecot@dovecot.org>> wrote:
>>  
>>  
>> Hi,
>>  
>> I was wondering:
>>  
>> 1 - Is it possible to configure authentication methods per user? For 
>> example, oauth2 for most users, but plain for others?
>> 2 - I had a feeling that when oauth2 authentication fails, dovecot tries to 
>> authenticate via plain with the received token. Doesn’t seem logical, but I 
>> get my user blocked on my directory server (freeipa) after a few failed oath 
>> authentications. If so, can this be prevented?
>>  
>> Best,
>>  
>> Francis
>> ___
>> dovecot mailing list -- dovecot@dovecot.org 
>> To unsubscribe send an email to dovecot-le...@dovecot.org 
>>  
> Yep. See 
> https://doc.dovecot.org/configuration_manual/authentication/password_databases_passdb/#passdb-setting
>  
> you can filter by mechanism.
>  
> Aki

Thanks, this is great!

Best,
Francis

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


Re: Authentication questions

2024-05-09 Thread Aki Tuomi via dovecot
 
 On 09/05/2024 20:15 EEST Francis Augusto Medeiros-Logeay via dovecot
  wrote:
  
  
 Hi,
  
 I was wondering:
  
 1 - Is it possible to configure authentication methods per user? For
 example, oauth2 for most users, but plain for others?
 2 - I had a feeling that when oauth2 authentication fails, dovecot
 tries to authenticate via plain with the received token. Doesn’t seem
 logical, but I get my user blocked on my directory server (freeipa)
 after a few failed oath authentications. If so, can this be
 prevented?
  
 Best,
  
 Francis
 ___
 dovecot mailing list -- dovecot@dovecot.org
 To unsubscribe send an email to dovecot-le...@dovecot.org
 
Yep. See https://doc.dovecot.org/configuration_manual/authentication/
password_databases_passdb/#passdb-setting
 
you can filter by mechanism.
 
Aki
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Re: Failing to archive many messages

2024-05-09 Thread Francis Augusto Medeiros-Logeay via dovecot


> On 9 May 2024, at 12:55, dovecot-requ...@dovecot.org wrote:
> 
> Francis Augusto Medeiros-Logeay via dovecot skrev den 2024-05-09 11:28:
> 
>> Actually, I don’t know here if that’s the sieve that’s slowing down the 
>> process, or if it is something else.
>> I see that yeah, sa-learn takes a little while to execute. But maybe 
>> the issue is that Dovecot doesn’t seem to
>> release the IMAP connection until each message went through sieve. This 
>> gives me some timeout on
>> Roundcube (it says just «server error»). All the messages are indeed 
>> archived.
>> 
>> Is that something here I could do better?
> 
> use tmpfs to store tmp content, or try solve it without pipe with imho 
> creates tmp files
> 
> https://doc.dovecot.org/configuration_manual/howto/antispam_with_sieve/
> 
> try spamc

Thanks Benny. Using spamc and sa-learn isn’t a bit the same? But I’ll check the 
docs.

Bestm

Francis 

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


Authentication questions

2024-05-09 Thread Francis Augusto Medeiros-Logeay via dovecot
Hi,

I was wondering:

1 - Is it possible to configure authentication methods per user? For example, 
oauth2 for most users, but plain for others?
2 - I had a feeling that when oauth2 authentication fails, dovecot tries to 
authenticate via plain with the received token. Doesn’t seem logical, but I get 
my user blocked on my directory server (freeipa) after a few failed oath 
authentications. If so, can this be prevented?

Best,

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


Re: Failing to archive many messages

2024-05-09 Thread Benny Pedersen via dovecot

Francis Augusto Medeiros-Logeay via dovecot skrev den 2024-05-09 12:29:

If you want to analyze emails, why not do it with scheduled crons 
after they are archived?


maybe ask for skip older then one day in here 
https://github.com/isbg/isbg/tree/master


while roundcube just set the needed flag for retest ?


wouldn't it reanalyze all archived messages anyway?


sometimes email is ham at recpt stage, while its spam later on test, 
this is why isbg is made imho :)

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


sieve duplicate with 2.3.16

2024-05-09 Thread Jean-Max Reymond via dovecot

Hi,
I was running dovecot 2.3.7.2 with ubuntu 20.04
Lastweek, I upgrade to Ubuntu 22.04 and dovecot 2.3.16
My configuration was migrated and all is fine expected the sieve 
duplicate. It does notwork and i don't understand why.


% doveconf -n
# 2.3.16 (7e2e900c1a): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.16 (09c29328)
managesieve(ubuntu): Debug: sieve: Pigeonhole version 0.5.16 (09c29328) 
initializing
managesieve(ubuntu): Debug: sieve: include: sieve_global is not set; it 
is currently not possible to include `:global' scripts.

# OS: Linux 5.15.0-105-generic x86_64 Ubuntu 22.04.4 LTS ext4
# Hostname: 2D17911.online-server.cloud
auth_mechanisms = plain login
first_valid_uid = 8
log_debug = category=sieve
mail_fsync = never
mail_location = maildir:/home/Mails/%u
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 {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
plugin {
  sieve = ~/.dovecot.sieve
  sieve_before = /var/lib/dovecot/sieve/default.sieve
  sieve_dir = ~/sieve
}
postmaster_address = postmas...@ckr-solutions.com
protocols = imap sieve
service auth {
  unix_listener /var/spool/postfix/private/dovecot-auth {
group = postfix
mode = 0660
user = postfix
  }
}
service stats {
  unix_listener stats-writer {
mode = 0666
  }
}
ssl_cert = ssl_cipher_list = 
ALL:!LOW:!SSLv2:ALL:!aNULL:!ADH:!eNULL:!EXP:RC4+RSA:+HIGH:+MEDIUM

ssl_key = # hidden, use -P to show it
userdb {
  driver = passwd
}
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
protocol imap {
  imap_client_workarounds = delay-newmail
  mail_max_userip_connections = 10
}
protocol lmtp {
  mail_fsync = optimized
}
protocol lda {
  deliver_log_format = msgid=%m: %$
  mail_fsync = optimized
  mail_plugins = sieve
  postmaster_address = postmas...@ckr-solutions.com
  quota_full_tempfail = yes
  rejection_reason = Your message to <%t> was automatically rejected:%n%r
}
protocol pop3 {
  mail_max_userip_connections = 10
  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
}

trace dovecot for debug

...
May  9 12:04:50 2D17911 dovecot: 
lda(jmreym...@ckr-solutions.com)<2292077><8XgtAcKfPGZt+SIA4rRGvA>: 
sieve: msgid=<00fb2844-f7b0-47af-8684-bcb090ec9...@ik.me>: stored mail 
into mailbox 'INBOX'
May  9 12:04:50 2D17911 dovecot: 
lda(jmreym...@ckr-solutions.com)<2292077><8XgtAcKfPGZt+SIA4rRGvA>: 
Debug: sieve: msgid=<00fb2844-f7b0-47af-8684-bcb090ec9...@ik.me>: Finish 
implicit keep action
May  9 12:04:50 2D17911 dovecot: 
lda(jmreym...@ckr-solutions.com)<2292077><8XgtAcKfPGZt+SIA4rRGvA>: 
Debug: sieve: msgid=<00fb2844-f7b0-47af-8684-bcb090ec9...@ik.me>: 
Finishing actions
May  9 12:04:50 2D17911 dovecot: 
lda(jmreym...@ckr-solutions.com)<2292077><8XgtAcKfPGZt+SIA4rRGvA>: 
Debug: sieve: msgid=<00fb2844-f7b0-47af-8684-bcb090ec9...@ik.me>: Finish 
duplicate_mark action
May  9 12:04:50 2D17911 dovecot: 
lda(jmreym...@ckr-solutions.com)<2292077><8XgtAcKfPGZt+SIA4rRGvA>: 
Debug: sieve: msgid=<00fb2844-f7b0-47af-8684-bcb090ec9...@ik.me>: 
Finished executing result (final, status=ok, keep=yes)
May  9 12:04:50 2D17911 dovecot: 
lda(jmreym...@ckr-solutions.com)<2292077><8XgtAcKfPGZt+SIA4rRGvA>: 
Debug: sieve: multi-script: Sequence finished (status=ok, keep=yes)
May  9 12:04:50 2D17911 dovecot: 
lda(jmreym...@ckr-solutions.com)<2292077><8XgtAcKfPGZt+SIA4rRGvA>: 
Debug: sieve: multi-script: Destroy
May  9 12:04:50 2D17911 postfix/pipe[2292075]: DE15D396023E: 
to=, orig_to=, 
relay=dovecot, delay=0.35, delays=0.09/0.01/0/0.25, dsn=2.0.0, 
status=sent (delivered via dovecot service)

May  9 12:04:50 2D17911 postfix/qmgr[1855785]: DE15D396023E: removed
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


sieve duplicate with 2.3.16

2024-05-09 Thread Jean-Max Reymond via dovecot

Hi,
I was running dovecot 2.3.7.2 with ubuntu 20.04
Lastweek, I upgrade to Ubuntu 22.04 and dovecot 2.3.16
My configuration was migrated and all is fine expected the sieve 
duplicate. It does notwork and i don't understand why.


% doveconf -n
# 2.3.16 (7e2e900c1a): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.16 (09c29328)
managesieve(ubuntu): Debug: sieve: Pigeonhole version 0.5.16 (09c29328) 
initializing
managesieve(ubuntu): Debug: sieve: include: sieve_global is not set; it 
is currently not possible to include `:global' scripts.

# OS: Linux 5.15.0-105-generic x86_64 Ubuntu 22.04.4 LTS ext4
# Hostname: 2D17911.online-server.cloud
auth_mechanisms = plain login
first_valid_uid = 8
log_debug = category=sieve
mail_fsync = never
mail_location = maildir:/home/Mails/%u
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 {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
plugin {
  sieve = ~/.dovecot.sieve
  sieve_before = /var/lib/dovecot/sieve/default.sieve
  sieve_dir = ~/sieve
}
postmaster_address = postmas...@ckr-solutions.com
protocols = imap sieve
service auth {
  unix_listener /var/spool/postfix/private/dovecot-auth {
group = postfix
mode = 0660
user = postfix
  }
}
service stats {
  unix_listener stats-writer {
mode = 0666
  }
}
ssl_cert = ssl_cipher_list = 
ALL:!LOW:!SSLv2:ALL:!aNULL:!ADH:!eNULL:!EXP:RC4+RSA:+HIGH:+MEDIUM

ssl_key = # hidden, use -P to show it
userdb {
  driver = passwd
}
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
protocol imap {
  imap_client_workarounds = delay-newmail
  mail_max_userip_connections = 10
}
protocol lmtp {
  mail_fsync = optimized
}
protocol lda {
  deliver_log_format = msgid=%m: %$
  mail_fsync = optimized
  mail_plugins = sieve
  postmaster_address = postmas...@ckr-solutions.com
  quota_full_tempfail = yes
  rejection_reason = Your message to <%t> was automatically rejected:%n%r
}
protocol pop3 {
  mail_max_userip_connections = 10
  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
}

trace dovecot for debug

May  9 12:04:49 2D17911 postfix/qmgr[1855785]: DE15D396023E: 
from=, size=2313, nrcpt=3 (queue active)
May  9 12:04:50 2D17911 amavis[2290921]: (2290921-01) Passed CLEAN 
{RelayedOpenRelay}, [185.125.25.11]:58641 [185.125.25.11] 
 -> 
,, Queue-ID: 
91D2E3960097, Message-ID: <00fb2844-f7b0-47af-8684-bcb090ec9...@ik.me>, 
mail_id: lukXw6VSEsMW, Hits: -2.821, size: 1854, queued_as: 
DE15D396023E, dkim_sd=20200325:ik.me, 5242 ms
May  9 12:04:50 2D17911 postfix/smtp[2292055]: 91D2E3960097: 
to=, orig_to=, 
relay=127.0.0.1[127.0.0.1]:10024, delay=5.4, delays=0.16/0.01/0.09/5.2, 
dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 
2.0.0 Ok: queued as DE15D396023E)
May  9 12:04:50 2D17911 postfix/smtp[2292055]: 91D2E3960097: 
to=, relay=127.0.0.1[127.0.0.1]:10024, 
delay=5.4, delays=0.16/0.01/0.09/5.2, dsn=2.0.0, status=sent (250 2.0.0 
from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as DE15D396023E)

May  9 12:04:50 2D17911 postfix/qmgr[1855785]: 91D2E3960097: removed
May  9 12:04:50 2D17911 dovecot: 
lda(jmreym...@ckr-solutions.com)<2292074>: 
Debug: sieve: Pigeonhole version 0.5.16 (09c29328) initializing
May  9 12:04:50 2D17911 dovecot: 
lda(jmreym...@ckr-solutions.com)<2292074>: 
Debug: sieve: include: sieve_global is not set; it is currently not 
possible to include `:global' scripts.
May  9 12:04:50 2D17911 dovecot: 
lda(jmreym...@ckr-solutions.com)<2292074>: 
Debug: sieve: file storage: Using active Sieve script path: 
/home/Mails/jmreym...@ckr-solutions.com/.dovecot.sieve
May  9 12:04:50 2D17911 dovecot: 
lda(jmreym...@ckr-solutions.com)<2292074>: 
Debug: sieve: file storage: Using script storage path: 
/home/Mails/jmreym...@ckr-solutions.com//sieve
May  9 12:04:50 2D17911 dovecot: 
lda(jmreym...@ckr-solutions.com)<2292074>: 
Debug: sieve: file storage: Relative path to sieve storage in active 
link: sieve/
May  9 12:04:50 2D17911 dovecot: 
lda(jmreym...@ckr-solutions.com)<2292074>: 
Debug: sieve: file storage: Using Sieve script path: 
/home/Mails/jmreym...@ckr-solutions.com/.dovecot.sieve
May  9 12:04:50 2D17911 dovecot: 
lda(jmreym...@ckr-solutions.com)<2292074>: 
Debug: sieve: file storage: Storage path 
`/home/Mails/jmreym...@ckr-solutions.com/.dovecot.sieve' not found
May  9 12:04:50 2D17911 dovecot: 
lda(jmreym...@ckr-solutions.com)<2292074>: 
Debug: sieve: User has no active script in storage 

RE: Failing to archive many messages

2024-05-09 Thread Marc via dovecot
> On 2024-05-09 12:03, Marc wrote:
> > I see report-ham, instead of archiving? I am not entirely sure if this
> > is an efficient approach to archiving. My users can only set a flag for
> > 'auto archiving' via sieve and then 3 months after every year messages
> > are being moved by cron jobs, and modification logs are put into their
> > accounts. This all is only happening in 'dead hours'.
> >
> > If you want to analyze emails, why not do it with scheduled crons after
> > they are archived?
> >
> 
> wouldn't it reanalyze all archived messages anyway?

No you should add search filter for messages like from today, this week or so.

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


Re: Failing to archive many messages

2024-05-09 Thread Francis Augusto Medeiros-Logeay via dovecot




=

On 2024-05-09 12:03, Marc wrote:
I see report-ham, instead of archiving? I am not entirely sure if this 
is an efficient approach to archiving. My users can only set a flag for 
'auto archiving' via sieve and then 3 months after every year messages 
are being moved by cron jobs, and modification logs are put into their 
accounts. This all is only happening in 'dead hours'.


If you want to analyze emails, why not do it with scheduled crons after 
they are archived?




wouldn't it reanalyze all archived messages anyway?
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Re: Failing to archive many messages

2024-05-09 Thread Benny Pedersen via dovecot

Francis Augusto Medeiros-Logeay via dovecot skrev den 2024-05-09 11:28:

Actually, I don’t know here if that’s the sieve that’s slowing down the 
process, or if it is something else.
I see that yeah, sa-learn takes a little while to execute. But maybe 
the issue is that Dovecot doesn’t seem to
release the IMAP connection until each message went through sieve. This 
gives me some timeout on
Roundcube (it says just «server error»). All the messages are indeed 
archived.


Is that something here I could do better?


use tmpfs to store tmp content, or try solve it without pipe with imho 
creates tmp files


https://doc.dovecot.org/configuration_manual/howto/antispam_with_sieve/

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


RE: Failing to archive many messages

2024-05-09 Thread Marc via dovecot
I see report-ham, instead of archiving? I am not entirely sure if this is an 
efficient approach to archiving. My users can only set a flag for 'auto 
archiving' via sieve and then 3 months after every year messages are being 
moved by cron jobs, and modification logs are put into their accounts. This all 
is only happening in 'dead hours'.

If you want to analyze emails, why not do it with scheduled crons after they 
are archived?


> I noticed that my sieve rules are taking a very long time when archiving
> messages. I can see on my logs that every message takes about two-three
> seconds to be evaluated.
> 
> My sieve for the Archive is this:
> 
> cat /var/mail/vmail/mail/sieve/global/report-ham.sieve
> require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment",
> "variables"];
> 
> if environment :matches "imap.mailbox" "*" {
>   set "mailbox" "${1}";
> }
> 
> if string "${mailbox}" "Trash" {
>   stop;
> }
> 
> if environment :matches "imap.user" "*" {
>   set "username" "${1}";
> }
> 
> pipe :copy "sa-learn-ham.sh" [ "${username}" ];
> 
> And my sa-learn-ham.sh is this:
> 
> #!/bin/sh
> export PATH="/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin:$PATH"
> exec /usr/bin/sa-learn -u ${1} —ham
> 
> 
> 
> 
> May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug:
> sieve: multi-script: Start execute sequence
> May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug:
> 
> I also noticed this happens for a few accounts. Do you know what could be
> causing this?
> 
> Best,
> Francis
> ___
> 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: Failing to archive many messages

2024-05-09 Thread Francis Augusto Medeiros-Logeay via dovecot
> I noticed that my sieve rules are taking a very long time when archiving 
> messages. I can see on my logs that every message takes about two-three 
> seconds to be evaluated.
> 
> I also noticed this happens for a few accounts. Do you know what could be 
> causing this?
> 
> Best,
> Francis
> 

Actually, I don’t know here if that’s the sieve that’s slowing down the 
process, or if it is something else.
I see that yeah, sa-learn takes a little while to execute. But maybe the issue 
is that Dovecot doesn’t seem to release the IMAP connection until each message 
went through sieve. This gives me some timeout on Roundcube (it says just 
«server error»). All the messages are indeed archived.

Is that something here I could do better?

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


Re: OAUTH2 problem when migrating to Ubuntu 24.04

2024-05-09 Thread Francis Augusto Medeiros-Logeay via dovecot




---
Francis Augusto Medeiros-Logeay
Oslo, Norway

On 2024-05-09 10:11, Aki Tuomi wrote:
On 09/05/2024 10:46 EEST Francis Augusto Medeiros-Logeay via dovecot 
 wrote:



Hi,

I have a Dovecot server on Ubuntu 22.04, which works fine with Oauth2. 
I am building a new container based on Ubuntu 24.04. IMAP seems to 
work fine with plain authentication, but oauth2 fails (Dovecot 
v2.3.21). Same configuration as before.


However, I got this message:

May 09 09:41:57 auth: Error: 
oauth2(f...@mydomain.eu,10.110.41.32,): oauth2 
failed: Introspection failed: No username returned


Weird, as it does indeed seems to get the username (as seen on the 
log).


Any clue on why this fails?

Best,

Francis


It means that introspection did not return username for the token. This 
is important, because if the token is not validated to belong to the 
user attempting to log in, anyone could login as anyone with any token.


Aki


Actually, the problem was not that. It was some change on Dovecot where 
suddenly I need to add "clientid:client_secret@" on the url (googled it, 
and saw that you advised that before). Now it works.




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


Re: OAUTH2 problem when migrating to Ubuntu 24.04

2024-05-09 Thread Aki Tuomi via dovecot


> On 09/05/2024 10:46 EEST Francis Augusto Medeiros-Logeay via dovecot 
>  wrote:
> 
>  
> Hi,
> 
> I have a Dovecot server on Ubuntu 22.04, which works fine with Oauth2. I am 
> building a new container based on Ubuntu 24.04. IMAP seems to work fine with 
> plain authentication, but oauth2 fails (Dovecot v2.3.21). Same configuration 
> as before.
> 
> However, I got this message:
> 
> May 09 09:41:57 auth: Error: 
> oauth2(f...@mydomain.eu,10.110.41.32,): oauth2 failed: 
> Introspection failed: No username returned
> 
> Weird, as it does indeed seems to get the username (as seen on the log). 
> 
> Any clue on why this fails? 
> 
> Best,
> 
> Francis

It means that introspection did not return username for the token. This is 
important, because if the token is not validated to belong to the user 
attempting to log in, anyone could login as anyone with any token.

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


OAUTH2 problem when migrating to Ubuntu 24.04

2024-05-09 Thread Francis Augusto Medeiros-Logeay via dovecot
Hi,

I have a Dovecot server on Ubuntu 22.04, which works fine with Oauth2. I am 
building a new container based on Ubuntu 24.04. IMAP seems to work fine with 
plain authentication, but oauth2 fails (Dovecot v2.3.21). Same configuration as 
before.

However, I got this message:

May 09 09:41:57 auth: Error: 
oauth2(f...@mydomain.eu,10.110.41.32,): oauth2 failed: 
Introspection failed: No username returned

Weird, as it does indeed seems to get the username (as seen on the log). 

Any clue on why this fails? 

Best,

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


Re: Failing to archive many messages

2024-05-09 Thread Francis Augusto Medeiros-Logeay via dovecot
I noticed that my sieve rules are taking a very long time when archiving 
messages. I can see on my logs that every message takes about two-three seconds 
to be evaluated. 

My sieve for the Archive is this:

cat /var/mail/vmail/mail/sieve/global/report-ham.sieve
require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"];

if environment :matches "imap.mailbox" "*" {
  set "mailbox" "${1}";
}

if string "${mailbox}" "Trash" {
  stop;
}

if environment :matches "imap.user" "*" {
  set "username" "${1}";
}

pipe :copy "sa-learn-ham.sh" [ "${username}" ];

And my sa-learn-ham.sh is this:

#!/bin/sh
export PATH="/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin:$PATH"
exec /usr/bin/sa-learn -u ${1} —ham




May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
multi-script: Start execute sequence
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
Executing script from `/var/mail/vmail/mail/sieve/global/report-ham.svbin'
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
multi-script: Run script `/var/mail/vmail/mail/sieve/global/report-ham.svbin'
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
Started running script `/var/mail/vmail/mail/sieve/global/report-ham.svbin'
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
Finished running script `ok' 
(status=/var/mail/vmail/mail/sieve/global/report-ham.svbin, resource usage: no 
usage recorded)
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
multi-script: Execute result
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
uid=191458: Executing result (status=ok, commit=no)
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
uid=191458: Starting execution of actions
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
uid=191458: Executing actions
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
uid=191458: Executing pipe action
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
action pipe: running program: sa-learn-ham.sh
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: program 
exec:/var/mail/vmail/mail/sieve/global/scripts/sa-learn-ham.sh: Created
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: program 
exec:/var/mail/vmail/mail/sieve/global/scripts/sa-learn-ham.sh: Pass 
environment: USER=fran...@med-lo.eu
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: program 
exec:/var/mail/vmail/mail/sieve/global/scripts/sa-learn-ham.sh: Pass 
environment: HOME=/var/mail/vmail/med-lo.eu/francis
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: program 
exec:/var/mail/vmail/mail/sieve/global/scripts/sa-learn-ham.sh: Pass 
environment: HOST=fb58607074fd
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: Mailbox 
Archive: UID 191458: Opened mail because: mail stream
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
uid=191458: Finished executing pipe action (status=ok, keep=implicit)
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
uid=191458: Finished executing actions (status=ok, keep=implicit)
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
uid=191458: Finished executing result (no commit, status=ok, keep=yes)
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
multi-script: Sequence active
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
multi-script: Finishing sequence (status=ok)
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
uid=191458: Executing result (status=ok, commit=yes)
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
uid=191458: Starting execution of actions
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
uid=191458: Executing actions
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
uid=191458: Finished executing actions (status=ok, keep=implicit)
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
uid=191458: Execute implicit keep (failure=no)
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
uid=191458: Start storing into mailbox Archive
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
uid=191458: Executing implicit keep action
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
uid=191458: Execute storing into mailbox 'Archive'
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: Debug: sieve: 
uid=191458: Updated existing mail in mailbox 'Archive'
May 09 09:17:10 imap(fran...@med-lo.eu)<9349><4gm6NAAYsagKCige>: