diff --git a/pagure/lib/model.py b/pagure/lib/model.py index fd4b130..c6eb116 100644 --- a/pagure/lib/model.py +++ b/pagure/lib/model.py @@ -1146,7 +1146,7 @@ class Issue(BASE): ''' Return a unique reprensetation of the issue as string that can be used when sending emails. ''' - return '%s-ticket-%s@pagure' % (self.project.name, self.uid) + return '%s-ticket-%s' % (self.project.name, self.uid) @property def tags_text(self): @@ -1306,7 +1306,7 @@ class IssueComment(BASE): ''' Return a unique reprensetation of the issue as string that can be used when sending emails. ''' - return '%s-ticket-%s-%s@pagure' % ( + return '%s-ticket-%s-%s' % ( self.issue.project.name, self.issue.uid, self.id) @property @@ -1703,7 +1703,7 @@ class PullRequest(BASE): ''' Return a unique reprensetation of the issue as string that can be used when sending emails. ''' - return '%s-pull-request-%s@pagure' % (self.project.name, self.uid) + return '%s-pull-request-%s' % (self.project.name, self.uid) @property def discussion(self): @@ -1873,7 +1873,7 @@ class PullRequestComment(BASE): ''' Return a unique reprensetation of the issue as string that can be used when sending emails. ''' - return '%s-pull-request-%s-%s@pagure' % ( + return '%s-pull-request-%s-%s' % ( self.pull_request.project.name, self.pull_request.uid, self.id) @property diff --git a/pagure/lib/notify.py b/pagure/lib/notify.py index 1337d61..8bc496d 100644 --- a/pagure/lib/notify.py +++ b/pagure/lib/notify.py @@ -237,6 +237,9 @@ def send_email(text, subject, to_mail, subject_tag = project_name else: subject_tag = 'Pagure' + if mail_id: + mail_id = mail_id + "@%s" %\ + pagure.APP.config['DOMAIN_EMAIL_NOTIFICATIONS'] smtp = None for mailto in to_mail.split(','): diff --git a/tests/test_pagure_lib_notify.py b/tests/test_pagure_lib_notify.py index 97d6e22..b8b302d 100644 --- a/tests/test_pagure_lib_notify.py +++ b/tests/test_pagure_lib_notify.py @@ -341,7 +341,7 @@ class PagureLibNotifytests(tests.Modeltests): 'Email content', 'Email “Subject“', 'foo@bar.com,zöé@foo.net', - mail_id='test-pull-request-2edbf96ebe644f4bb31b94605e-1@pagure', + mail_id='test-pull-request-2edbf96ebe644f4bb31b94605e-1', in_reply_to='test-pull-request-2edbf96ebe644f4bb31b94605e@pagure', project_name='namespace/project', user_from='Zöé', @@ -351,8 +351,8 @@ MIME-Version: 1.0 Content-Transfer-Encoding: base64 Subject: =?utf-8?b?W25hbWVzcGFjZS9wcm9qZWN0XSBFbWFpbCDigJxTdWJqZWN04oCc?= From: =?utf-8?b?WsO2w6k=?= -mail-id: test-pull-request-2edbf96ebe644f4bb31b94605e-1@pagure -Message-Id: +mail-id: test-pull-request-2edbf96ebe644f4bb31b94605e-1@pagure.org +Message-Id: In-Reply-To: X-Auto-Response-Suppress: All X-pagure: https://pagure.org/ @@ -360,8 +360,8 @@ 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 +Reply-To: reply+819debcaa294a19ddedd9cfe0cb8faebb50d126adda0f02f203fce83824add55f2e640b75691d4a57cb95b25cc856b0815d1ad2a35ab358cda9de42e2b021957@pagure.org +Mail-Followup-To: reply+819debcaa294a19ddedd9cfe0cb8faebb50d126adda0f02f203fce83824add55f2e640b75691d4a57cb95b25cc856b0815d1ad2a35ab358cda9de42e2b021957@pagure.org RW1haWwgY29udGVudA== ''' @@ -371,7 +371,7 @@ RW1haWwgY29udGVudA== 'Email content', 'Email “Subject“', u'foo@bar.com,zöé@foo.net', - mail_id='test-pull-request-2edbf96ebe644f4bb31b94605e-1@pagure', + mail_id='test-pull-request-2edbf96ebe644f4bb31b94605e-1', in_reply_to='test-pull-request-2edbf96ebe644f4bb31b94605e@pagure', project_name='namespace/project', user_from='Zöé',