[aur-dev] [PATCH] Add threading headers to notification mail
It is only basic, but works in this way for other platforms. Could be enhanced to include all previous comments in 'References:' This would require to have predictable 'Message-ID:' for notification mails. Could also be used for out of date notifications --- web/lib/pkgbasefuncs.inc.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php index 4d05b94..f53ff61 100644 --- a/web/lib/pkgbasefuncs.inc.php +++ b/web/lib/pkgbasefuncs.inc.php @@ -138,6 +138,8 @@ function pkgbase_add_comment($base_id, $uid, $comment) { "Bcc: $bcc\r\n" . "Reply-to: nobody@archlinux.org\r\n" . "From: aur-notify@archlinux.org\r\n" . + "In-Reply-To: <" . $row['Name'] . "@aur.archlinux.org>\r\n" . + "References: <" . $row['Name'] . "@aur.archlinux.org>\r\n" . "X-Mailer: AUR"; @mail('undisclosed-recipients: ;', "AUR Comment for " . $row['Name'], $body, $headers); } -- 1.9.2
On Sat, 17 May 2014 at 14:30:36, Thomas Weißschuh wrote:
I like this idea. However, I do not think the message IDs you picked are a good choice. I would at least prefix them with "pkg-". Could you please change that and resend? I would also appreciate a brief remark in the commit message including an explanation how this works (I was quite confused because we are referencing a message ID that doesn't exist; MUAs don't seem to care about that, though).
It is only basic, but works in this way for other platforms. It works because MUAs are able to reconstruct threads originating from mails they don't know about (unknown Message-ID). This has some drawbacks: * MUAs might show the missing start of the thread. As a normal user of a package never got *all* notifications of a package anyways it only reflects the reality * Missing notifications go unnoticed. This is no regression so it should be fine Those could be fixed by including all previous comments in 'References:', which would require to have predictable 'Message-ID:' for notification mails. This would require more code and more database accesses at runtime. Could also be used for out of date notifications. --- web/lib/pkgbasefuncs.inc.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php index 4d05b94..34ff302 100644 --- a/web/lib/pkgbasefuncs.inc.php +++ b/web/lib/pkgbasefuncs.inc.php @@ -133,11 +133,14 @@ function pkgbase_add_comment($base_id, $uid, $comment) { . "\n\n---\nIf you no longer wish to receive notifications about this package, please go the the above package page and click the UnNotify button."; $body = wordwrap($body, 70); $bcc = implode(', ', $bcc); + $thread_id = "<pkg-notifications-" . $row['Name'] . "@aur.archlinux.org>"; $headers = "MIME-Version: 1.0\r\n" . "Content-type: text/plain; charset=UTF-8\r\n" . "Bcc: $bcc\r\n" . "Reply-to: nobody@archlinux.org\r\n" . "From: aur-notify@archlinux.org\r\n" . + "In-Reply-To: $thread_id\r\n" . + "References: $thread_id\r\n" . "X-Mailer: AUR"; @mail('undisclosed-recipients: ;', "AUR Comment for " . $row['Name'], $body, $headers); } -- 1.9.3
participants (2)
-
Lukas Fleischer
-
Thomas Weißschuh