We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
TP creation email should use BCC
Let's BCC by default when Pootle is communicating to lists of people.  When you create a TP all relevant people are listed in the To field.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pootle/core/mail.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 #
3 # Copyright (C) Pootle contributors.
4 #
5 # This file is a part of the Pootle project. It is distributed under the GPL3
6 # or later license. See the LICENSE file for a copy of the license and the
7 # AUTHORS file for copyright and authorship information.
8 
9 from django.core.mail import EmailMultiAlternatives, get_connection
10 
11 
12 def send_mail(subject, message, from_email, recipient_list,
13               fail_silently=False, auth_user=None, auth_password=None,
14               connection=None, html_message=None, headers=None):
15     """Override django send_mail function to allow use of custom email headers.
16     """
17 
18     connection = connection or get_connection(username=auth_user,
19                                               password=auth_password,
20                                               fail_silently=fail_silently)
21 
22     mail = EmailMultiAlternatives(subject, message,
23                                   from_email, recipient_list,
24                                   connection=connection, headers=headers)
25 
26     if html_message:
27         mail.attach_alternative(html_message, 'text/html')
28 
29     return mail.send()
30
```

Path: `pootle/apps/pootle_translationproject/receivers.py`
Content:
```
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 #
4 # Copyright (C) Pootle contributors.
5 #
6 # This file is a part of the Pootle project. It is distributed under the GPL3
7 # or later license. See the LICENSE file for a copy of the license and the
8 # AUTHORS file for copyright and authorship information.
9 
10 from django.contrib.auth import get_user_model
11 from django.core.mail import send_mail
12 from django.db.models import Q
13 from django.dispatch import receiver
14 from django.template.loader import render_to_string
15 from django.utils.translation import ugettext_lazy as _
16 
17 from pootle.core.url_helpers import urljoin
18 
19 from .models import TranslationProject
20 from .signals import tp_init_failed_async, tp_inited_async
21 
22 
23 def get_recipients(project):
24     User = get_user_model()
25     return list(set(User.objects.filter(
26         Q(permissionset__positive_permissions__codename="administrate",
27           permissionset__directory__pootle_path=project.pootle_path) |
28         Q(is_superuser=True)).values_list("email", flat=True)))
29 
30 
31 @receiver(tp_inited_async, sender=TranslationProject)
32 def tp_inited_async(instance, response_url, **kwargs):
33     ctx = {"tp": instance,
34            "url": urljoin(response_url, instance.get_absolute_url())}
35     message = render_to_string(
36         'projects/admin/email/translation_project_created.txt', ctx)
37     subject = _(u"Translation project (%s) created" % instance)
38     recipients = get_recipients(instance.project)
39     send_mail(subject, message, from_email=None,
40               recipient_list=recipients, fail_silently=True)
41 
42 
43 @receiver(tp_init_failed_async, sender=TranslationProject)
44 def tp_init_failed_async(instance, **kwargs):
45     ctx = {"tp": instance}
46     message = render_to_string(
47         'projects/admin/email/translation_project_creation_failed.txt', ctx)
48     subject = _(u"Translation project (%s) creation failed" % instance)
49     recipients = get_recipients(instance.project)
50     send_mail(subject, message, from_email=None,
51               recipient_list=recipients, fail_silently=True)
52
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/pootle/apps/pootle_translationproject/receivers.py b/pootle/apps/pootle_translationproject/receivers.py
--- a/pootle/apps/pootle_translationproject/receivers.py
+++ b/pootle/apps/pootle_translationproject/receivers.py
@@ -8,12 +8,12 @@
 # AUTHORS file for copyright and authorship information.
 
 from django.contrib.auth import get_user_model
-from django.core.mail import send_mail
 from django.db.models import Q
 from django.dispatch import receiver
 from django.template.loader import render_to_string
 from django.utils.translation import ugettext_lazy as _
 
+from pootle.core.mail import send_mail
 from pootle.core.url_helpers import urljoin
 
 from .models import TranslationProject
@@ -37,7 +37,7 @@
     subject = _(u"Translation project (%s) created" % instance)
     recipients = get_recipients(instance.project)
     send_mail(subject, message, from_email=None,
-              recipient_list=recipients, fail_silently=True)
+              recipient_list=[], fail_silently=True, bcc=recipients)
 
 
 @receiver(tp_init_failed_async, sender=TranslationProject)
@@ -48,4 +48,4 @@
     subject = _(u"Translation project (%s) creation failed" % instance)
     recipients = get_recipients(instance.project)
     send_mail(subject, message, from_email=None,
-              recipient_list=recipients, fail_silently=True)
+              recipient_list=[], fail_silently=True, bcc=recipients)
diff --git a/pootle/core/mail.py b/pootle/core/mail.py
--- a/pootle/core/mail.py
+++ b/pootle/core/mail.py
@@ -11,7 +11,8 @@
 
 def send_mail(subject, message, from_email, recipient_list,
               fail_silently=False, auth_user=None, auth_password=None,
-              connection=None, html_message=None, headers=None):
+              connection=None, html_message=None, headers=None,
+              cc=None, bcc=None):
     """Override django send_mail function to allow use of custom email headers.
     """
 
@@ -21,7 +22,8 @@
 
     mail = EmailMultiAlternatives(subject, message,
                                   from_email, recipient_list,
-                                  connection=connection, headers=headers)
+                                  connection=connection, headers=headers,
+                                  cc=cc, bcc=bcc)
 
     if html_message:
         mail.attach_alternative(html_message, 'text/html')

{"golden_diff": "diff --git a/pootle/apps/pootle_translationproject/receivers.py b/pootle/apps/pootle_translationproject/receivers.py\n--- a/pootle/apps/pootle_translationproject/receivers.py\n+++ b/pootle/apps/pootle_translationproject/receivers.py\n@@ -8,12 +8,12 @@\n # AUTHORS file for copyright and authorship information.\n \n from django.contrib.auth import get_user_model\n-from django.core.mail import send_mail\n from django.db.models import Q\n from django.dispatch import receiver\n from django.template.loader import render_to_string\n from django.utils.translation import ugettext_lazy as _\n \n+from pootle.core.mail import send_mail\n from pootle.core.url_helpers import urljoin\n \n from .models import TranslationProject\n@@ -37,7 +37,7 @@\n     subject = _(u\"Translation project (%s) created\" % instance)\n     recipients = get_recipients(instance.project)\n     send_mail(subject, message, from_email=None,\n-              recipient_list=recipients, fail_silently=True)\n+              recipient_list=[], fail_silently=True, bcc=recipients)\n \n \n @receiver(tp_init_failed_async, sender=TranslationProject)\n@@ -48,4 +48,4 @@\n     subject = _(u\"Translation project (%s) creation failed\" % instance)\n     recipients = get_recipients(instance.project)\n     send_mail(subject, message, from_email=None,\n-              recipient_list=recipients, fail_silently=True)\n+              recipient_list=[], fail_silently=True, bcc=recipients)\ndiff --git a/pootle/core/mail.py b/pootle/core/mail.py\n--- a/pootle/core/mail.py\n+++ b/pootle/core/mail.py\n@@ -11,7 +11,8 @@\n \n def send_mail(subject, message, from_email, recipient_list,\n               fail_silently=False, auth_user=None, auth_password=None,\n-              connection=None, html_message=None, headers=None):\n+              connection=None, html_message=None, headers=None,\n+              cc=None, bcc=None):\n     \"\"\"Override django send_mail function to allow use of custom email headers.\n     \"\"\"\n \n@@ -21,7 +22,8 @@\n \n     mail = EmailMultiAlternatives(subject, message,\n                                   from_email, recipient_list,\n-                                  connection=connection, headers=headers)\n+                                  connection=connection, headers=headers,\n+                                  cc=cc, bcc=bcc)\n \n     if html_message:\n         mail.attach_alternative(html_message, 'text/html')\n", "issue": "TP creation email should use BCC\nLet's BCC by default when Pootle is communicating to lists of people.  When you create a TP all relevant people are listed in the To field.\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n#\n# Copyright (C) Pootle contributors.\n#\n# This file is a part of the Pootle project. It is distributed under the GPL3\n# or later license. See the LICENSE file for a copy of the license and the\n# AUTHORS file for copyright and authorship information.\n\nfrom django.core.mail import EmailMultiAlternatives, get_connection\n\n\ndef send_mail(subject, message, from_email, recipient_list,\n              fail_silently=False, auth_user=None, auth_password=None,\n              connection=None, html_message=None, headers=None):\n    \"\"\"Override django send_mail function to allow use of custom email headers.\n    \"\"\"\n\n    connection = connection or get_connection(username=auth_user,\n                                              password=auth_password,\n                                              fail_silently=fail_silently)\n\n    mail = EmailMultiAlternatives(subject, message,\n                                  from_email, recipient_list,\n                                  connection=connection, headers=headers)\n\n    if html_message:\n        mail.attach_alternative(html_message, 'text/html')\n\n    return mail.send()\n", "path": "pootle/core/mail.py"}, {"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) Pootle contributors.\n#\n# This file is a part of the Pootle project. It is distributed under the GPL3\n# or later license. See the LICENSE file for a copy of the license and the\n# AUTHORS file for copyright and authorship information.\n\nfrom django.contrib.auth import get_user_model\nfrom django.core.mail import send_mail\nfrom django.db.models import Q\nfrom django.dispatch import receiver\nfrom django.template.loader import render_to_string\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom pootle.core.url_helpers import urljoin\n\nfrom .models import TranslationProject\nfrom .signals import tp_init_failed_async, tp_inited_async\n\n\ndef get_recipients(project):\n    User = get_user_model()\n    return list(set(User.objects.filter(\n        Q(permissionset__positive_permissions__codename=\"administrate\",\n          permissionset__directory__pootle_path=project.pootle_path) |\n        Q(is_superuser=True)).values_list(\"email\", flat=True)))\n\n\n@receiver(tp_inited_async, sender=TranslationProject)\ndef tp_inited_async(instance, response_url, **kwargs):\n    ctx = {\"tp\": instance,\n           \"url\": urljoin(response_url, instance.get_absolute_url())}\n    message = render_to_string(\n        'projects/admin/email/translation_project_created.txt', ctx)\n    subject = _(u\"Translation project (%s) created\" % instance)\n    recipients = get_recipients(instance.project)\n    send_mail(subject, message, from_email=None,\n              recipient_list=recipients, fail_silently=True)\n\n\n@receiver(tp_init_failed_async, sender=TranslationProject)\ndef tp_init_failed_async(instance, **kwargs):\n    ctx = {\"tp\": instance}\n    message = render_to_string(\n        'projects/admin/email/translation_project_creation_failed.txt', ctx)\n    subject = _(u\"Translation project (%s) creation failed\" % instance)\n    recipients = get_recipients(instance.project)\n    send_mail(subject, message, from_email=None,\n              recipient_list=recipients, fail_silently=True)\n", "path": "pootle/apps/pootle_translationproject/receivers.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n#\n# Copyright (C) Pootle contributors.\n#\n# This file is a part of the Pootle project. It is distributed under the GPL3\n# or later license. See the LICENSE file for a copy of the license and the\n# AUTHORS file for copyright and authorship information.\n\nfrom django.core.mail import EmailMultiAlternatives, get_connection\n\n\ndef send_mail(subject, message, from_email, recipient_list,\n              fail_silently=False, auth_user=None, auth_password=None,\n              connection=None, html_message=None, headers=None,\n              cc=None, bcc=None):\n    \"\"\"Override django send_mail function to allow use of custom email headers.\n    \"\"\"\n\n    connection = connection or get_connection(username=auth_user,\n                                              password=auth_password,\n                                              fail_silently=fail_silently)\n\n    mail = EmailMultiAlternatives(subject, message,\n                                  from_email, recipient_list,\n                                  connection=connection, headers=headers,\n                                  cc=cc, bcc=bcc)\n\n    if html_message:\n        mail.attach_alternative(html_message, 'text/html')\n\n    return mail.send()\n", "path": "pootle/core/mail.py"}, {"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) Pootle contributors.\n#\n# This file is a part of the Pootle project. It is distributed under the GPL3\n# or later license. See the LICENSE file for a copy of the license and the\n# AUTHORS file for copyright and authorship information.\n\nfrom django.contrib.auth import get_user_model\nfrom django.db.models import Q\nfrom django.dispatch import receiver\nfrom django.template.loader import render_to_string\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom pootle.core.mail import send_mail\nfrom pootle.core.url_helpers import urljoin\n\nfrom .models import TranslationProject\nfrom .signals import tp_init_failed_async, tp_inited_async\n\n\ndef get_recipients(project):\n    User = get_user_model()\n    return list(set(User.objects.filter(\n        Q(permissionset__positive_permissions__codename=\"administrate\",\n          permissionset__directory__pootle_path=project.pootle_path) |\n        Q(is_superuser=True)).values_list(\"email\", flat=True)))\n\n\n@receiver(tp_inited_async, sender=TranslationProject)\ndef tp_inited_async(instance, response_url, **kwargs):\n    ctx = {\"tp\": instance,\n           \"url\": urljoin(response_url, instance.get_absolute_url())}\n    message = render_to_string(\n        'projects/admin/email/translation_project_created.txt', ctx)\n    subject = _(u\"Translation project (%s) created\" % instance)\n    recipients = get_recipients(instance.project)\n    send_mail(subject, message, from_email=None,\n              recipient_list=[], fail_silently=True, bcc=recipients)\n\n\n@receiver(tp_init_failed_async, sender=TranslationProject)\ndef tp_init_failed_async(instance, **kwargs):\n    ctx = {\"tp\": instance}\n    message = render_to_string(\n        'projects/admin/email/translation_project_creation_failed.txt', ctx)\n    subject = _(u\"Translation project (%s) creation failed\" % instance)\n    recipients = get_recipients(instance.project)\n    send_mail(subject, message, from_email=None,\n              recipient_list=[], fail_silently=True, bcc=recipients)\n", "path": "pootle/apps/pootle_translationproject/receivers.py"}]}