pixelated / pixelated-user-agent

User facing components of Pixelated: a JavaScript single page app and a RESTful service.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Emails not signed or encrypted when username has dot

tuliocasagrande opened this issue · comments

merged 🎉

We need to do a leap deploy to fetch latest leap_webapp code.

@anikarni tried to send an email for me through wazokazi and we got this error on pixelated-user-agent log:

Mar  9 14:13:30 pixelated pixelated-user-agent[16014]: 2017-03-09 14:13:30 [leap.bitmask.mail.outgoing.service] ERROR [Failure instance: Traceback: <class 'leap.bitmask.keymanager.errors.EncryptError'>:
Mar  9 14:13:30 pixelated pixelated-user-agent[16014]: /usr/share/python/pixelated-user-agent/local/lib/python2.7/site-packages/twisted/internet/defer.py:434:errback
Mar  9 14:13:30 pixelated pixelated-user-agent[16014]: /usr/share/python/pixelated-user-agent/local/lib/python2.7/site-packages/twisted/internet/defer.py:501:_startRunCallbacks
Mar  9 14:13:30 pixelated pixelated-user-agent[16014]: /usr/share/python/pixelated-user-agent/local/lib/python2.7/site-packages/twisted/internet/defer.py:588:_runCallbacks
Mar  9 14:13:30 pixelated pixelated-user-agent[16014]: /usr/share/python/pixelated-user-agent/local/lib/python2.7/site-packages/twisted/internet/defer.py:1184:gotResult
Mar  9 14:13:30 pixelated pixelated-user-agent[16014]: --- <exception caught here> ---
Mar  9 14:13:30 pixelated pixelated-user-agent[16014]: /usr/share/python/pixelated-user-agent/local/lib/python2.7/site-packages/twisted/internet/defer.py:1126:_inlineCallbacks
Mar  9 14:13:30 pixelated pixelated-user-agent[16014]: /usr/share/python/pixelated-user-agent/local/lib/python2.7/site-packages/twisted/python/failure.py:389:throwExceptionIntoGenerator
Mar  9 14:13:30 pixelated pixelated-user-agent[16014]: /usr/share/python/pixelated-user-agent/src/leap.bitmask/src/leap/bitmask/keymanager/__init__.py:512:encrypt
Mar  9 14:13:30 pixelated pixelated-user-agent[16014]: /usr/share/python/pixelated-user-agent/local/lib/python2.7/site-packages/twisted/internet/defer.py:1128:_inlineCallbacks
Mar  9 14:13:30 pixelated pixelated-user-agent[16014]: /usr/share/python/pixelated-user-agent/src/leap.bitmask/src/leap/bitmask/keymanager/openpgp.py:677:encrypt
Mar  9 14:13:30 pixelated pixelated-user-agent[16014]: ]
Mar  9 14:13:30 pixelated pixelated-user-agent[16014]: Error while formatting log event: KeyError(u"u'thais",)
Mar  9 14:13:30 pixelated pixelated-user-agent[16014]: Original event: {'log_namespace': 'pixelated.resources.mails_resource', 'log_level': 'ERROR', 'log_logger': <Logger 'pixelated.resources.mails_resource'>, 'log_time': '2017-03-09 14:13:30', 'log_source': None, 'log_format': "error occurred while sending: ('Failed to send mail to all recipients', {u'thais.siqueira@wazokazi.is': <twisted.python.failure.Failure leap.bitmask.keymanager.errors.EncryptError: >})\n"}

I'm having a different problem.

user-agent.log (looks ok):

Mar 15 18:58:54 pixelated pixelated-user-agent[20164]: 2017-03-15 18:58:54 [leap.bitmask.mail.outgoing.service] INFO Will encrypt the message with thais.siqueira@wazokazi.is and sign with tuliocasagrande@wazokazi.is.
Mar 15 18:58:54 pixelated pixelated-user-agent[20164]: 2017-03-15 18:58:54 [leap.bitmask.keymanager] DEBUG getting key for thais.siqueira@wazokazi.is
Mar 15 18:58:54 pixelated pixelated-user-agent[20164]: 2017-03-15 18:58:54 [leap.bitmask.keymanager] DEBUG getting key for tuliocasagrande@wazokazi.is
Mar 15 18:58:54 pixelated pixelated-user-agent[20164]: 2017-03-15 18:58:54 [leap.bitmask.keymanager] DEBUG getting key for thais.siqueira@wazokazi.is
Mar 15 18:58:54 pixelated pixelated-user-agent[20164]: 2017-03-15 18:58:54 [leap.bitmask.keymanager] DEBUG getting key for tuliocasagrande@wazokazi.is
Mar 15 18:58:55 pixelated pixelated-user-agent[20164]: 2017-03-15 18:58:55 [leap.bitmask.keymanager.openpgp] DEBUG [GNUPG:] GOOD_PASSPHRASE
Mar 15 18:58:55 pixelated pixelated-user-agent[20164]: [GNUPG:] BEGIN_SIGNING
Mar 15 18:58:55 pixelated pixelated-user-agent[20164]: [GNUPG:] SIG_CREATED S 1 10 00 1489604335 A464B367C8C043F91607E983CAB70097BE0C1A28
Mar 15 18:58:55 pixelated pixelated-user-agent[20164]: [GNUPG:] BEGIN_ENCRYPTION 2 9
Mar 15 18:58:55 pixelated pixelated-user-agent[20164]: [GNUPG:] END_ENCRYPTION
Mar 15 18:58:57 pixelated pixelated-user-agent[20164]: 2017-03-15 18:58:57 [leap.bitmask.mail.outgoing.service] INFO Connecting to SMTP server pixelated.wazokazi.is:465
Mar 15 18:58:57 pixelated pixelated-user-agent[20164]: 2017-03-15 18:58:57 [twisted.mail.smtp.ESMTPSenderFactory] INFO Starting factory <twisted.mail.smtp.ESMTPSenderFactory instance at 0x7fc33c0f5dd0>
Mar 15 18:58:57 pixelated pixelated-user-agent[20164]: 2017-03-15 18:58:57 [leap.bitmask.mail.adaptors.soledad] WARN Empty raw field in cdoc C-E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855
Mar 15 18:58:57 pixelated pixelated-user-agent[20164]: 2017-03-15 18:58:57 [leap.bitmask.mail.adaptors.soledad] DEBUG got conflict while putting C-E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855
Mar 15 18:58:57 pixelated pixelated-user-agent[20164]: 2017-03-15 18:58:57 [leap.bitmask.mail.adaptors.soledad] DEBUG All parts inserted for msg!
Mar 15 18:58:57 pixelated pixelated-user-agent[20164]: 2017-03-15 18:58:57 [leap.bitmask.mail.outgoing.service] INFO Message sent from tuliocasagrande@wazokazi.is to thais.siqueira@wazokazi.is

leap_mx.log:

Mar 15 18:58:57 pixelated leap-mx: [LEAPPostfixTCPMapFingerprintServer,19,0.0.0.0] look up: CE:90:53:91:E8:A1:2A:6D:46:78:1A:78:37:9A:EC:33:E4:9D:CB:2A
Mar 15 18:58:57 pixelated leap-mx: [-] Starting factory <twisted.web.client._HTTP11ClientFactory instance at 0x7fd8285e9b48>
Mar 15 18:58:57 pixelated leap-mx: [-] Stopping factory <twisted.web.client._HTTP11ClientFactory instance at 0x7fd8285e9b48>
Mar 15 18:58:57 pixelated leap-mx: [LEAPPostfixTCPMapAliasServer,1476,0.0.0.0] virtual alias map: thais.siqueira@wazokazi.is
Mar 15 18:58:57 pixelated leap-mx: [-] Starting factory <twisted.web.client._HTTP11ClientFactory instance at 0x7fd828e63e60>
Mar 15 18:58:57 pixelated leap-mx: [-] Stopping factory <twisted.web.client._HTTP11ClientFactory instance at 0x7fd828e63e60>
Mar 15 18:58:57 pixelated leap-mx: [LEAPPostfixTCPMapAliasServer,1477,0.0.0.0] virtual alias map: thais.siqueira@wazokazi.is
Mar 15 18:58:57 pixelated leap-mx: [-] Starting factory <twisted.web.client._HTTP11ClientFactory instance at 0x7fd828e98908>
Mar 15 18:58:57 pixelated leap-mx: [-] Stopping factory <twisted.web.client._HTTP11ClientFactory instance at 0x7fd828e98908>
Mar 15 18:58:57 pixelated leap-mx: [LEAPPostfixTCPMapAliasServer,1477,0.0.0.0] virtual alias map: 620fd84871f193fb4c8abfa33ba6f853@deliver.local
Mar 15 18:58:57 pixelated leap-mx: [-] Starting factory <twisted.web.client._HTTP11ClientFactory instance at 0x7fd828e63bd8>
Mar 15 18:58:57 pixelated leap-mx: [-] Stopping factory <twisted.web.client._HTTP11ClientFactory instance at 0x7fd828e63bd8>
Mar 15 18:58:57 pixelated leap-mx: [LEAPPostfixTCPMapAliasServer,1478,0.0.0.0] virtual alias map: deliver.local
Mar 15 18:58:57 pixelated leap-mx: [-] Starting factory <twisted.web.client._HTTP11ClientFactory instance at 0x7fd82aec14d0>
Mar 15 18:58:57 pixelated leap-mx: [-] Stopping factory <twisted.web.client._HTTP11ClientFactory instance at 0x7fd82aec14d0>
Mar 15 18:58:57 pixelated leap-mx: [-] Processing new mail at '/var/mail/leap-mx/Maildir/new/1489604337.Vfe00I20a0840M676018.pixelated'
Mar 15 18:58:57 pixelated leap-mx: [-] Mail owner: 620fd84871f193fb4c8abfa33ba6f853
Mar 15 18:58:57 pixelated leap-mx: [-] Starting factory <twisted.web.client._HTTP11ClientFactory instance at 0x7fd82aed6758>
Mar 15 18:58:57 pixelated leap-mx: [HTTP11ClientProtocol,client] Encrypting message to 620fd84871f193fb4c8abfa33ba6f853's pubkey
Mar 15 18:58:58 pixelated leap-mx: [HTTP11ClientProtocol,client] _encrypt_message: Encryption failed with status: 'invalid recipient'
Mar 15 18:58:58 pixelated leap-mx: [HTTP11ClientProtocol,client] _export_message: Something went wrong, here's all I know: '620fd84871f193fb4c8abfa33ba6f853' | None
Mar 15 18:58:58 pixelated leap-mx: [HTTP11ClientProtocol,client] New stalled email FilePath('/var/mail/leap-mx/Maildir/new/1489604337.Vfe00I20a0840M676018.pixelated'): Exception('No uuid or doc',)
Mar 15 18:58:58 pixelated leap-mx: [-] Stopping factory <twisted.web.client._HTTP11ClientFactory instance at 0x7fd82aed6758>

We found out the problem with username with dots was actually solved by https://0xacab.org/leap/leap_web/merge_requests/14.

The remaining problems with encryption and decryption are happening when we try to use a remote key that failed to be sent to remote after renewal.

Related with:
#992 (sending)
https://github.com/pixelated/project-issues/issues/428 (receiving)