prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Robots.txt is missing from urls.py
  # Impacted versions
  
  * Modoboa: 1.12.2 and older
  * installer used: Yes, but some modifications made
  * Webserver: Nginx
  
  # Steps to reproduce
  Install modoboa and enable webinterface.
  
  # Current behavior
  No robots.txt is defined. Search engines do not now how to index the website. When search engines try to find robots.txt an 404 is raised and the error is mailed to ADMINS (if configured)
  
  # Expected behavior
  Robots.txt in urls.py defined, to deny all traffic, as webmail should not be publicly indexed by search engines. Possible fix, add:
  `path('robots.txt', lambda r: HttpResponse("User-agent: *\nDisAllow: /", content_type="text/plain"), name='robots')`
  
  # Video/Screenshot link (optional)
  
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `modoboa/core/urls.py`
  Content:
  ```
  1 """Core urls."""
  2 
  3 from django.urls import path
  4 
  5 from . import views
  6 
  7 app_name = "core"
  8 
  9 urlpatterns = [
  10     path('', views.RootDispatchView.as_view(), name="root"),
  11     path('dashboard/', views.DashboardView.as_view(), name="dashboard"),
  12 
  13     path('accounts/login/', views.dologin, name="login"),
  14     path('accounts/logout/', views.dologout, name="logout"),
  15     path('accounts/2fa_verify/',
  16          views.TwoFactorCodeVerifyView.as_view(),
  17          name='2fa_verify'),
  18 
  19     path('core/', views.viewsettings, name="index"),
  20     path('core/parameters/', views.parameters, name="parameters"),
  21     path('core/info/', views.information, name="information"),
  22     path('core/logs/', views.logs, name="log_list"),
  23     path('core/logs/page/', views.logs_page, name="logs_page"),
  24     path('core/top_notifications/check/',
  25          views.check_top_notifications,
  26          name="top_notifications_check"),
  27 
  28     path('user/', views.index, name="user_index"),
  29     path('user/preferences/', views.preferences,
  30          name="user_preferences"),
  31     path('user/profile/', views.profile, name="user_profile"),
  32     path('user/api/', views.api_access, name="user_api_access"),
  33     path('user/security/', views.security, name="user_security"),
  34 ]
  35
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/modoboa/core/urls.py b/modoboa/core/urls.py
  --- a/modoboa/core/urls.py
  +++ b/modoboa/core/urls.py
  @@ -1,6 +1,7 @@
   """Core urls."""
   
   from django.urls import path
  +from django.views.generic.base import TemplateView
   
   from . import views
   
  @@ -31,4 +32,5 @@
       path('user/profile/', views.profile, name="user_profile"),
       path('user/api/', views.api_access, name="user_api_access"),
       path('user/security/', views.security, name="user_security"),
  +    path('robots.txt', TemplateView.as_view(template_name="core/robots.txt", content_type="text/plain")),
   ]
  
verification_info: {"golden_diff": "diff --git a/modoboa/core/urls.py b/modoboa/core/urls.py\n--- a/modoboa/core/urls.py\n+++ b/modoboa/core/urls.py\n@@ -1,6 +1,7 @@\n \"\"\"Core urls.\"\"\"\n \n from django.urls import path\n+from django.views.generic.base import TemplateView\n \n from . import views\n \n@@ -31,4 +32,5 @@\n     path('user/profile/', views.profile, name=\"user_profile\"),\n     path('user/api/', views.api_access, name=\"user_api_access\"),\n     path('user/security/', views.security, name=\"user_security\"),\n+    path('robots.txt', TemplateView.as_view(template_name=\"core/robots.txt\", content_type=\"text/plain\")),\n ]\n", "issue": "Robots.txt is missing from urls.py\n# Impacted versions\r\n\r\n* Modoboa: 1.12.2 and older\r\n* installer used: Yes, but some modifications made\r\n* Webserver: Nginx\r\n\r\n# Steps to reproduce\r\nInstall modoboa and enable webinterface.\r\n\r\n# Current behavior\r\nNo robots.txt is defined. Search engines do not now how to index the website. When search engines try to find robots.txt an 404 is raised and the error is mailed to ADMINS (if configured)\r\n\r\n# Expected behavior\r\nRobots.txt in urls.py defined, to deny all traffic, as webmail should not be publicly indexed by search engines. Possible fix, add:\r\n`path('robots.txt', lambda r: HttpResponse(\"User-agent: *\\nDisAllow: /\", content_type=\"text/plain\"), name='robots')`\r\n\r\n# Video/Screenshot link (optional)\r\n\r\n\n", "before_files": [{"content": "\"\"\"Core urls.\"\"\"\n\nfrom django.urls import path\n\nfrom . import views\n\napp_name = \"core\"\n\nurlpatterns = [\n    path('', views.RootDispatchView.as_view(), name=\"root\"),\n    path('dashboard/', views.DashboardView.as_view(), name=\"dashboard\"),\n\n    path('accounts/login/', views.dologin, name=\"login\"),\n    path('accounts/logout/', views.dologout, name=\"logout\"),\n    path('accounts/2fa_verify/',\n         views.TwoFactorCodeVerifyView.as_view(),\n         name='2fa_verify'),\n\n    path('core/', views.viewsettings, name=\"index\"),\n    path('core/parameters/', views.parameters, name=\"parameters\"),\n    path('core/info/', views.information, name=\"information\"),\n    path('core/logs/', views.logs, name=\"log_list\"),\n    path('core/logs/page/', views.logs_page, name=\"logs_page\"),\n    path('core/top_notifications/check/',\n         views.check_top_notifications,\n         name=\"top_notifications_check\"),\n\n    path('user/', views.index, name=\"user_index\"),\n    path('user/preferences/', views.preferences,\n         name=\"user_preferences\"),\n    path('user/profile/', views.profile, name=\"user_profile\"),\n    path('user/api/', views.api_access, name=\"user_api_access\"),\n    path('user/security/', views.security, name=\"user_security\"),\n]\n", "path": "modoboa/core/urls.py"}], "after_files": [{"content": "\"\"\"Core urls.\"\"\"\n\nfrom django.urls import path\nfrom django.views.generic.base import TemplateView\n\nfrom . import views\n\napp_name = \"core\"\n\nurlpatterns = [\n    path('', views.RootDispatchView.as_view(), name=\"root\"),\n    path('dashboard/', views.DashboardView.as_view(), name=\"dashboard\"),\n\n    path('accounts/login/', views.dologin, name=\"login\"),\n    path('accounts/logout/', views.dologout, name=\"logout\"),\n    path('accounts/2fa_verify/',\n         views.TwoFactorCodeVerifyView.as_view(),\n         name='2fa_verify'),\n\n    path('core/', views.viewsettings, name=\"index\"),\n    path('core/parameters/', views.parameters, name=\"parameters\"),\n    path('core/info/', views.information, name=\"information\"),\n    path('core/logs/', views.logs, name=\"log_list\"),\n    path('core/logs/page/', views.logs_page, name=\"logs_page\"),\n    path('core/top_notifications/check/',\n         views.check_top_notifications,\n         name=\"top_notifications_check\"),\n\n    path('user/', views.index, name=\"user_index\"),\n    path('user/preferences/', views.preferences,\n         name=\"user_preferences\"),\n    path('user/profile/', views.profile, name=\"user_profile\"),\n    path('user/api/', views.api_access, name=\"user_api_access\"),\n    path('user/security/', views.security, name=\"user_security\"),\n    path('robots.txt', TemplateView.as_view(template_name=\"core/robots.txt\", content_type=\"text/plain\")),\n]\n", "path": "modoboa/core/urls.py"}]}