what is the output of the gpg --list-secret-keys [email protected] command if running with web2py user?
Is there any environment variable set about gpg in a shell and not in environment the web2py is running? 2012. április 26., csütörtök 1:02:40 UTC+2 időpontban weheh a következőt írta: > > no key for signing "[email protected]" > > On Thursday, April 26, 2012 2:29:53 AM UTC+8, szimszon wrote: >> >> What is the error message? >> >> 2012. április 25., szerda 19:28:10 UTC+2 időpontban weheh a következőt >> írta: >>> >>> Thanks szimszon. I see. The keyrings were not installed under web2py. >>> But now they are, and unfortunately, I'm still failing out in the same >>> place (although now I have a better idea where). The message is that there >>> is no key for signing "[email protected]", which is the >>> mail.settings.sender setting. I tried regenerating the keys (the originals >>> had been done by another person), but it's still not working (same error >>> message). I think the mail code is OK. But perhaps the keys are not. What's >>> your suggestion? >>> >>> >>> On Wednesday, April 25, 2012 10:13:36 PM UTC+8, szimszon wrote: >>>> >>>> In linux web2py user's keyring is in >>>> ~web2py/.gnupg/{pubring.gpg,secring.gpg} >>>> It's the default location. >>>> >>>> If you'll sign the mail than the private key should belong to '[email protected] >>>> '. >>>> >>>> Can you send mail if there is no gpg in action? Is smtp working? >>>> >>>> If I get some time at night I'll look at the code... >>>> >>>> 2012. április 25., szerda 15:39:32 UTC+2 időpontban weheh a következőt >>>> írta: >>>>> >>>>> # this is my controller >>>>> def test_mail(): >>>>> """Email tester""" >>>>> mail.settings.sender = '[email protected]' >>>>> mail.settings.server = 'z.com:587' # SMTP server >>>>> mail.settings.login = 'asdf:lkjh' >>>>> mail.settings.encrypt = False >>>>> mail.settings.ssl = False >>>>> mail.settings.tls = True >>>>> >>>>> mail.settings.cipher_type = 'gpg' >>>>> mail.settings.sign = True >>>>> mail.settings.sign_passphrase = 'foobar' >>>>> msg = ''this is a test' >>>>> >>>>> print mail.send( >>>>> to='[email protected]', >>>>> reply_to=mail.settings.sender, >>>>> subject='test', >>>>> message=msg, >>>>> raw=True, >>>>> ) >>>>> redirect(URL(...)) >>>>> >>>>> There is no ticket thrown by running this controller. The key appears >>>>> to be the right key. mail.error == None. >>>>> >>>>> What exactly is a "keyring" and how is it specified? How is it any >>>>> different than mail.settings.sign_passphrase as my private key? And isn't >>>>> my mail.settings.sender my public key? >>>>> >>>>> On Wednesday, April 25, 2012 2:50:05 PM UTC+8, szimszon wrote: >>>>>> >>>>>> Sorry for that. I have little time :( >>>>>> >>>>>> Is there anything in mail.error after the mail.send(...)? >>>>>> The user running web2py has a pgp keyring with the right keys? >>>>>> Is there any exception during mail.send? >>>>>> >>>>>> Can you post the code you are using? >>>>>> >>>>>> 2012. április 25., szerda 1:06:14 UTC+2 időpontban weheh a következőt >>>>>> írta: >>>>>>> >>>>>>> I'm running 1.99.7 and none of the arguments to mail.send are valid. >>>>>>> All the mail variables must be set via mail.settings as far as I can >>>>>>> tell. >>>>>>> That said, I have all my settings in place but things still not >>>>>>> working. >>>>>>> I'm going to start digging into mail logs next. >>>>>>> >>>>>>> On Tuesday, April 24, 2012 9:45:39 PM UTC+8, szimszon wrote: >>>>>>>> >>>>>>>> I have no little time sorry, I found the original testing code I >>>>>>>> used: >>>>>>>> >>>>>>>> #!/usr/bin/env python >>>>>>>> >>>>>>>> from gluon.tools import * >>>>>>>> >>>>>>>> mail=Mail() >>>>>>>> mail.settings.server='smtp server' >>>>>>>> mail.settings.sender='sender@address' >>>>>>>> mail.settings.login='user:pass' >>>>>>>> print >>>>>>>> mail.send('rec@address','test1','sign+encrypt',cipher_type='gpg',sign_passphrase="pass >>>>>>>> for gpg key") >>>>>>>> print >>>>>>>> mail.send('rec@address','test2','sign',cipher_type='gpg',encrypt=False,sign_passphrase="pass >>>>>>>> for gpg key") >>>>>>>> print >>>>>>>> mail.send('rec@address','test3','encrypt',cipher_type='gpg',sign=False,sign_passphrase="pass >>>>>>>> for gpg key") >>>>>>>> print mail.send('rec@address','test4','no sign+no encrypt') >>>>>>>> print mail.error >>>>>>>> >>>>>>>> >>>>>>>> You need to have a trusted gpg key for rec@address in your keyring >>>>>>>> (web2py user's keyring) and for sign you need to have a private key in >>>>>>>> the >>>>>>>> keyring of a web2py user (the user running the web2py website) >>>>>>>> >>>>>>>> 2012. április 24., kedd 15:03:07 UTC+2 időpontban weheh a >>>>>>>> következőt írta: >>>>>>>>> >>>>>>>>> I'm still not getting this to work. Would you mind posting a >>>>>>>>> complete example? Thanks. >>>>>>>> >>>>>>>>

