Hi,
mbsync is unescaping the argument to PassCmd, while msmtps passwordeval
is leaving it as it is. So just remove your escapes and it should be
fine.
passwordeval gpg2 --no-tty -qd ~/.authinfo.gpg | \
sed -n 's,^machine gour .*password "\([^\"]*\)".*,\1,p'
/martin
P.S. At least this worked for me when testing with a ~/.authinfo.gpg
containing:
machine gour password "test"
On Sat, Apr 18, 2015 at 02:49:33PM +0200, Gour wrote:
> Hello!
>
> After switching to mu4e mailier I'm using msmtp to send all my mail and would
> like to take advantage of passwordeval's feature...
>
> Considering that when I use mbsync for syncing my local Maildir folders with
> the remote IMAP servers, I use the following config to extract my password
> from encrypted ~/.authinfo.gpg file.
>
> PassCmd "echo ${PASSWORD:-$(gpg --no-tty -qd ~/.authinfo.gpg | \
> sed -n 's,^machine gour .*password \"\\([^\"]*\\)\".*,\\1,p')}"
>
> I'd like to do the same with msmtprc, iow. use the samee ~/.authinfo.gpg file
> and extract required password for each account instead of storing only one
> password per account in encrypted gpg files.
>
> I have tried with:
>
> passwordeval gpg2 --no-tty -qd ~/.authinfo.gpg | \
> sed -n 's,^machine gour .*password \"\\([^\"]*\\)\".*,\\1,p'
>
> but Emacs reports:
>
> msmtp: cannot read output of 'gpg2 --no-tty -qd ~/.authinfo.gpg | sed -n
> 's,^machine gour .*password \"\\([^\"]*\\)\".*,\\1,p''
>
> Any clue what might be wrong?
>
> Of course, using single password per account works, but I wonder what's wrong
> considering thar running the above command in the terminal gives password as
> output?
>
>
> Sincerely,
> Gour
>
> --
> Therefore, without being attached to the fruits of activities,
> one should act as a matter of duty, for by working without
> attachment one attains the Supreme.
>
>
> ------------------------------------------------------------------------------
> BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
> Develop your own process in accordance with the BPMN 2 standard
> Learn Process modeling best practices with Bonita BPM through live exercises
> http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
> source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
> _______________________________________________
> msmtp-users mailing list
> msmtp-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/msmtp-users
Attachment:
signature.asc
Description: Digital signature