Hi all,
I'm trying to use an encrypted .netrc.gpg to hold my Gmail password for
.mbsynrc. Here's what my PassCmd is set as:
PassCmd "gpg --quiet --batch --no-tty --decrypt ~/.netrc.gpg | sed -n -e
's,^machine gmail\.com login joesmoe10 password \(.*\),\1,p'"
If I run `mbsync -l gmail`, it errors with:
"Skipping account gmail, password command produced no output."
If I replace PassCmd with `Pass $MY_PASSWORD`, the previous command works.
I've tested the PassCmd by itself with bash and it produces the correct
result.
And, I just found the solution from
https://sourceforge.net/p/isync/mailman/message/33624055/ Wrap it in a
subshell like so.
PassCmd "echo $(gpg --quiet --batch --no-tty --decrypt ~/.netrc.gpg | sed
-n -e 's,^machine gmail.com login joesmoe10 password \\(.*\\)$,\\1,p')"
Why does wrapping the command in a sub-shell work? I tested the following
command which had a pipe and it worked so I'm not sure why my original
command doesn't work.
PassCmd "echo $MY_PASSWORD | cat"
--
Joe Schafer
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel