Ich würde das Thema Push nochmal aufgreifen und hoffentlich abschließend abarbeiten.
Der EGw Push funktioniert soweit ich das beurteilen kann. Ich lege als User A im Kalender der Gruppe Default einen Termin an und User 2 bekommt ein PopUp oben / rechts. das ist doch der besagte Push, oder?
zum IMAP-Push. Hier ist wie gesagt die Version dovecot 2.3.4.1. gegeben. Ich habe mal das Paket dovecot-auth-lua nachinstalliert und nach der Anleitung im WIKI vorgegangen.
-
bearer-token ausgelesen
-
Dieser enthält weder + noch / … also nächsten Schritt übersprungen. Weiter zu Dovecot 2.3
-
Pakete installiert mit Ausnahme von dovecot-lua
root@com01:~# dpkg -l|grep lua
ii dovecot-auth-lua 1:2.3.4.1-5+deb10u6 amd64 secure POP3/IMAP server - Lua authentication plugin
ii liblua5.1-0:amd64 5.1.5-8.1+b2 amd64 Shared library for the Lua interpreter version 5.1
ii liblua5.2-0:amd64 5.2.4-1.1+b2 amd64 Shared library for the Lua interpreter version 5.2
ii liblua5.3-0:amd64 5.3.3-1.1 amd64 Shared library for the Lua interpreter version 5.3
ii lua-json 1.3.4-2 all JSON decoder/encoder for Lua
ii lua-lpeg:amd64 1.0.0-2 amd64 LPeg library for the Lua language
ii lua-socket:amd64 3.0~rc1+git+ac3201d-4 amd64 TCP/UDP socket library for the Lua language
curl https://raw.githubusercontent.com/EGroupware/swoolepush/master/doc/dovecot-push.lua > /etc/dovecot/dovecot-push.lua
- Datei /etc/dovecot/conf.d/14-egroupware-push.conf angelegt mit folgendem Inhalt:
# Store METADATA information in a file dovecot-metadata in user's home
mail_attribute_dict = file:%h/dovecot-metadata
# enable metadata
protocol imap {
imap_metadata = yes
}
# add necessary plugins for Lua push notifications
mail_plugins = $mail_plugins mail_lua notify push_notification push_notification_lua
# Lua notification script and URL of EGroupware push server
plugin {
push_notification_driver = lua:file=/etc/dovecot/dovecot-push.lua
push_lua_url = https://Bearer:AbCdEfGhIjKlMnOp@http://com01.test.lan/egroupware/push
}
- systemctl restart dovecot
In EGw als Benutzer angemeldet und diesem User von extern eine Mail gesendet und den Posteingang einfach nur beobachtet. Parallel dazu das Logfile auf dem UCS. Dort sehe ich dass die Mail zugestellt wurde aber in EGw wird diese erst angezeigt wenn ich erneut in den Posteingang klicke.
Daraus schließe ich das IMAP-Push nicht funktioniert
Im Log finde ich auch einen entsprechenden Fehler zu LUA:
Jan 22 12:02:28 com01 systemd[1]: Started Dovecot IMAP/POP3 email server.
Jan 22 12:02:28 com01 dovecot[6574]: doveconf: Warning: NOTE: You can get a new clean config file with: doveconf -Pn > dovecot-new.conf
Jan 22 12:02:28 com01 dovecot[6574]: doveconf: Warning: Obsolete setting in /etc/dovecot/conf.d/10-ssl.conf:61: ssl_protocols has been replaced by ssl_min_protocol
Jan 22 12:02:28 com01 dovecot[6574]: doveconf: Warning: NOTE: You can get a new clean config file with: doveconf -Pn > dovecot-new.conf
Jan 22 12:02:28 com01 dovecot[6574]: doveconf: Warning: Obsolete setting in /etc/dovecot/conf.d/10-ssl.conf:61: ssl_protocols has been replaced by ssl_min_protocol
Jan 22 12:02:28 com01 dovecot[6574]: master: Dovecot v2.3.4.1 (f79e8e7e4) starting up for imap, lmtp, sieve, pop3 (core dumps disabled)
Jan 22 12:02:28 com01 dovecot[6577]: doveconf: Warning: NOTE: You can get a new clean config file with: doveconf -Pn > dovecot-new.conf
Jan 22 12:02:28 com01 dovecot[6577]: doveconf: Warning: Obsolete setting in /etc/dovecot/conf.d/10-ssl.conf:61: ssl_protocols has been replaced by ssl_min_protocol
Jan 22 12:02:28 com01 dovecot[6577]: config: Warning: NOTE: You can get a new clean config file with: doveconf -Pn > dovecot-new.conf
Jan 22 12:02:28 com01 dovecot[6577]: config: Warning: Obsolete setting in /etc/dovecot/conf.d/10-ssl.conf:61: ssl_protocols has been replaced by ssl_min_protocol
Jan 22 12:04:53 com01 fetchmail[6027]: 1 Nachricht für sven@extern.de bei pop3.strato.de (5160 Bytes).
Jan 22 12:04:53 com01 postfix/smtpd[6582]: connect from localhost[127.0.0.1]
Jan 22 12:04:53 com01 postfix/smtpd[6582]: A73284035AF: client=localhost[127.0.0.1]
Jan 22 12:04:53 com01 postfix/cleanup[6585]: A73284035AF: message-id=<CAFJA1Epg_-J0QuSjUZmCW9TY-03kiomd9pT7SV=1tHqhRzKEhA@mail.gmail.com>
Jan 22 12:04:53 com01 postfix/qmgr[1159]: A73284035AF: from=<ich@gmail.com>, size=5475, nrcpt=1 (queue active)
Jan 22 12:04:53 com01 fetchmail[6027]: Nachricht sven@extern.de@pop3.strato.de:1 von 1 wird gelesen (5160 Bytes) gelöscht
Jan 22 12:04:53 com01 postfix/smtp[6586]: warning: database /etc/postfix/tls_policy.db is older than source file /etc/postfix/tls_policy
Jan 22 12:04:53 com01 postfix/smtpd[6582]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Jan 22 12:04:58 com01 postfix/smtpd[6589]: connect from localhost[127.0.0.1]
Jan 22 12:04:58 com01 postfix/smtpd[6589]: C20CB40358C: client=localhost[127.0.0.1], orig_queue_id=A73284035AF, orig_client=localhost[127.0.0.1]
Jan 22 12:04:58 com01 postfix/cleanup[6585]: C20CB40358C: message-id=<CAFJA1Epg_-J0QuSjUZmCW9TY-03kiomd9pT7SV=1tHqhRzKEhA@mail.gmail.com>
Jan 22 12:04:58 com01 postfix/qmgr[1159]: C20CB40358C: from=<ich@gmail.com>, size=6261, nrcpt=1 (queue active)
Jan 22 12:04:58 com01 postfix/smtpd[6589]: disconnect from localhost[127.0.0.1] ehlo=1 xforward=1 mail=1 rcpt=1 data=1 quit=1 commands=6
Jan 22 12:04:58 com01 amavis[1782]: (01782-02) Passed CLEAN {RelayedInbound}, [127.0.0.1]:58140 [2607:f8b0:4864:20::930] <ich@gmail.com> -> <sven@extern.de>, Queue-ID: A73284035AF, Message-ID: <CAFJA1Epg_-J0QuSjUZmCW9TY-03kiomd9pT7SV=1tHqhRzKEhA@mail.gmail.com>, mail_id: w4lQr4Q6lpkx, Hits: 1.177, size: 5475, queued_as: C20CB40358C, 5054 ms
Jan 22 12:04:58 com01 postfix/smtp[6586]: A73284035AF: to=<sven@extern.de>, relay=127.0.0.1[127.0.0.1]:10024, delay=5.1, delays=0.07/0.01/0/5.1, 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 C20CB40358C)
Jan 22 12:04:58 com01 postfix/qmgr[1159]: A73284035AF: removed
Jan 22 12:04:58 com01 dovecot[6577]: lmtp(6591): Connect from local
Jan 22 12:04:58 com01 dovecot[6577]: lmtp(sven@extern.de)<6591><kyGnMNrk62G/GQAAZr5PVw>: Error: lua: /etc/dovecot/dovecot-push.lua:24: attempt to call a nil value (method 'metadata_get')
Jan 22 12:04:58 com01 dovecot[6577]: lmtp(sven@extern.de)<6591><kyGnMNrk62G/GQAAZr5PVw>: sieve: msgid=<CAFJA1Epg_-J0QuSjUZmCW9TY-03kiomd9pT7SV=1tHqhRzKEhA@mail.gmail.com>: stored mail into mailbox 'INBOX'
Ich habe den Fehler mal im Web gesucht aber wirklich schlau wurde ich daraus nicht.
Beste Grüße
Was ich heraus finden konnte ist dass der Fehler bei Ausführung von /etc/dovecot/dovecot-push.lua in Zeile 24 angegeben Aufruf:
23 function dovecot_lua_notify_begin_txn(user)
24 local meta = user:metadata_get("/private/vendor/vendor.dovecot/http-notify")
25 if (meta == nil or meta:sub(1,5) ~= "user=")
26 then
27 meta = nil;
28 else
29 meta = meta:sub(6)
30 end
31 return {user=user, event=dovecot.event(), ep=user:plugin_getenv("push_lua_url"), messages={}, meta=meta}
32 end
Daher kommen muss dass die Datei: /private/vendor/vendor.dovecot/http-notify nicht existiert.
Dein Dovecot ist leider zu alt, die metadata_get Methode gibt es erst sein Dovecot 2.3.7:
https://doc.dovecot.org/admin_manual/lua/?highlight=acl#mail_user.metadata_get
Außer unsere Docu entsprechend anzupassen, kann ich Dir leider nicht viel helfen.
Du kannst natürlich den seit Dovecot 2.2 existierenden Push der nur neue Mails in der INBOX unterstützt verwenden, bis Univention ihr Dovecot Paket aktualisiert.
Ralf
Da hast übrigens noch einen notwendigen Schritt ausgelassen:
Add IMAP server name (or IP-addresse) used in EGroupware in Mail site configuration: Admin > Applications > Mail > Site configuration
Sonst trägt die EGroupware das Benutzertoken nicht in die IMAP Metadaten ein (war aber nicht Dein Problem mit UCS).
Ralf
Das lasse ich erst mal. Wenn lediglich die Inbox aktualisiert wird würde das vorerst mal ausreichen.
Nur vergessen hier zu erwähnen. Dort ist:
com01.test.lan
eingetragen.
Die conf-Datei für 2.3+ habe ich entfernt und die /etc/dovecot/conf.d/99-egroupware-push.conf wie folgt angelegt:
mail_attribute_dict = file:%h/dovecot-metadata
protocol imap {
imap_metadata = yes
}
protocol lmtp {
mail_plugins = $mail_plugins notify push_notification
}
plugin {
push_notification_driver = ox:url=http://Bearer:AbCdEfGhIjK@com01.test.lan/egroupware/push user_from_metadata
}
angelegt und neu gestartet.
Allerdings erhalte ich trotzdem einen Fehler im Log
Jan 22 14:39:07 com01 dovecot[5775]: lmtp(5840): Error: push-notification-ox: Error when sending notification: Redirect refused
Ich habe auch schon, wie im Forum gefunden vor com01 noch ein http:// gestellt aber dann kommt ein Fehler das er den Namen nicht auflösen kann. Also denke ich mal ohne http:// rechts vom @
Dann würde ich mal sagen, irgendwas sendet einen Redirect - vermutlich auf https - wenn Du die URL aufrufst.
Führ doch einfach mal folgendes auf dem Host aus:
curl -i http://Bearer:AbCdEfGhIjK@com01.test.lan/egroupware/push
curl -i https://Bearer:AbCdEfGhIjK@com01.test.lan/egroupware/push
curl -i http://Bearer:AbCdEfGhIjK@127.0.0.1/egroupware/push
Wenn es ein https redirect ist, nimm einfach die https-URL, der Dovecot 2.3 kann das.
Das Bearer Token des Push Servers hier zu posten ist keine gute Idee, damit kann man den Push Server beliebige Befehle an die EGroupware Clients senden lassen
Ralf
HTTP/1.1 301 Moved Permanently
Date: Mon, 24 Jan 2022 07:34:40 GMT
Server: Apache/2.4.38 (Univention)
Location: https://com01.test.lan/egroupware/push
Content-Length: 330
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://com01.test.lan/egroupware/push">here</a>.</p>
<hr>
<address>Apache/2.4.38 (Univention) Server at com01.test.lan Port 80</address>
</body></html>
TTP/1.1 500 Internal Server Error
Date: Mon, 24 Jan 2022 07:35:30 GMT
Server: nginx/1.20.2
Content-Type: text/html
Content-Length: 0
Via: 1.1 com01.test.lan
Connection: close
HTTP/1.1 301 Moved Permanently
Date: Mon, 24 Jan 2022 07:36:11 GMT
Server: Apache/2.4.38 (Univention)
Location: https://127.0.0.1/egroupware/push
Content-Length: 320
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://127.0.0.1/egroupware/push">here</a>.</p>
<hr>
<address>Apache/2.4.38 (Univention) Server at 127.0.0.1 Port 80</address>
</body></html>
Also obwohl bei dem curl-Befehl mit https ein Fehler kommt?
Der gepostete Token ist der Anfang unseres Alphabetes und entspricht nicht dem tatsächlichen Token.
root@com01:~# docker logs -f --tail=1 egroupware-nginx
2022/01/24 08:57:27 [error] 23#23: *4 FastCGI sent in stderr: "PHP message: PHP Deprecated: Replicating claims as headers is deprecated and will removed from v4.0. Please manually set the header if you need it replicated. in /usr/share/egroupware/vendor/lcobucci/jwt/src/Builder.php on line 352
PHP message: PHP Deprecated: Using integers for registered date claims is deprecated, please use DateTimeImmutable objects instead. in /usr/share/egroupware/vendor/lcobucci/jwt/src/Builder.php on line 169
PHP message: PHP Deprecated: Using integers for registered date claims is deprecated, please use DateTimeImmutable objects instead. in /usr/share/egroupware/vendor/lcobucci/jwt/src/Builder.php on line 169
PHP message: PHP Deprecated: Using integers for registered date claims is deprecated, please use DateTimeImmutable objects instead. in /usr/share/egroupware/vendor/lcobucci/jwt/src/Builder.php on line 169
PHP message: PHP Deprecated: Not specifying the signer and key to Builder#getToken() is deprecated. Please move the arguments from Builder#sign() to Builder#getToken(). in /usr/share/egroupware/vendor/lcobucci/jwt/src/Builder.php on line 524"
while reading response header from upstream, client: 172.16.1.1, server: _, request: "POST /egroupware/json.php?menuaction=EGroupware\Status\Ui::ajax_refresh HTTP/1.1", upstream: "fastcgi://172.16.1.2:9000", host: "com01.test.lan", referrer: "https://com01.test.lan/egroupware/index.php?cd=yes"
Nein, war während fetchmail Mails geholt hat. Habe jetzt nochmal fetchmail gestoppt. Den Log gestartet:
root@com01:~# docker logs -f --tail=1 egroupware-nginx
und uf einer zweiten Konsole:
curl -i https://Bearer:AbCdEfGhIjK@com01.test.lan/egroupware/push
ausgeführt.
Da taucht im Log aber nichts auf.
Ok, fetchmail läuft wieder. Log gestartet und Mail von extern gesendet:
Datei /etc/dovecot/conf.d/99-egroupware-push.conf:
mail_attribute_dict = file:%h/dovecot-metadata
protocol imap {
imap_metadata = yes
}
protocol lmtp {
mail_plugins = $mail_plugins notify push_notification
}
plugin {
push_notification_driver = ox:url=http://Bearer:AbCdEfGhIjKlNm@com01.test.lan/egroupware/push user_from_metadata
}
Wenn die Mail rein kommt taucht im normalen Syslog nach wie vor die Meldung:
Jan 24 10:18:38 com01 dovecot[763]: lmtp(5771): Error: push-notification-ox: Error when sending notification: Redirect refused
auf. Im Fenster in welchem “root@com01:~# docker logs -f --tail=1 egroupware-nginx” läuft ist keine neue Meldung hinzu gekommen.