Re: rawlog data in a lua script
On 28 July 2022 13.38.17 UTC, "João Silva" wrote: >Thanks a lot for this thread. > >I was starting to plan a system where multiples processes can write to a file >and completely forgot that syslog is designed to do that. > >It is a perfect solution, I only had to configure a local facility to receive >the data and add 3 lines of code to the program (including the import). > >On 28/07/2022 12:01, Paul Kudla (SCOM.CA Internet Services Inc.) wrote: >> >> Hi - I use this python script to capture a socket (ie the log file) and then >> send it to syslog, i use this for all the systems that do not really support >> syslogging (apache etc) >> >> basic useage >> >> /usr/bin/nohup /programs/common/capture -s >> /usr/local/apache2/logs/httpd-access.log -l httpd -d 10.228.0.6:514 -p httpd >> & > /dev/null >> >> i typically run this at startup in rc.local >> On 7/28/2022 6:17 AM, dovecot-boun...@dovecot.org wrote: >>> Hi, >>> I'm searching for a possibility to have the rawlog feature in lua, which >>> would be much easier for processing. Currently Dovecot, when activating >>> rawlog for a user, writes everything to disk (which creates I/O), and I >>> have to somehow read it from there. That's a bit complicated, because I >>> have to get notified via inotify or similar when there are new files >>> created, and then I have to start a "tail" or "epoll" mechanism on the >>> files to get the contents in more or less real time (IMAP sessions can be >>> multiple hours or days). >>> It would be much easier to hook to the "raw request and response events" >>> inside Dovecot and have the rawlog-data in a lua script, where I can >>> prepare it and send it to another maschine for >>> monitoring/collection/analysis/statistics or similar, for example via HTTP. >>> Having the rawlog data available in lua would make things a lot easier. >>> Is there any possibility at the moment to create a lua script and "hook" to >>> those "request and response events"? If not, would it be possible to add >>> that feature in the future? >>> Kind regards >>> Michael If you are only interested in IMAP commands you can use event exporter to send individual commands preparsed in json format to HTTP endpoint. Aki
Re: Dovecot folder problem while deleting via IMAP
Hello Am 29.07.22 um 10:42 schrieb Pascal Bonny: > Dovecot Version: > 2.3.17 (8414c38c5c) > > Dear, > Some troubles occur while we delete a folder via IMAP ssl command or via a > IMAP > client (different clients tested). > > When we want to delete subfolder we observe following issues. > > > some examples following: > > we created a folder with subfolders x/y/z > > > a02 CREATE x.y.z > a02 OK Create completed (0.003 + 0.000 + 0.002 secs). > > > > response from dovecot cli > x > x.y > x.y.z > > then we try to delete the z subfolder of x > > > a04 DELETE x.y.z > a05 OK Delete completed (0.002 + 0.000 + 0.001 secs). > > > The IMAP console returns success and the dovecot listing is ok > > > response from dovecot cli = > x > x.y > > But dovecot status on x.y returns the folder is not existent > [cut] That is normal IMAP behaviour. With creating x.y.z you really create only folder z and a folder hirarchy x.y, in which you can not store emails (nor have any access). You have to create x and x.y, in order to get complete folders and subfolders usable for emails and be able to delete them :-) Kind regards, Christian Mack -- Christian Mack Universität Konstanz Kommunikations-, Informations-, Medienzentrum (KIM) Abteilung IT-Dienste Forschung, Lehre, Infrastruktur 78457 Konstanz +49 7531 88-4416 smime.p7s Description: S/MIME Cryptographic Signature
Dovecot folder problem while deleting via IMAP
Dovecot Version: 2.3.17 (8414c38c5c) Dear, Some troubles occur while we delete a folder via IMAP ssl command or via a IMAP client (different clients tested). When we want to delete subfolder we observe following issues. some examples following: we created a folder with subfolders x/y/z a02 CREATE x.y.z a02 OK Create completed (0.003 + 0.000 + 0.002 secs). response from dovecot cli x x.y x.y.z then we try to delete the z subfolder of x a04 DELETE x.y.z a05 OK Delete completed (0.002 + 0.000 + 0.001 secs). The IMAP console returns success and the dovecot listing is ok response from dovecot cli = x x.y But dovecot status on x.y returns the folder is not existent response from dovecot cli= doveadm(u...@domain.tld): Error: remote(192.168.1.1:24245): Mailbox x.y: Failed to lookup mailbox status: Mailbox doesn't exist: x.y vsize=0 This lead that physically the folder and sub folders are still in our storage but can not be accessed by the dovecot service. We could bypass this phenomena by recreating this x.y folder and then delete the y folder again with IMAP. a04 CREATE x.y a05 OK Create completed (0.002 + 0.000 + 0.001 secs). and status shows the folder exists response from dovecot cli => vsize=0 Then we retry deleting the y folder from x a08 DELETE x.y a08 OK Delete completed (0.002 + 0.000 + 0.001 secs). status still not correct for the top folder response from dovecot cli = doveadm(u...@domain.tld): Error: remote(192.168.1.1:24245): Mailbox x: Failed to lookup mailbox status: Mailbox doesn't exist: x vsize=0 But this time without recreating the x folder, the delete command is working a10 DELETE x a10 OK Delete completed (0.001 + 0.000 secs). the dovecot command shows no x folder anymore as wanted response from dovecot cli = a a.b a.b.c No x folder appear in the listing Is this a Dovecot problem ? our did it not be engineered for deleting top folder by IMAP? Thanks in advance Kind Regards Pascal Pascal Bonny onOffice GmbH Charlottenburger Allee 5 | 52068 Aachen Tel. 0241 44 6860 | Fax. 0241 44686 250 E-Mail: p.bo...@onoffice.de | Web: www.onOffice.com Registergericht: Amtsgericht Aachen, HRB 21420 Geschäftsführer: Dipl.-Kfm. Stefan Mantl Prokuristen: Janosch Reuschenbach, Kristina Andresen, Christian Mähringer, Marius Siegmund DOVECOT CONF # 2.3.17 (8414c38c5c): /etc/dovecot/dovecot.conf # Pigeonhole version 0.5.17 (44945af4) # OS: Linux 5.13.0-27-generic x86_64 Ubuntu 20.04.3 LTS # Hostname: mailserver.domain.tld auth_mechanisms = plain login auth_verbose = yes default_process_limit = 250 director_mail_servers = 192.168.1.1@shard1 192.168.1.2@shard1 192.168.1.3@shard2 192.168.1.4@shard2 192.168.1.5@shard3 192.168.1.6@shard3 192.168.1.7@shard4 192.168.1.8@shard4 director_servers = 192.168.1.9 192.168.1.10 192.168.1.11 disable_plaintext_auth = no doveadm_api_key = # hidden, use -P to show it doveadm_password = # hidden, use -P to show it doveadm_port = 24245 imap_logout_format = in=%i out=%o deleted=%{deleted} expunged=%{expunged} trashed=%{trashed} lmtp_proxy = yes mail_location = mbox:~/mail:INBOX=/var/mail/%u mail_plugins = " quota" 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 metric auth_success { filter = (event=auth_request_finished AND success=yes) } metric client_connections { filter = event=client_connection_finished } metric imap_command { filter = event=imap_command_finished group_by = cmd_name tagged_reply_state } metric mail_delivery { filter = event=mail_delivery_finished group_by = duration:exponential:1:5:10 } 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 = file:~/sieve;active=~/.dovecot.sieve } pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s, deleted_bytes=%{deleted_bytes} postmaster_address = postmas...@domain.tld protocols = imap pop3 lmtp sieve service anvil { client_limit = 1003 } service auth { client_limit = 1500 unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0666 user = postfix } } service director { fifo_listener login/proxy-notify { mode = 0666 } inet_liste