From 8d6e8b18af270317ad5255176bcaedf1722bd974 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jun 12 2017 14:38:27 +0000 Subject: Add the list-id, list-archive and X-Auto-Response-Suppress email headers Fixes https://pagure.io/pagure/issue/2294 --- diff --git a/pagure/lib/notify.py b/pagure/lib/notify.py index 6435ed3..1337d61 100644 --- a/pagure/lib/notify.py +++ b/pagure/lib/notify.py @@ -252,9 +252,14 @@ def send_email(text, subject, to_mail, if in_reply_to: msg['In-Reply-To'] = '<%s>' % in_reply_to + msg['X-Auto-Response-Suppress'] = 'All' msg['X-pagure'] = pagure.APP.config['APP_URL'] if project_name is not None: msg['X-pagure-project'] = project_name + msg['List-ID'] = project_name + msg['List-Archive'] = _build_url( + pagure.APP.config['APP_URL'], + _fullname_to_url(project_name)) # Send the message via our own SMTP server, but don't include the # envelope header. diff --git a/tests/test_pagure_lib_notify.py b/tests/test_pagure_lib_notify.py index ab3f7cb..97d6e22 100644 --- a/tests/test_pagure_lib_notify.py +++ b/tests/test_pagure_lib_notify.py @@ -354,8 +354,11 @@ From: =?utf-8?b?WsO2w6k=?= mail-id: test-pull-request-2edbf96ebe644f4bb31b94605e-1@pagure Message-Id: In-Reply-To: +X-Auto-Response-Suppress: All X-pagure: https://pagure.org/ X-pagure-project: namespace/project +List-ID: namespace/project +List-Archive: https://pagure.org/namespace/project To: zöé@foo.net Reply-To: reply+42f5809bca16d73f59180bdcc76c981e939b5eab5c02930d7d7dd38f45118b89e9ceb877e94e7f22376fbf35aab1d0e8e83dfb074ee82640cc82da12ea8019ca@pagure.org Mail-Followup-To: reply+42f5809bca16d73f59180bdcc76c981e939b5eab5c02930d7d7dd38f45118b89e9ceb877e94e7f22376fbf35aab1d0e8e83dfb074ee82640cc82da12ea8019ca@pagure.org