From bd0461a986743e12abd97e317c32751ed1150acb Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Sat, 10 Jan 2015 01:51:10 +0100 Subject: [PATCH] MANUAL: add minor sample on how to retrieve a password with a helper python file Signed-off-by: Nicolas Sebrecht --- docs/MANUAL.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/MANUAL.rst b/docs/MANUAL.rst index e5fa9af..16af514 100644 --- a/docs/MANUAL.rst +++ b/docs/MANUAL.rst @@ -562,6 +562,16 @@ pythonfile with:: pythonfile=~/bin/offlineimap-helpers.py +Here is a basic content sample:: + + import commands + + def get_password(account_name): + cmd = "security find-internet-password -w -a '%s'"% account_name + (status, output) = commands.getstatusoutput(cmd) + return output + +From this sample, replace the cmd line with whatever can retrieve your password. Your pythonfile needs to contain implementations for the functions that you want to use in offflineimaprc. The example uses it for two purposes: Fetching passwords from the gnome-keyring and translating