I need to push a message notification to external system when they receive new emails from their mailbox,so I used the push_notification_lua plugin.
My dovecot configuration file is as follows:
plugin { .... push_notification_driver = dlog push_notification_driver2 = lua:file=/etc/dovecot/custom-lua/push-notification.lua push_lua_url = http://localhost:10421/internal/dovecot/email-notification/receive }
protocol lda { mail_plugins = $mail_plugins sieve last_login push_notification mail_lua push_notification_lua .... }
============= I print the 'event' param's value log in function 'dovecot_lua_notify_event_message_new' in my lua script: function dovecot_lua_notify_event_message_new(ctx, event) dovecot.i_info("lua-push: event=" .. cjson.encode(event)) end
However, when I send a mail with multiple recivers, the notification event info seems to work abnormally.
Sender: wangzx@hxtmailtest.avicnet.cn Receivers: zhaoqb@hxtmailtest.avicnet.cn , wangzx7110@hxtmailtest.avicnet.cn
I found the two event object's field 'to_address' and 'to_display_name' value are same in /var/log/dovecot/lda.log. Please help me confirm if this is a bug?
The log in /var/log/dovecot/lda.log like bellow:
2025-08-06T09:38:11.383536+08:00 hxtmailtest-server dovecot: lda(wangzx7110@hxtmailtest.avicnet.cn)<548522><EkAeFgOykmiqXggAfhwsfQ>: lua-push: event={"snippet":"test!!","date":1754444290,"keywords":{},"to_display_name":"Zhaoqb","uid":19,"subject":"test","from_display_name":"","to_address":"zhaoqb@hxtmailtest.avicnet.cn","tz":480,"mailbox":"INBOX","to":"Zhaoqb <zhaoqb@hxtmailtest.avicnet.cn>, Wangzx7110\n <wangzx7110@hxtmailtest.avicnet.cn>","from":"wangzx@hxtmailtest.avicnet.cn","message_id":"<6e3a1265476c8197372afb7a1ac5ebbb@hxtmailtest.avicnet.cn>","uid_validity":1752827738,"flags":{},"from_address":"wangzx@hxtmailtest.avicnet.cn","name":"MessageNew"}
2025-08-06T09:38:11.423272+08:00 hxtmailtest-server dovecot: lda(zhaoqb@hxtmailtest.avicnet.cn)<548524><znZfFwOykmisXggAfhwsfQ>: lua-push: event={"subject":"test","mailbox":"INBOX","flags":{},"snippet":"test!!","from":"wangzx@hxtmailtest.avicnet.cn","date":1754444290,"from_address":"wangzx@hxtmailtest.avicnet.cn","keywords":{},"uid_validity":1752634929,"to_display_name":"Zhaoqb","to":"Zhaoqb <zhaoqb@hxtmailtest.avicnet.cn>, Wangzx7110\n <wangzx7110@hxtmailtest.avicnet.cn>","name":"MessageNew","from_display_name":"","tz":480,"to_address":"zhaoqb@hxtmailtest.avicnet.cn","uid":39,"message_id":"<6e3a1265476c8197372afb7a1ac5ebbb@hxtmailtest.avicnet.cn>"}
Thanks!
3825634@qq.com 3825634@qq.com
I need to push a message notification to external system when they receive new emails from their mailbox**so I used the push_notification_lua plugin. My dovecot configuration file is as follows** plugin { .... push_notification_driver = dlog push_notification_driver2 = lua:file=/etc/dovecot/custom-lua/push-notification.lua push_lua_url = http://localhost:10421/internal/dovecot/email-notification/receive } protocol lda { mail_plugins = $mail_plugins sieve last_login push_notification mail_lua push_notification_lua .... }
I print the 'event' param's value log in function 'dovecot_lua_notify_event_message_new' in my lua script: function dovecot_lua_notify_event_message_new(ctx, event) dovecot.i_info("lua-push: event=" .. cjson.encode(event)) end However, when I send a mail with multiple recivers, the notification event info seems to work abnormally. Sender: wangzx@hxtmailtest.avicnet.cn Receivers: zhaoqb@hxtmailtest.avicnet.cn , wangzx7110@hxtmailtest.avicnet.cn I found the two event object's field 'to_address' and 'to_display_name' value are same in /var/log/dovecot/lda.log. Please help me confirm if this is a bug? The log in /var/log/dovecot/lda.log like bellow: 2025-08-06T09:38:11.383536+08:00 hxtmailtest-server dovecot: lda(wangzx7110@hxtmailtest.avicnet.cn)<548522><EkAeFgOykmiqXggAfhwsfQ>: lua-push: event={"snippet":"test!!","date":1754444290,"keywords":{},"to_display_name":"Zhaoqb","uid":19,"subject":"test","from_display_name":"","to_address":"zhaoqb@hxtmailtest.avicnet.cn","tz":480,"mailbox":"INBOX","to":"Zhaoqb <zhaoqb@hxtmailtest.avicnet.cn>, Wangzx7110\n <wangzx7110@hxtmailtest.avicnet.cn>","from":"wangzx@hxtmailtest.avicnet.cn","message_id":"<6e3a1265476c8197372afb7a1ac5ebbb@hxtmailtest.avicnet.cn>","uid_validity":1752827738,"flags":{},"from_address":"wangzx@hxtmailtest.avicnet.cn","name":"MessageNew"} 2025-08-06T09:38:11.423272+08:00 hxtmailtest-server dovecot: lda(zhaoqb@hxtmailtest.avicnet.cn)<548524><znZfFwOykmisXggAfhwsfQ>: lua-push: event={"subject":"test","mailbox":"INBOX","flags":{},"snippet":"test!!","from":"wangzx@hxtmailtest.avicnet.cn","date":1754444290,"from_address":"wangzx@hxtmailtest.avicnet.cn","keywords":{},"uid_validity":1752634929,"to_display_name":"Zhaoqb","to":"Zhaoqb <zhaoqb@hxtmailtest.avicnet.cn>, Wangzx7110\n <wangzx7110@hxtmailtest.avicnet.cn>","name":"MessageNew","from_display_name":"","tz":480,"to_address":"zhaoqb@hxtmailtest.avicnet.cn","uid":39,"message_id":"<6e3a1265476c8197372afb7a1ac5ebbb@hxtmailtest.avicnet.cn>"} Thanks!
[1][IMG] [2]3825634@qq.com 3825634@qq.com
References
Visible links