[darcs-users] ~/.darcs/defaults: send sendmail-command configuration problems

Gwern Branwen gwern0 at gmail.com
Sat Jul 26 23:11:23 UTC 2008


On 2008.07.23 10:07:10 +0200, Tommy Pettersson <ptp at lysator.liu.se> scribbled 1.6K characters:
> On Tue, Jul 08, 2008 at 06:39:57PM -0400, Gwern Branwen wrote:
> > Hi everyone. So I recently decided to move all my Darcs
> > configuration out of my elaborate and unwieldy shell scripts,
> > and into my ~/.darcs/defaults. For the most part, it has gone
> > alright.
> >
> > However, I've run into trouble with more complex things. For
> > example, with my send function. It looked like this:
> >
> > function send { local -r http_proxy=""; darcs send -v --summary --from=`gpg-address` --sendmail-command="torify ssmtp -au `gpg-address` -ap `gpg-password` %t %<" "$@" }
> [...]
> > Trying:
> >  send sendmail-command torify ssmtp -au `gpg-address` -ap `gpg-password` %t %<
> >
> > results in:
> >  ssmtp: Authorization failed (535 5.7.1 http://mail.google.com/support/bin/answer.py?answer=14257 34sm8069819yxl.9)
> >
> >  darcs failed:  failed to send mail to: cvs-ghc at haskell.org
> >  Perhaps sendmail is not configured.
>
> The value to --sendmail-command is not executed by the shell. It
> is parsed by darcs and executed as a raw command, so the
> backquotes will not have any effect. Otherwise your last try
> (quoted above) is the correct way to enter the value for
> --sendmail-command; only single arguments that contain spaces
> need to be quoted in singlequotes, like:
>
>   send sendmail-command touch -d 2008-08-01 'spacy file stamp'
>
> You could try something like:
>
>   send sendmail-command sh -e 'torify ssmtp -au `gpg-address` ... '
>
> but I have not checked if that really works.
>
> --
> Tommy Pettersson <ptp at lysator.liu.se>

No, I've banged my head some more, and that doesn't work. I think the issue is that if you call sh -e (sh -c, it seems to be actually), it runs and is evaluated, but then it doesn't have access to  %t or %<. I haven't seen anyway to substitute in the output of gpg-password & gpg-address & %t & %v into the final shell command.

--
gwern
EDI Halliburton BRGE UHF JITEM composition high explosion EODG quarter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.osuosl.org/pipermail/darcs-users/attachments/20080726/a8d1041b/attachment.pgp 


More information about the darcs-users mailing list