prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Typo in models/db.py for mail server
  Hi, 
  
  I found a small typo, which prohibits sending mails in models/db.py line 65:
  mail.settings.server = 'logging' if request.is_local else myconf.take('smtp.sender')
  
  should be (smtp.server instead of smtp.sender):
  mail.settings.server = 'logging' if request.is_local else myconf.take('smtp.server') 
  
  thanks
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `applications/welcome/models/db.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 
  3 #########################################################################
  4 ## This scaffolding model makes your app work on Google App Engine too
  5 ## File is released under public domain and you can use without limitations
  6 #########################################################################
  7 
  8 ## if SSL/HTTPS is properly configured and you want all HTTP requests to
  9 ## be redirected to HTTPS, uncomment the line below:
  10 # request.requires_https()
  11 
  12 ## app configuration made easy. Look inside private/appconfig.ini
  13 from gluon.contrib.appconfig import AppConfig
  14 ## once in production, remove reload=True to gain full speed
  15 myconf = AppConfig(reload=True)
  16 
  17 
  18 if not request.env.web2py_runtime_gae:
  19     ## if NOT running on Google App Engine use SQLite or other DB
  20     db = DAL(myconf.take('db.uri'), pool_size=myconf.take('db.pool_size', cast=int), check_reserved=['all'])
  21 else:
  22     ## connect to Google BigTable (optional 'google:datastore://namespace')
  23     db = DAL('google:datastore+ndb')
  24     ## store sessions and tickets there
  25     session.connect(request, response, db=db)
  26     ## or store session in Memcache, Redis, etc.
  27     ## from gluon.contrib.memdb import MEMDB
  28     ## from google.appengine.api.memcache import Client
  29     ## session.connect(request, response, db = MEMDB(Client()))
  30 
  31 ## by default give a view/generic.extension to all actions from localhost
  32 ## none otherwise. a pattern can be 'controller/function.extension'
  33 response.generic_patterns = ['*'] if request.is_local else []
  34 ## choose a style for forms
  35 response.formstyle = myconf.take('forms.formstyle')  # or 'bootstrap3_stacked' or 'bootstrap2' or other
  36 response.form_label_separator = myconf.take('forms.separator')
  37 
  38 
  39 ## (optional) optimize handling of static files
  40 # response.optimize_css = 'concat,minify,inline'
  41 # response.optimize_js = 'concat,minify,inline'
  42 ## (optional) static assets folder versioning
  43 # response.static_version = '0.0.0'
  44 #########################################################################
  45 ## Here is sample code if you need for
  46 ## - email capabilities
  47 ## - authentication (registration, login, logout, ... )
  48 ## - authorization (role based authorization)
  49 ## - services (xml, csv, json, xmlrpc, jsonrpc, amf, rss)
  50 ## - old style crud actions
  51 ## (more options discussed in gluon/tools.py)
  52 #########################################################################
  53 
  54 from gluon.tools import Auth, Service, PluginManager
  55 
  56 auth = Auth(db)
  57 service = Service()
  58 plugins = PluginManager()
  59 
  60 ## create all tables needed by auth if not custom tables
  61 auth.define_tables(username=False, signature=False)
  62 
  63 ## configure email
  64 mail = auth.settings.mailer
  65 mail.settings.server = 'logging' if request.is_local else myconf.take('smtp.sender')
  66 mail.settings.sender = myconf.take('smtp.sender')
  67 mail.settings.login = myconf.take('smtp.login')
  68 
  69 ## configure auth policy
  70 auth.settings.registration_requires_verification = False
  71 auth.settings.registration_requires_approval = False
  72 auth.settings.reset_password_requires_verification = True
  73 
  74 #########################################################################
  75 ## Define your tables below (or better in another model file) for example
  76 ##
  77 ## >>> db.define_table('mytable',Field('myfield','string'))
  78 ##
  79 ## Fields can be 'string','text','password','integer','double','boolean'
  80 ##       'date','time','datetime','blob','upload', 'reference TABLENAME'
  81 ## There is an implicit 'id integer autoincrement' field
  82 ## Consult manual for more options, validators, etc.
  83 ##
  84 ## More API examples for controllers:
  85 ##
  86 ## >>> db.mytable.insert(myfield='value')
  87 ## >>> rows=db(db.mytable.myfield=='value').select(db.mytable.ALL)
  88 ## >>> for row in rows: print row.id, row.myfield
  89 #########################################################################
  90 
  91 ## after defining tables, uncomment below to enable auditing
  92 # auth.enable_record_versioning(db)
  93
  ```
  --- 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/applications/welcome/models/db.py b/applications/welcome/models/db.py
  --- a/applications/welcome/models/db.py
  +++ b/applications/welcome/models/db.py
  @@ -62,7 +62,7 @@
   
   ## configure email
   mail = auth.settings.mailer
  -mail.settings.server = 'logging' if request.is_local else myconf.take('smtp.sender')
  +mail.settings.server = 'logging' if request.is_local else myconf.take('smtp.server')
   mail.settings.sender = myconf.take('smtp.sender')
   mail.settings.login = myconf.take('smtp.login')
  
verification_info: {"golden_diff": "diff --git a/applications/welcome/models/db.py b/applications/welcome/models/db.py\n--- a/applications/welcome/models/db.py\n+++ b/applications/welcome/models/db.py\n@@ -62,7 +62,7 @@\n \n ## configure email\n mail = auth.settings.mailer\n-mail.settings.server = 'logging' if request.is_local else myconf.take('smtp.sender')\n+mail.settings.server = 'logging' if request.is_local else myconf.take('smtp.server')\n mail.settings.sender = myconf.take('smtp.sender')\n mail.settings.login = myconf.take('smtp.login')\n", "issue": "Typo in models/db.py for mail server\nHi, \n\nI found a small typo, which prohibits sending mails in models/db.py line 65:\nmail.settings.server = 'logging' if request.is_local else myconf.take('smtp.sender')\n\nshould be (smtp.server instead of smtp.sender):\nmail.settings.server = 'logging' if request.is_local else myconf.take('smtp.server') \n\nthanks\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\n#########################################################################\n## This scaffolding model makes your app work on Google App Engine too\n## File is released under public domain and you can use without limitations\n#########################################################################\n\n## if SSL/HTTPS is properly configured and you want all HTTP requests to\n## be redirected to HTTPS, uncomment the line below:\n# request.requires_https()\n\n## app configuration made easy. Look inside private/appconfig.ini\nfrom gluon.contrib.appconfig import AppConfig\n## once in production, remove reload=True to gain full speed\nmyconf = AppConfig(reload=True)\n\n\nif not request.env.web2py_runtime_gae:\n    ## if NOT running on Google App Engine use SQLite or other DB\n    db = DAL(myconf.take('db.uri'), pool_size=myconf.take('db.pool_size', cast=int), check_reserved=['all'])\nelse:\n    ## connect to Google BigTable (optional 'google:datastore://namespace')\n    db = DAL('google:datastore+ndb')\n    ## store sessions and tickets there\n    session.connect(request, response, db=db)\n    ## or store session in Memcache, Redis, etc.\n    ## from gluon.contrib.memdb import MEMDB\n    ## from google.appengine.api.memcache import Client\n    ## session.connect(request, response, db = MEMDB(Client()))\n\n## by default give a view/generic.extension to all actions from localhost\n## none otherwise. a pattern can be 'controller/function.extension'\nresponse.generic_patterns = ['*'] if request.is_local else []\n## choose a style for forms\nresponse.formstyle = myconf.take('forms.formstyle')  # or 'bootstrap3_stacked' or 'bootstrap2' or other\nresponse.form_label_separator = myconf.take('forms.separator')\n\n\n## (optional) optimize handling of static files\n# response.optimize_css = 'concat,minify,inline'\n# response.optimize_js = 'concat,minify,inline'\n## (optional) static assets folder versioning\n# response.static_version = '0.0.0'\n#########################################################################\n## Here is sample code if you need for\n## - email capabilities\n## - authentication (registration, login, logout, ... )\n## - authorization (role based authorization)\n## - services (xml, csv, json, xmlrpc, jsonrpc, amf, rss)\n## - old style crud actions\n## (more options discussed in gluon/tools.py)\n#########################################################################\n\nfrom gluon.tools import Auth, Service, PluginManager\n\nauth = Auth(db)\nservice = Service()\nplugins = PluginManager()\n\n## create all tables needed by auth if not custom tables\nauth.define_tables(username=False, signature=False)\n\n## configure email\nmail = auth.settings.mailer\nmail.settings.server = 'logging' if request.is_local else myconf.take('smtp.sender')\nmail.settings.sender = myconf.take('smtp.sender')\nmail.settings.login = myconf.take('smtp.login')\n\n## configure auth policy\nauth.settings.registration_requires_verification = False\nauth.settings.registration_requires_approval = False\nauth.settings.reset_password_requires_verification = True\n\n#########################################################################\n## Define your tables below (or better in another model file) for example\n##\n## >>> db.define_table('mytable',Field('myfield','string'))\n##\n## Fields can be 'string','text','password','integer','double','boolean'\n##       'date','time','datetime','blob','upload', 'reference TABLENAME'\n## There is an implicit 'id integer autoincrement' field\n## Consult manual for more options, validators, etc.\n##\n## More API examples for controllers:\n##\n## >>> db.mytable.insert(myfield='value')\n## >>> rows=db(db.mytable.myfield=='value').select(db.mytable.ALL)\n## >>> for row in rows: print row.id, row.myfield\n#########################################################################\n\n## after defining tables, uncomment below to enable auditing\n# auth.enable_record_versioning(db)\n", "path": "applications/welcome/models/db.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\n#########################################################################\n## This scaffolding model makes your app work on Google App Engine too\n## File is released under public domain and you can use without limitations\n#########################################################################\n\n## if SSL/HTTPS is properly configured and you want all HTTP requests to\n## be redirected to HTTPS, uncomment the line below:\n# request.requires_https()\n\n## app configuration made easy. Look inside private/appconfig.ini\nfrom gluon.contrib.appconfig import AppConfig\n## once in production, remove reload=True to gain full speed\nmyconf = AppConfig(reload=True)\n\n\nif not request.env.web2py_runtime_gae:\n    ## if NOT running on Google App Engine use SQLite or other DB\n    db = DAL(myconf.take('db.uri'), pool_size=myconf.take('db.pool_size', cast=int), check_reserved=['all'])\nelse:\n    ## connect to Google BigTable (optional 'google:datastore://namespace')\n    db = DAL('google:datastore+ndb')\n    ## store sessions and tickets there\n    session.connect(request, response, db=db)\n    ## or store session in Memcache, Redis, etc.\n    ## from gluon.contrib.memdb import MEMDB\n    ## from google.appengine.api.memcache import Client\n    ## session.connect(request, response, db = MEMDB(Client()))\n\n## by default give a view/generic.extension to all actions from localhost\n## none otherwise. a pattern can be 'controller/function.extension'\nresponse.generic_patterns = ['*'] if request.is_local else []\n## choose a style for forms\nresponse.formstyle = myconf.take('forms.formstyle')  # or 'bootstrap3_stacked' or 'bootstrap2' or other\nresponse.form_label_separator = myconf.take('forms.separator')\n\n\n## (optional) optimize handling of static files\n# response.optimize_css = 'concat,minify,inline'\n# response.optimize_js = 'concat,minify,inline'\n## (optional) static assets folder versioning\n# response.static_version = '0.0.0'\n#########################################################################\n## Here is sample code if you need for\n## - email capabilities\n## - authentication (registration, login, logout, ... )\n## - authorization (role based authorization)\n## - services (xml, csv, json, xmlrpc, jsonrpc, amf, rss)\n## - old style crud actions\n## (more options discussed in gluon/tools.py)\n#########################################################################\n\nfrom gluon.tools import Auth, Service, PluginManager\n\nauth = Auth(db)\nservice = Service()\nplugins = PluginManager()\n\n## create all tables needed by auth if not custom tables\nauth.define_tables(username=False, signature=False)\n\n## configure email\nmail = auth.settings.mailer\nmail.settings.server = 'logging' if request.is_local else myconf.take('smtp.server')\nmail.settings.sender = myconf.take('smtp.sender')\nmail.settings.login = myconf.take('smtp.login')\n\n## configure auth policy\nauth.settings.registration_requires_verification = False\nauth.settings.registration_requires_approval = False\nauth.settings.reset_password_requires_verification = True\n\n#########################################################################\n## Define your tables below (or better in another model file) for example\n##\n## >>> db.define_table('mytable',Field('myfield','string'))\n##\n## Fields can be 'string','text','password','integer','double','boolean'\n##       'date','time','datetime','blob','upload', 'reference TABLENAME'\n## There is an implicit 'id integer autoincrement' field\n## Consult manual for more options, validators, etc.\n##\n## More API examples for controllers:\n##\n## >>> db.mytable.insert(myfield='value')\n## >>> rows=db(db.mytable.myfield=='value').select(db.mytable.ALL)\n## >>> for row in rows: print row.id, row.myfield\n#########################################################################\n\n## after defining tables, uncomment below to enable auditing\n# auth.enable_record_versioning(db)\n", "path": "applications/welcome/models/db.py"}]}