Re: Migration issue

2020-08-03 Thread Joseph Tam

On Mon, 3 Aug 2020, Kishore Potnuru wrote:


===
Jul 28 11:14:23 auth: Fatal: Master passdb can't have pass=yes if there are
no passdbs
Jul 28 11:14:23 master: Error: service(auth): command startup failed,
throttling
===

after the above error, I have commented "pass=yes" in production1 (old
server) server, then I see the below error.


Jul 28 11:17:10 auth: Fatal: No passdbs specified in configuration file.
PLAIN mechanism needs one
Jul 28 11:17:10 master: Error: service(auth): command startup failed,
throttling
===

=
My old server dovecot.conf (production1):
=

passdb {
   args = /etc/dovecot/passwd
   driver = passwd-file
   master = yes
   pass = yes
   }


My interpretation of your error messages is you need 2 sets of credentials:
regular users and master users.  You've only supplied master passwords.
You'll need

# Contains master users credentials
passdb {
args = /etc/dovecot/master-passwd
driver = passwd-file
master = yes
pass = yes
}

# Contains regular user credentials
passdb {
args = /etc/dovecot/passwd
driver = passwd-file
}

Joseph Tam 


Re: How to access mailbox metadata in Lua push driver

2020-08-03 Thread Ralf Becker
Some answers to my questions, a first version of my script and more
questions ;)

Am 03.08.20 um 18:15 schrieb Ralf Becker:

> Currently looking into the following questions:
>
> - can I get the rfc 5423 type of event somehow (obviously I can set it
> on the event myself depending of the function called)
event.name
> - looking at the example code, it looks like it can be called for
> multiple messages, when does that happen (LMTP send more then one)

still no idea, maybe Ake?

I noticed that some events have the same uid-validity, are the from a
single transaction, eg. I delete my Trash?

> - why is the mailbox status put into an other structure and send with
> a different notifiction
> - does anyone have a code snippet to send a JSON encoded message
> (probably easy to figure out looking at Lua docu)

these two I managed to solve im my current version of the script, which
also support now all message event types:

-- To use -- -- plugin { -- push_notification_driver =
lua:file=/etc/dovecot/dovecot-push.lua -- push_lua_url =
http://push.notification.server/handler -- } -- -- server is sent a PUT
message with JSON body like push_notification_driver =
ox:url= user_from_metadata -- local http = require "socket.http" 
local ltn12 = require "ltn12" -- luarocks install json-lua local json = require 
"JSON" function table_get(t, k, d)
  return t[k] or d end function script_init()
  return 0 end function dovecot_lua_notify_begin_txn(user)
local meta = user:metadata_get("/private/vendor/vendor.dovecot/http-notify")
return {user=user, event=dovecot.event(), 
ep=user:plugin_getenv("push_lua_url"), messages={}, meta=meta}
end function dovecot_lua_notify_event_message_new(ctx, event)
-- check if there is a push token registered if (ctx.meta == nil or 
ctx.meta == '') then return end -- get mailbox status local mbox = 
ctx.user:mailbox(event.mailbox)
mbox:sync()
local status = mbox:status(dovecot.storage.STATUS_RECENT, 
dovecot.storage.STATUS_UNSEEN, dovecot.storage.STATUS_MESSAGES)
mbox:free()
table.insert(ctx.messages, {
  user = ctx.meta,
  ["imap-uidvalidity"] = event.uid_validity,
  ["imap-uid"] = event.uid,
  folder = event.mailbox,
  event = event.name,
  from = event.from,
  subject = event.subject,
  snippet = event.snippet,
  unseen = status.unseen
})
end function dovecot_lua_notify_event_message_append(ctx, event)
  dovecot_lua_notify_event_message_new(ctx, event)
end function dovecot_lua_notify_event_message_read(ctx, event)
-- check if there is a push token registered if (ctx.meta == nil or 
ctx.meta == '') then return end -- get mailbox status local mbox = 
ctx.user:mailbox(event.mailbox)
mbox:sync()
local status = mbox:status(dovecot.storage.STATUS_RECENT, 
dovecot.storage.STATUS_UNSEEN, dovecot.storage.STATUS_MESSAGES)
mbox:free()
table.insert(ctx.messages, {
user = ctx.meta,
["imap-uidvalidity"] = event.uid_validity,
["imap-uid"] = event.uid,
folder = event.mailbox,
event = event.name,
unseen = status.unseen
})
end function dovecot_lua_notify_event_message_trash(ctx, event)
dovecot_lua_notify_event_message_read(ctx, event)
end function dovecot_lua_notify_event_message_expunge(ctx, event)
dovecot_lua_notify_event_message_read(ctx, event)
end function dovecot_lua_notify_event_flags_set(ctx, event)
-- check if there is a push token registered if (ctx.meta == nil or 
ctx.meta == '') then return end table.insert(ctx.messages, {
user = ctx.meta,
["imap-uidvalidity"] = event.uid_validity,
["imap-uid"] = event.uid,
folder = event.mailbox,
event = event.name,
flags = event.flags,
["keywords-set"] = event.keywords_set
})
end function dovecot_lua_notify_event_flags_clear(ctx, event)
-- check if there is a push token registered if (ctx.meta == nil or 
ctx.meta == '') then return end table.insert(ctx.messages, {
user = ctx.meta,
["imap-uidvalidity"] = event.uid_validity,
["imap-uid"] = event.uid,
folder = event.mailbox,
event = event.name,
flags = event.flags,
["keywords-clear"] = event.keywords_clear,
["keywords-old"] = event.keywords_old
})
end function dovecot_lua_notify_end_txn(ctx)
-- report all states for i,msg in ipairs(ctx.messages) do local e = 
dovecot.event(ctx.event)
e:set_name("lua_notify_mail_finished")
reqbody = json:encode(msg)
e:log_debug(ctx.ep .. " - sending " .. reqbody)
res, code = http.request({
method = "PUT",
url = ctx.ep,
source = ltn12.source.string(reqbody),
headers={
["content-type"] = "application/json; charset=utf-8",
["content-length"] = tostring(#reqbody)
}
})
e:add_int("result_code", code)
e:log_info("Mail notify status " .. tostring(code))
end end


This leads to a couple more questions ;)

- is there a 

Re: Migration issue

2020-08-03 Thread Kishore Potnuru
Hi Markus,

Please find the details below and please let me know if you need any other
information.

1) Are users able to login and access their mailboxes on production1 with
an IMAP client?

Ans: Yes.

2)

[root@production1 ~]# ps -ef | grep dovecot
dovecot800 1  0 Jul07 ?00:00:07 dovecot/anvil
root   801 1  0 Jul07 ?00:00:09 dovecot/log
root   804 1  0 Jul07 ?00:00:31 dovecot/config
vmail 1310 1  0 Jul08 ?00:00:00 dovecot/imap
dovecot   1440 1  0 Jul09 ?00:00:07 dovecot/anvil
root  1441 1  0 Jul09 ?00:00:08 dovecot/log
vmail 1473 1  0 Jul08 ?00:00:00 dovecot/imap
vmail 2095 1  0 Jul09 ?00:00:00 dovecot/imap
vmail 2354 1  0 Jul09 ?00:00:00 dovecot/imap
vmail 2584 1  0 Jul09 ?00:00:00 dovecot/imap
dovecot   3001 1  0 Jul08 ?00:00:09 dovecot/anvil
root  3002 1  0 Jul08 ?00:00:11 dovecot/log
vmail 4004 1  0 Jul08 ?00:00:00 dovecot/imap
vmail 4535 1  0 Jul08 ?00:00:00 dovecot/imap
vmail 4546 1  0 Jul08 ?00:00:00 dovecot/imap
vmail 4649 1  0 Jul08 ?00:00:00 dovecot/imap
vmail 4677 1  0 Jul09 ?00:00:00 dovecot/imap
vmail 4913 1  0 Jul08 ?00:00:00 dovecot/imap
vmail 5208 1  0 Jul08 ?00:00:00 dovecot/imap
vmail 5353 1  0 Jul08 ?00:00:00 dovecot/imap
vmail 5799 1  0 Jul08 ?00:00:00 dovecot/imap
vmail 6280 1  0 Jul08 ?00:00:00 dovecot/imap
vmail 6774 1  0 Jul09 ?00:00:00 dovecot/imap
vmail 6975 1  0 Jul09 ?00:00:00 dovecot/imap
vmail 7035 1  0 Jul09 ?00:00:00 dovecot/imap
vmail 9108 1  0 Jul09 ?00:00:00 dovecot/imap
vmail 9741 1  0 Jul07 ?00:00:00 dovecot/imap
vmail10022 1  0 Jul09 ?00:00:00 dovecot/imap
vmail10900 1  0 Jul08 ?00:00:00 dovecot/imap
vmail11522 1  0 Jul09 ?00:00:00 dovecot/imap
vmail11579 1  0 Jul09 ?00:00:00 dovecot/imap
vmail13190 1  0 Jul08 ?00:00:00 dovecot/imap
vmail13837 1  0 Jul09 ?00:00:00 dovecot/imap
vmail15689 1  0 Jul08 ?00:00:00 dovecot/imap
vmail16089 1  0 Jul09 ?00:00:00 dovecot/imap
vmail17919 1  0 Jul08 ?00:00:00 dovecot/imap
vmail18377 1  0 Jul07 ?00:00:00 dovecot/imap
vmail18404 1  0 Jul09 ?00:00:00 dovecot/imap
vmail20279 1  0 Jul08 ?00:00:00 dovecot/imap
vmail20639 1  0 Jul09 ?00:00:00 dovecot/imap
vmail20658 1  0 Jul08 ?00:00:00 dovecot/imap
vmail21397 1  0 Jul07 ?00:00:00 dovecot/imap
dovenull 21624 1  0 20:18 ?00:00:00 dovecot/pop3-login
dovenull 21627 1  0 20:18 ?00:00:00 dovecot/pop3-login
dovenull 21628 1  0 20:18 ?00:00:00 dovecot/pop3-login
dovenull 21633 1  0 20:18 ?00:00:00 dovecot/pop3-login
dovenull 21636 1  0 20:18 ?00:00:00 dovecot/pop3-login
dovenull 21641 1  0 20:18 ?00:00:00 dovecot/pop3-login
dovenull 21644 1  0 20:18 ?00:00:00 dovecot/pop3-login
dovenull 21645 1  0 20:18 ?00:00:00 dovecot/pop3-login
dovenull 21789 1  0 20:19 ?00:00:00 dovecot/pop3-login
dovenull 21873 1  0 20:19 ?00:00:00 dovecot/pop3-login
dovenull 21875 1  0 20:19 ?00:00:00 dovecot/pop3-login
dovenull 21878 1  0 20:19 ?00:00:00 dovecot/pop3-login
dovenull 21880 1  0 20:19 ?00:00:00 dovecot/pop3-login
dovenull 21882 1  0 20:19 ?00:00:00 dovecot/pop3-login
dovenull 21884 1  0 20:19 ?00:00:00 dovecot/pop3-login
dovenull 21888 1  0 20:19 ?00:00:00 dovecot/pop3-login
dovenull 21889 1  0 20:19 ?00:00:00 dovecot/pop3-login
dovenull 21891 1  0 20:19 ?00:00:00 dovecot/pop3-login
dovenull 21893 1  0 20:19 ?00:00:00 dovecot/pop3-login
dovenull 21896 1  0 20:19 ?00:00:00 dovecot/pop3-login
dovenull 21897 1  0 20:19 ?00:00:00 dovecot/pop3-login
dovenull 21904 1  0 20:19 ?00:00:00 dovecot/pop3-login
dovenull 21907 1  0 20:19 ?00:00:00 dovecot/pop3-login
dovenull 21920 1  0 20:19 ?00:00:00 dovecot/pop3-login
dovenull 21921 1  0 20:19 ?00:00:00 dovecot/pop3-login
dovenull 21927 1  0 20:20 ?00:00:00 dovecot/pop3-login
dovenull 21929 1  0 20:20 ?00:00:00 dovecot/pop3-login
dovenull 21932 1  0 20:20 ?00:00:00 dovecot/pop3-login
dovenull 21933 1  0 20:20 ?00:00:00 dovecot/pop3-login
dovenull 21935 1  0 20:20 ?00:00:00 dovecot/pop3-login
dovenull 21938 1  0 20:20 ?00:00:00 dovecot/pop3-login
dovenull 21942 1  0 20:20 ?00:00:00 dovecot/pop3-login
dovenull 21943 1  0 20:20 ?

Re: Migration issue

2020-08-03 Thread Markus Winkler

Hi Kishore,

On 03.08.20 15:33, Kishore Potnuru wrote:

Please let me know if you need any other details.


please provide the following outputs/answers:

1) Are users able to login and access their mailboxes on production1 with 
an IMAP client?


On your old server (production1):

2) ps aux | grep dovecot

3) netstat -lntp

4) ls -la /etc/dovecot

On your new server (production2):

5) telnet production1.testorg.com 143


Thanks and regards
Markus



Re: How to access mailbox metadata in Lua push driver

2020-08-03 Thread Ralf Becker
Making progress :)

I'll document some obtracles I found, to make it easier for the next one
implementing push with Dovecot and Lua.

First I tried with my usual Alpine based container, but Alpine seems not
to build the Lua stuff for Dovecot :(

So I moved to an Ubuntu 18.04 based container and the official Dovecot
CE repo:

FROM ubuntu:18.04
RUN apt-get update && \
   apt-get install -y apt-transport-https gpg curl && \
   curl https://repo.dovecot.org/DOVECOT-REPO-GPG | gpg --import && \ gpg 
--export ED409DA1 > /etc/apt/trusted.gpg.d/dovecot.gpg && \ echo "deb 
https://repo.dovecot.org/ce-2.3-latest/ubuntu/bionic bionic main" > 
/etc/apt/sources.list.d/dovecot.list && \
   apt-get update && \
   bash -c "apt-get install -y
dovecot-{core,imapd,sqlite,managesieved,sieve,pop3d,lmtpd,submissiond,lua}
lua-socket"
CMD [ "/usr/sbin/dovecot","-F","-c","/etc/dovecot/dovecot.conf" ]

I had to install lua-socket, which is used by the example script and not 
required by dovecot-lua, which is ok, you just need to know.

Using Aki's code snippet as user= lead to an other error:

Aug 03 14:54:15 Error: doveadm: lua: /usr/share/lua/5.2/socket/url.lua:31: bad 
argument #1 to 'gsub' (string expected, got nil)
Aug 03 14:54:15 Error: lmtp( 38): lmtp-server: conn 10.9.94.14:42092 
[1]: rcpt : lua: /usr/share/lua/5.2/socket/url.lua:31: bad argument 
#1 to 'gsub' (string expected, got nil)

I'm now skipping the notification, if no metadata is set, like the OX
driver does:

function dovecot_lua_notify_event_message_new(ctx, event)
  -- check if there is a push token registered if (ctx.meta == nil or ctx.meta 
== '') then return end


Currently looking into the following questions:

- can I get the rfc 5423 type of event somehow (obviously I can set it
on the event myself depending of the function called)
- looking at the example code, it looks like it can be called for
multiple messages, when does that happen (LMTP send more then one)
- why is the mailbox status put into an other structure and send with a
different notifiction
- does anyone have a code snippet to send a JSON encoded message
(probably easy to figure out looking at Lua docu)

Ralf

Am 03.08.20 um 11:56 schrieb Ralf Becker:
> Thanks Aki, I'll check it out :)
>
>
> Am 03.08.20 um 11:40 schrieb Aki Tuomi:
>>> On 03/08/2020 12:31 Ralf Becker  wrote:
>>>
>>>  
>>> We're currently using the OX push driver, which is straight forward
>>> (simple web hook) and allows to store (multiple) push tokens of our
>>> webmailer direct in mailbox metadata.
>>>
>>> Only drawback is that it only supports new arriving mails in the INBOX,
>>> even mails moved via Sieve to other folders are NOT reported.
>>>
>>> Therefore we updated now to Dovecot 2.3(.10.1) to also get mails moved
>>> by user or Sieve scripts, deleted mails or flag changes.
>>>
>>> As far as I read the example Lua scripts and (a little) the Dovecot C
>>> code, the nice indirection of using mailbox metadata to a) enable push
>>> and b) store push tokens (modify reported user attribute with them) does
>>> NOT exist in the Lua driver by default.
>>>
>>> So my questions is: how can I access mailbox metadata from within the
>>> Lua script, to make eg. the example script behave like the OX driver
>>> with user_from_metadata set?
>>>
>>> I'm happy to update the Lua examples, if that's any help ...
>>>
>>> Ralf
>>>
>>> -- 
>>> Ralf Becker
>>> EGroupware GmbH [www.egroupware.org]
>>> Handelsregister HRB Kaiserslautern 3587
>>> Geschäftsführer Birgit und Ralf Becker
>>> Leibnizstr. 17, 67663 Kaiserslautern, Germany
>>> Telefon +49 631 31657-0
>> Actually it does exist:
>>
>> https://doc.dovecot.org/admin_manual/lua/#mail_user.metadata_get
>>
>> or
>>
>> https://doc.dovecot.org/admin_manual/lua/#object-mailbox
>>
>> mailbox:metadata_get()
>>
>> You get both of these objects from the push notification data, you just have 
>> to keep them in the context state. (See the example scripts)
>>
>> function dovecot_lua_notify_begin_txn(user)
>>local meta = user:metadata_get("/private/key")
>>return {messages={}, ep=user:plugin_getenv("push_lua_url"), 
>> username=user.username, meta=meta}
>> end
>>
>> Aki


-- 
Ralf Becker
EGroupware GmbH [www.egroupware.org]
Handelsregister HRB Kaiserslautern 3587
Geschäftsführer Birgit und Ralf Becker
Leibnizstr. 17, 67663 Kaiserslautern, Germany
Telefon +49 631 31657-0



signature.asc
Description: OpenPGP digital signature


Migration issue

2020-08-03 Thread Kishore Potnuru
Hi All,

I have tried the below command to migrate the data from the old
server(dovecot version: 2.0.9) to new servers(dovecot version: 2.2.36
(1f10bfa63)). But it's throwing an error.

old server name: production1
new server1 name: production2 (for HA/Replication)
new server2 name: production3  (for HA/Replication)

I have configured replication between production2 and production3, which is
working fine.

The issue is, the below command I am trying is from production2 server and
trying to take the data from production1 server.

-
[root@production2 log]# doveadm backup -a All -R -u kish...@test.testorg.com
imapc:
dsync(kish...@test.testorg.com): Info: imapc(production1.testorg.com:143):
Connected to xxx.xxx.xxx.xxx:143 (local yyy.yyy.yyy.yyy:45992)
dsync(kish...@test.testorg.com): Warning: imapc(production1.testorg.com:143):
connect(xxx.xxx.xxx.xxx, 143) timed out after 30 seconds - reconnecting
(delay 0 ms)
dsync(kish...@test.testorg.com): Info: imapc(production1.testorg.com:143):
Connected to xxx.xxx.xxx.xxx:143 (local yyy.yyy.yyy.yyy:46014)
dsync(kish...@test.testorg.com): Error: imapc(production1.testorg.com:143):
connect(xxx.xxx.xxx.xxx, 143) timed out after 30 seconds - disconnecting
dsync(kish...@test.testorg.com): Error: User initialization failed: imapc:
Login to production1.testorg.com failed: Disconnected from server
[root@production2 log]#
--

I looked into the production1 (old server) logs. I see the below error.

===
Jul 28 11:14:23 auth: Fatal: Master passdb can't have pass=yes if there are
no passdbs
Jul 28 11:14:23 master: Error: service(auth): command startup failed,
throttling
===

after the above error, I have commented "pass=yes" in production1 (old
server) server, then I see the below error.


Jul 28 11:17:10 auth: Fatal: No passdbs specified in configuration file.
PLAIN mechanism needs one
Jul 28 11:17:10 master: Error: service(auth): command startup failed,
throttling
===

Please suggest me on fixing the issue.

Adding the dovecot.conf configuration from old and new servers:

=
My old server dovecot.conf (production1):
=

disable_plaintext_auth = no

listen = *
log_path = /var/log/dovecot.log
mail_location = maildir:/z1dev/mail/virtual/%d/%n/Maildir/
passdb {
args = /etc/dovecot/passwd
driver = passwd-file
master = yes
pass = yes
}
pop3_uidl_format = %g
protocols = pop3 imap
ssl = yes
ssl_cert = 

Re: How to access mailbox metadata in Lua push driver

2020-08-03 Thread Ralf Becker
Thanks Aki, I'll check it out :)


Am 03.08.20 um 11:40 schrieb Aki Tuomi:
>> On 03/08/2020 12:31 Ralf Becker  wrote:
>>
>>  
>> We're currently using the OX push driver, which is straight forward
>> (simple web hook) and allows to store (multiple) push tokens of our
>> webmailer direct in mailbox metadata.
>>
>> Only drawback is that it only supports new arriving mails in the INBOX,
>> even mails moved via Sieve to other folders are NOT reported.
>>
>> Therefore we updated now to Dovecot 2.3(.10.1) to also get mails moved
>> by user or Sieve scripts, deleted mails or flag changes.
>>
>> As far as I read the example Lua scripts and (a little) the Dovecot C
>> code, the nice indirection of using mailbox metadata to a) enable push
>> and b) store push tokens (modify reported user attribute with them) does
>> NOT exist in the Lua driver by default.
>>
>> So my questions is: how can I access mailbox metadata from within the
>> Lua script, to make eg. the example script behave like the OX driver
>> with user_from_metadata set?
>>
>> I'm happy to update the Lua examples, if that's any help ...
>>
>> Ralf
>>
>> -- 
>> Ralf Becker
>> EGroupware GmbH [www.egroupware.org]
>> Handelsregister HRB Kaiserslautern 3587
>> Geschäftsführer Birgit und Ralf Becker
>> Leibnizstr. 17, 67663 Kaiserslautern, Germany
>> Telefon +49 631 31657-0
> Actually it does exist:
>
> https://doc.dovecot.org/admin_manual/lua/#mail_user.metadata_get
>
> or
>
> https://doc.dovecot.org/admin_manual/lua/#object-mailbox
>
> mailbox:metadata_get()
>
> You get both of these objects from the push notification data, you just have 
> to keep them in the context state. (See the example scripts)
>
> function dovecot_lua_notify_begin_txn(user)
>local meta = user:metadata_get("/private/key")
>return {messages={}, ep=user:plugin_getenv("push_lua_url"), 
> username=user.username, meta=meta}
> end
>
> Aki

-- 
Ralf Becker
EGroupware GmbH [www.egroupware.org]
Handelsregister HRB Kaiserslautern 3587
Geschäftsführer Birgit und Ralf Becker
Leibnizstr. 17, 67663 Kaiserslautern, Germany
Telefon +49 631 31657-0




signature.asc
Description: OpenPGP digital signature


Re: How to access mailbox metadata in Lua push driver

2020-08-03 Thread Aki Tuomi


> On 03/08/2020 12:31 Ralf Becker  wrote:
> 
>  
> We're currently using the OX push driver, which is straight forward
> (simple web hook) and allows to store (multiple) push tokens of our
> webmailer direct in mailbox metadata.
> 
> Only drawback is that it only supports new arriving mails in the INBOX,
> even mails moved via Sieve to other folders are NOT reported.
> 
> Therefore we updated now to Dovecot 2.3(.10.1) to also get mails moved
> by user or Sieve scripts, deleted mails or flag changes.
> 
> As far as I read the example Lua scripts and (a little) the Dovecot C
> code, the nice indirection of using mailbox metadata to a) enable push
> and b) store push tokens (modify reported user attribute with them) does
> NOT exist in the Lua driver by default.
> 
> So my questions is: how can I access mailbox metadata from within the
> Lua script, to make eg. the example script behave like the OX driver
> with user_from_metadata set?
> 
> I'm happy to update the Lua examples, if that's any help ...
> 
> Ralf
> 
> -- 
> Ralf Becker
> EGroupware GmbH [www.egroupware.org]
> Handelsregister HRB Kaiserslautern 3587
> Geschäftsführer Birgit und Ralf Becker
> Leibnizstr. 17, 67663 Kaiserslautern, Germany
> Telefon +49 631 31657-0

Actually it does exist:

https://doc.dovecot.org/admin_manual/lua/#mail_user.metadata_get

or

https://doc.dovecot.org/admin_manual/lua/#object-mailbox

mailbox:metadata_get()

You get both of these objects from the push notification data, you just have to 
keep them in the context state. (See the example scripts)

function dovecot_lua_notify_begin_txn(user)
   local meta = user:metadata_get("/private/key")
   return {messages={}, ep=user:plugin_getenv("push_lua_url"), 
username=user.username, meta=meta}
end

Aki


How to access mailbox metadata in Lua push driver

2020-08-03 Thread Ralf Becker
We're currently using the OX push driver, which is straight forward
(simple web hook) and allows to store (multiple) push tokens of our
webmailer direct in mailbox metadata.

Only drawback is that it only supports new arriving mails in the INBOX,
even mails moved via Sieve to other folders are NOT reported.

Therefore we updated now to Dovecot 2.3(.10.1) to also get mails moved
by user or Sieve scripts, deleted mails or flag changes.

As far as I read the example Lua scripts and (a little) the Dovecot C
code, the nice indirection of using mailbox metadata to a) enable push
and b) store push tokens (modify reported user attribute with them) does
NOT exist in the Lua driver by default.

So my questions is: how can I access mailbox metadata from within the
Lua script, to make eg. the example script behave like the OX driver
with user_from_metadata set?

I'm happy to update the Lua examples, if that's any help ...

Ralf

-- 
Ralf Becker
EGroupware GmbH [www.egroupware.org]
Handelsregister HRB Kaiserslautern 3587
Geschäftsführer Birgit und Ralf Becker
Leibnizstr. 17, 67663 Kaiserslautern, Germany
Telefon +49 631 31657-0




signature.asc
Description: OpenPGP digital signature


Re: Question about migration 2.2 - 2.3 with replication

2020-08-03 Thread Ralf Becker
Am 30.07.20 um 23:02 schrieb Ralf Becker:
> Do both replication nodes need to be updated at the same time?
>
> Or can a 2.2(.36.4) node replicate with a 2.3(.10.1)?
>
> Ralf


In case someone's looking here for an answer about 2.2 to 2.3 update
with replication and directors:

1. I first updated the directors, for which I run into the documented
problem with consistent hashing:
- docu says you can NOT run a director rind with different settings for
consistent hashing (director_consistent_hashing)
- I thought because I have nothing configured explicit, I wont be
affected, but that is wrong, as the default changed and therefore you are!
- to keep the director ring running, you have to explicitly configure
consistent hashing under 2.2 (I scaled down our K8s director service to
1 and reloaded that director, maybe you can also reload multiple
directors at the same time, I have not tried that)
- then you need to remove the  director_consistent_hashing  and update
your directors one by one
I also had to fix a couple of changed config settings eg.
ssl_protocols-->ssl_min_protocol

2. replicating backends: I updated one of the backends to 2.3 and it
started replicating with the old backend. I only been in that situation
for a couple of minutes (at night) before I updated the second backend
to 2.3.

So far the only thing we noticed: private seen flags on shared user
folders (which were never supported for replication!) seem to be not
functioning any more in 2.3. Not functioning means, if they are
configured you can not set a mail to seen in a shared user folder. After
removing this configuration:

location = mdbox:%%h/mdbox:INDEXPVT=~/shared/%%u  --> mdbox:%%h/mdbox

seen flags behave as expected / are identical now if you access the
mailbox direct or via the shared user folder, and the are identical on
both backends.

Ralf

-- 
Ralf Becker
EGroupware GmbH [www.egroupware.org]
Handelsregister HRB Kaiserslautern 3587
Geschäftsführer Birgit und Ralf Becker
Leibnizstr. 17, 67663 Kaiserslautern, Germany
Telefon +49 631 31657-0




signature.asc
Description: OpenPGP digital signature