Now I tested the tools.py and I can set the GUNPGHOME with 
mail.settings.gpg_home = '/dir/to/where/is/.gnupg' and works. I set it 
wrong place than I can't sign the mail.

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 [email protected] 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 ):
>                     # 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