Skip to content

Commit

Permalink
Fix encoding of custom fields in fetchmailrc
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiyou committed Feb 7, 2020
1 parent cd3aca3 commit 7507345
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions optional/fetchmail/fetchmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import subprocess
import re
import requests
import sys


FETCHMAIL = """
Expand All @@ -31,7 +32,7 @@ def extract_host_port(host_and_port, default_port):


def escape_rc_string(arg):
return arg.replace("\\", "\\\\").replace('"', '\\"')
return "".join("\\x%2x" % ord(char) for char in arg)


def fetchmail(fetchmailrc):
Expand Down Expand Up @@ -91,4 +92,4 @@ def run(debug):
while True:
time.sleep(int(os.environ.get("FETCHMAIL_DELAY", 60)))
run(os.environ.get("DEBUG", None) == "True")

sys.stdout.flush()

0 comments on commit 7507345

Please sign in to comment.