Skip to content

Commit

Permalink
Specify the CA path for fetchmail
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiyou committed Jun 26, 2016
1 parent aace1c2 commit 5207093
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions fetchmail/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM python:alpine

RUN apk add --update \
fetchmail \
ca-certificates \
&& rm -rf /var/cache/apk/*

COPY fetchmail.py /fetchmail.py
Expand Down
9 changes: 8 additions & 1 deletion fetchmail/fetchmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
import tempfile


FETCHMAIL = """
fetchmail -N \
--sslcertck --sslcertpath /etc/ssl/certs \
-f {}
"""


RC_LINE = """
poll {host} proto {protocol} port {port}
user "{username}" password "{password}"
Expand All @@ -19,7 +26,7 @@ def fetchmail(fetchmailrc):
with tempfile.NamedTemporaryFile() as handler:
handler.write(fetchmailrc.encode("utf8"))
handler.flush()
os.system("fetchmail --sslcertck -N -f '{}'".format(handler.name))
os.system(FETCHMAIL.format(handler.name))


def run(cursor):
Expand Down

0 comments on commit 5207093

Please sign in to comment.