prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Fetchmail sslproto configuration (typo?)
  The fetchmail container repeatedly fires the following warning
  
  `fetchmail: Invalid SSL protocol 'AUTO' specified, using default (SSLv23).`
  
  From the fetchmail manpage, this appears to relate to the `--sslproto` switch. 
  
  IMHO the default should be an all lowercase `auto`. Otherwise, an improvement suggestion would be to make this configurable through the admin interface.
  
  </issue>
  <code>
  [start of services/fetchmail/fetchmail.py]
  1 #!/usr/bin/python3
  2 
  3 import time
  4 import os
  5 import tempfile
  6 import shlex
  7 import subprocess
  8 import re
  9 import requests
  10 
  11 
  12 FETCHMAIL = """
  13 fetchmail -N \
  14     --sslcertck --sslcertpath /etc/ssl/certs \
  15     -f {}
  16 """
  17 
  18 
  19 RC_LINE = """
  20 poll "{host}" proto {protocol}  port {port}
  21     user "{username}" password "{password}"
  22     is "{user_email}"
  23     smtphost "{smtphost}"
  24     {options}
  25     sslproto 'AUTO'
  26 """
  27 
  28 
  29 def extract_host_port(host_and_port, default_port):
  30     host, _, port = re.match('^(.*)(:([0-9]*))?$', host_and_port).groups()
  31     return host, int(port) if port else default_port
  32 
  33 
  34 def escape_rc_string(arg):
  35     return arg.replace("\\", "\\\\").replace('"', '\\"')
  36 
  37 
  38 def fetchmail(fetchmailrc):
  39     with tempfile.NamedTemporaryFile() as handler:
  40         handler.write(fetchmailrc.encode("utf8"))
  41         handler.flush()
  42         command = FETCHMAIL.format(shlex.quote(handler.name))
  43         output = subprocess.check_output(command, shell=True)
  44         return output
  45 
  46 
  47 def run(debug):
  48     fetches = requests.get("http://admin/internal/fetch").json()
  49     smtphost, smtpport = extract_host_port(os.environ.get("HOST_SMTP", "smtp"), None)
  50     if smtpport is None:
  51         smtphostport = smtphost
  52     else:
  53         smtphostport = "%s/%d" % (smtphost, smtpport)
  54     for fetch in fetches:
  55         fetchmailrc = ""
  56         options = "options antispam 501, 504, 550, 553, 554"
  57         options += " ssl" if fetch["tls"] else ""
  58         options += " keep" if fetch["keep"] else " fetchall"
  59         fetchmailrc += RC_LINE.format(
  60             user_email=escape_rc_string(fetch["user_email"]),
  61             protocol=fetch["protocol"],
  62             host=escape_rc_string(fetch["host"]),
  63             port=fetch["port"],
  64             smtphost=smtphostport,
  65             username=escape_rc_string(fetch["username"]),
  66             password=escape_rc_string(fetch["password"]),
  67             options=options
  68         )
  69         if debug:
  70             print(fetchmailrc)
  71         try:
  72             print(fetchmail(fetchmailrc))
  73             error_message = ""
  74         except subprocess.CalledProcessError as error:
  75             error_message = error.output.decode("utf8")
  76             # No mail is not an error
  77             if not error_message.startswith("fetchmail: No mail"):
  78                 print(error_message)
  79             user_info = "for %s at %s" % (fetch["user_email"], fetch["host"])
  80             # Number of messages seen is not a error as well
  81             if ("messages" in error_message and
  82                     "(seen " in error_message and
  83                     user_info in error_message):
  84                 print(error_message)
  85         finally:
  86             requests.post("http://admin/internal/fetch/{}".format(fetch["id"]),
  87                 json=error_message.split("\n")[0]
  88             )
  89 
  90 
  91 if __name__ == "__main__":
  92     while True:
  93         time.sleep(int(os.environ.get("FETCHMAIL_DELAY", 60)))
  94         run(os.environ.get("DEBUG", None) == "True")
  95 
  96
  [end of services/fetchmail/fetchmail.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/services/fetchmail/fetchmail.py b/services/fetchmail/fetchmail.py
  --- a/services/fetchmail/fetchmail.py
  +++ b/services/fetchmail/fetchmail.py
  @@ -22,7 +22,6 @@
       is "{user_email}"
       smtphost "{smtphost}"
       {options}
  -    sslproto 'AUTO'
   """
   
   
  @@ -54,7 +53,7 @@
       for fetch in fetches:
           fetchmailrc = ""
           options = "options antispam 501, 504, 550, 553, 554"
  -        options += " ssl" if fetch["tls"] else ""
  +        options += " sslmode wrapped" if fetch["tls"] else ""
           options += " keep" if fetch["keep"] else " fetchall"
           fetchmailrc += RC_LINE.format(
               user_email=escape_rc_string(fetch["user_email"]),
  
verification_info: {"golden_diff": "diff --git a/services/fetchmail/fetchmail.py b/services/fetchmail/fetchmail.py\n--- a/services/fetchmail/fetchmail.py\n+++ b/services/fetchmail/fetchmail.py\n@@ -22,7 +22,6 @@\n     is \"{user_email}\"\n     smtphost \"{smtphost}\"\n     {options}\n-    sslproto 'AUTO'\n \"\"\"\n \n \n@@ -54,7 +53,7 @@\n     for fetch in fetches:\n         fetchmailrc = \"\"\n         options = \"options antispam 501, 504, 550, 553, 554\"\n-        options += \" ssl\" if fetch[\"tls\"] else \"\"\n+        options += \" sslmode wrapped\" if fetch[\"tls\"] else \"\"\n         options += \" keep\" if fetch[\"keep\"] else \" fetchall\"\n         fetchmailrc += RC_LINE.format(\n             user_email=escape_rc_string(fetch[\"user_email\"]),\n", "issue": "Fetchmail sslproto configuration (typo?)\nThe fetchmail container repeatedly fires the following warning\r\n\r\n`fetchmail: Invalid SSL protocol 'AUTO' specified, using default (SSLv23).`\r\n\r\nFrom the fetchmail manpage, this appears to relate to the `--sslproto` switch. \r\n\r\nIMHO the default should be an all lowercase `auto`. Otherwise, an improvement suggestion would be to make this configurable through the admin interface.\n", "before_files": [{"content": "#!/usr/bin/python3\n\nimport time\nimport os\nimport tempfile\nimport shlex\nimport subprocess\nimport re\nimport requests\n\n\nFETCHMAIL = \"\"\"\nfetchmail -N \\\n    --sslcertck --sslcertpath /etc/ssl/certs \\\n    -f {}\n\"\"\"\n\n\nRC_LINE = \"\"\"\npoll \"{host}\" proto {protocol}  port {port}\n    user \"{username}\" password \"{password}\"\n    is \"{user_email}\"\n    smtphost \"{smtphost}\"\n    {options}\n    sslproto 'AUTO'\n\"\"\"\n\n\ndef extract_host_port(host_and_port, default_port):\n    host, _, port = re.match('^(.*)(:([0-9]*))?$', host_and_port).groups()\n    return host, int(port) if port else default_port\n\n\ndef escape_rc_string(arg):\n    return arg.replace(\"\\\\\", \"\\\\\\\\\").replace('\"', '\\\\\"')\n\n\ndef fetchmail(fetchmailrc):\n    with tempfile.NamedTemporaryFile() as handler:\n        handler.write(fetchmailrc.encode(\"utf8\"))\n        handler.flush()\n        command = FETCHMAIL.format(shlex.quote(handler.name))\n        output = subprocess.check_output(command, shell=True)\n        return output\n\n\ndef run(debug):\n    fetches = requests.get(\"http://admin/internal/fetch\").json()\n    smtphost, smtpport = extract_host_port(os.environ.get(\"HOST_SMTP\", \"smtp\"), None)\n    if smtpport is None:\n        smtphostport = smtphost\n    else:\n        smtphostport = \"%s/%d\" % (smtphost, smtpport)\n    for fetch in fetches:\n        fetchmailrc = \"\"\n        options = \"options antispam 501, 504, 550, 553, 554\"\n        options += \" ssl\" if fetch[\"tls\"] else \"\"\n        options += \" keep\" if fetch[\"keep\"] else \" fetchall\"\n        fetchmailrc += RC_LINE.format(\n            user_email=escape_rc_string(fetch[\"user_email\"]),\n            protocol=fetch[\"protocol\"],\n            host=escape_rc_string(fetch[\"host\"]),\n            port=fetch[\"port\"],\n            smtphost=smtphostport,\n            username=escape_rc_string(fetch[\"username\"]),\n            password=escape_rc_string(fetch[\"password\"]),\n            options=options\n        )\n        if debug:\n            print(fetchmailrc)\n        try:\n            print(fetchmail(fetchmailrc))\n            error_message = \"\"\n        except subprocess.CalledProcessError as error:\n            error_message = error.output.decode(\"utf8\")\n            # No mail is not an error\n            if not error_message.startswith(\"fetchmail: No mail\"):\n                print(error_message)\n            user_info = \"for %s at %s\" % (fetch[\"user_email\"], fetch[\"host\"])\n            # Number of messages seen is not a error as well\n            if (\"messages\" in error_message and\n                    \"(seen \" in error_message and\n                    user_info in error_message):\n                print(error_message)\n        finally:\n            requests.post(\"http://admin/internal/fetch/{}\".format(fetch[\"id\"]),\n                json=error_message.split(\"\\n\")[0]\n            )\n\n\nif __name__ == \"__main__\":\n    while True:\n        time.sleep(int(os.environ.get(\"FETCHMAIL_DELAY\", 60)))\n        run(os.environ.get(\"DEBUG\", None) == \"True\")\n\n", "path": "services/fetchmail/fetchmail.py"}]}