diff options
author | Thomas Weißschuh <thomas@t-8ch.de> | 2014-05-20 18:42:53 +0000 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2014-05-20 21:58:36 +0200 |
commit | 8658bf22aac73ed8d32d3f998c3c13528f415ffe (patch) | |
tree | cc3dffb5b4c02931d98413d4d284b72c32005284 /web/lib/pkgbasefuncs.inc.php | |
parent | cf6470803e5a1ce8669d50991b50ebec9bed50bf (diff) |
Add threading headers to notification mail
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.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib/pkgbasefuncs.inc.php')
-rw-r--r-- | web/lib/pkgbasefuncs.inc.php | 3 |
1 files changed, 3 insertions, 0 deletions
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); } |