It seems that the gnupg home is still not set correctly.

Could you post from python shell (where code is working)
import os
print os.environ

And above modify the tools.py (after that you have to restart web2py I 
guess) and post the printed os.environ output. Without sensitive data :)


2012. április 27., péntek 5:15:12 UTC+2 időpontban weheh a következőt írta:
>
> I took the additional step of checking all the mail.settings... keys and 
> they are all set to values that look correct. I also retested the gpg 
> --list-secret-keys my_from_addr...@xyz.com and it produces a set of codes 
> consistent with recognizing my address. 
>
> The failure is happening in this block of code in tools.py:
>             if sign:
>                 import string
>                 core.check_version( None )
>                 pin = string.replace( payload_in.as_string(), '\n', '\r\n' 
> )
>                 plain = core.Data( pin )
>                 sig = core.Data()
>                 c = core.Context()
>                 c.set_armor( 1 )
>                 c.signers_clear()
>                 # search for signing key for From:
>                 for sigkey in c.op_keylist_all( self.settings.sender, 1 ):
>                     # !!! THIS BLOCK OF CODE IS NEVER GETTING EXECUTED
>                     if sigkey.can_sign:
>                         c.signers_add( sigkey )
>                 if not c.signers_enum( 0 ):
>
Put here:
import os
print os.environ


                    # THIS IS WHERE THE ERROR MESSAGE IS GETTING GENERATED
>                     self.error = 'No key for signing [%s]' % 
> self.settings.sender
>                     return False
>
> For some reason, c.op_keylist_all(...) is returning nothing so no signers 
> are added to the list. I tried running this code standalone from inside a 
> python shell and it seemed to work. Could it be an environmental variable 
> isn't getting propagated to tools.py?
>
>

Reply via email to