gpgol.git
3 months agoAdd SentOnBehalfOfName to ignored prop changes
Andre Heinecke [Wed, 10 Apr 2019 07:39:59 +0000 (09:39 +0200)]
Add SentOnBehalfOfName to ignored prop changes

* src/mailitem-events.cpp (prop_blacklist): Add SentOnBehalfOfName.

--
This can change for drafts when they are decrypted.

3 months agoAdd initial draft encryption support
Andre Heinecke [Wed, 10 Apr 2019 07:30:24 +0000 (09:30 +0200)]
Add initial draft encryption support

* src/common_indep.h (opt): Add option draft_key.
* src/cryptcontroller.cpp (CryptController::resolve_keys): Handle
draft and resolve to draft key.
(CryptController::do_crypto): Don't sign draft encrypts.
* src/mail.cpp (Mail::Mail): New state variable for drafts.
(do_crypt): Handle draft encryption.
(Mail::encryptSignStart_o): Disable inline pgp for drafts.
(Mail::updateCryptOOM_o): Don't wipe but trick Outlook when
encrypting drafts.
(Mail::prepareCrypto_o): New. Factored out from send event.
* src/mail.h: Update accordingly.
* src/mailitem-events.cpp (BeforeAutoSave): New. Start
encryption.
(Write, AfterWrite): Add handling for drafts.
* src/main.c (read_options): Read draftKey and draftEnc.
* src/windowmessages.cpp (CRYPTO_DONE): Handle drafts.

--
This uses some tricks to add draft encryption in a
way that the user does not notice. E.g. when an
autosave happens.

It's still a bit fragile and needs more work but the
basics work for explict draft save and autosave.

GnuPG-Bug-Id: T4388

3 months agoSilence a too verbose trace
Andre Heinecke [Wed, 10 Apr 2019 06:40:50 +0000 (08:40 +0200)]
Silence a too verbose trace

* src/cryptcontroller.cpp (sink_data_write): Do not trace each call.

3 months agoPrint maip error on OpenProperty error
Andre Heinecke [Tue, 9 Apr 2019 12:42:20 +0000 (14:42 +0200)]
Print maip error on OpenProperty error

* src/oomhelp.cpp (gpgol_openProperty): Print out mapi error.

--
This saves time looking up the error codes manually.

3 months agoAdd MAPI error codes and helpers
Andre Heinecke [Mon, 8 Apr 2019 09:43:12 +0000 (11:43 +0200)]
Add MAPI error codes and helpers

* src/mapierr.cpp, src/mapierr.h: New.
* src/mymapi.h: Include it.
* src/Makefile.am: Add it to sources.

3 months agoFix crash when looking at messages without attachs
Andre Heinecke [Wed, 27 Mar 2019 11:53:10 +0000 (12:53 +0100)]
Fix crash when looking at messages without attachs

* src/mapihelp.cpp (mapi_get_first_attach_data): Do not crash
if message has no attachments.

3 months agoFix content-type detection for headerless mails
Andre Heinecke [Wed, 27 Mar 2019 09:53:42 +0000 (10:53 +0100)]
Fix content-type detection for headerless mails

* src/mapihelp.cpp (mapi_get_message_content_type):
Check first attachment if mail has no headers.

--
Yep that happens. I could reproduce it by looking at
sent mails in a local data file. This is very likely
the cause for:

GnuPG-Bug-Id: T3935

3 months agoReplace fancy attribute by comment
Andre Heinecke [Tue, 26 Mar 2019 18:46:57 +0000 (19:46 +0100)]
Replace fancy attribute by comment

* src/mailitem-events.cpp: Change attribute fallthrough to magic
comment.

--
This fixed build with older gcc versions....

3 months agoPost release version bump
Andre Heinecke [Tue, 26 Mar 2019 13:00:53 +0000 (14:00 +0100)]
Post release version bump

--

3 months agoFix distcheck gpgol-2.3.3
Andre Heinecke [Tue, 26 Mar 2019 12:56:58 +0000 (13:56 +0100)]
Fix distcheck

* tests/Makefile.am: Check for TESTS should have been inverted.

3 months agoAuto update po files
Andre Heinecke [Tue, 26 Mar 2019 12:13:57 +0000 (13:13 +0100)]
Auto update po files

--

3 months agoUpdate NEWS for todays release
Andre Heinecke [Tue, 26 Mar 2019 12:12:31 +0000 (13:12 +0100)]
Update NEWS for todays release

--

3 months agoFix / improve decrypting sent exchange mails again
Andre Heinecke [Tue, 26 Mar 2019 08:48:23 +0000 (09:48 +0100)]
Fix / improve decrypting sent exchange mails again

* src/mail.cpp (Mail::preProcessMessage_m): Also pass the
parsed_message.
* src/mapihelp.cpp (hide_attachment_mapipos): New helper.
(mapi_mark_or_create_moss_attach): Take parsed msg as
additional parameter. Improve MOSSTMPL handling.

--
If we have a mosstempl. This means that we created
this message. Sometimes we get the situation in
sent mails that we have a mosstempl but the
pgp version header and octet streams also
attached in the parsed_message. We can't
trigger a reread from the base message so
in that case we want to hide everything
as we rebuild the message from our MOSS.

We don't delete here to avoid bugs where data loss
might occur.

GnuPG-Bug-Id: T4241

3 months agoEnsure that decrypt again uses preprocessing
Andre Heinecke [Tue, 26 Mar 2019 08:18:23 +0000 (09:18 +0100)]
Ensure that decrypt again uses preprocessing

* src/windowmessages.cpp (EXT_API_DECRYPT): call
pre process message.

--
This ensures that our usual preprocessing is done
when decrypting again.

GnuPG-Bug-Id: T4241

3 months agoUpdate pt translations
Andre Heinecke [Tue, 26 Mar 2019 06:58:27 +0000 (07:58 +0100)]
Update pt translations

* po/pt.po: Update.

--
As usual, thanks to Marco.

3 months agoFix a message box encoding error
Andre Heinecke [Mon, 25 Mar 2019 13:34:56 +0000 (14:34 +0100)]
Fix a message box encoding error

* src/cryptcontroller.cpp (CryptController::parse_output): Use
UTF-8 gettext.

3 months agoMinor string improvement
Andre Heinecke [Mon, 25 Mar 2019 08:52:13 +0000 (09:52 +0100)]
Minor string improvement

--

3 months agoAuto update po files
Andre Heinecke [Mon, 25 Mar 2019 08:22:52 +0000 (09:22 +0100)]
Auto update po files

* po/*: Update

3 months agoPrint warning when unsupported attachs are found
Andre Heinecke [Mon, 25 Mar 2019 08:20:06 +0000 (09:20 +0100)]
Print warning when unsupported attachs are found

* po/POTFILES.in: Add mimemaker.
* src/mimemaker.cpp (count_usable_attachments): Also count
OLE and embedded.
(write_attachments): Print warning in case such an attach
was found.
(add_body_and_attachments): Forward error.

--
This should only show when we previously would have
ignored an attachment. Siliently ignoring attachments
like appointments can lead to ugly communication.

GnuPG-Bug-Id: T4184

3 months agoTake attachment display name if filename null
Andre Heinecke [Mon, 25 Mar 2019 08:05:34 +0000 (09:05 +0100)]
Take attachment display name if filename null

* src/mapihelp.cpp (get_attach_filename): Check DISPLAY_NAME
as a fallback.

4 months agoAdd filenames for our mime parts
Andre Heinecke [Tue, 19 Mar 2019 08:51:13 +0000 (09:51 +0100)]
Add filenames for our mime parts

* src/cryptcontroller.cpp (create_sign_attach): Add file name
for signatures.
* src/mimemaker.cpp (create_top_encryption_header): Add file name
for OpenPGP encrypted.
* src/mimemaker.h: Add defines for filenames.

--
This makes it look nicer if a client does not support PGP/MIME
and you can even open the message with Kleopatra.

GnuPG-Bug-Id: T4258

4 months agoLog if DBG_TRACE is set
Andre Heinecke [Mon, 18 Mar 2019 16:17:38 +0000 (17:17 +0100)]
Log if DBG_TRACE is set

* src/main.c (read_options): Log if DBG_TRACE is set.

--
Should be pretty obvious from the log afterwards but this
is cleaner and less irritating.

4 months agoMAPI look into tnef attachments to detect protocol
Andre Heinecke [Mon, 18 Mar 2019 13:37:00 +0000 (14:37 +0100)]
MAPI look into tnef attachments to detect protocol

* src/mapihelp.cpp (mapi_get_first_attach_data): New.
(change_message_class_ipm_note_smime): Remove ms-tnef handling.
Add multipart/signed protocol support for smime.
Warn if encrypted fallback is used.
(change_message_class_ipm_note_smime_multipartsigned): Remove
ms-tnef handling.
(parse_header_data): New helper factored out form
(mapi_get_message_content_type): Handle ms-tnef wrapping.

--
If we have a mail with content-type ms-tnef we now
look into the tnef attachment to parse the protocol
for multipart/signed.

While Outlook makes the original content type available
through API (get_first_attach_mime_tag) it does not
provide the protocol.

As we need this information early on for display purposes
we now look into the attachment.

GnuPG-Bug-Id: T4403
GnuPG-Bug-Id: T4267

4 months agoAdd the generic MSGTYPE_SMIME in isSMIME_m
Andre Heinecke [Mon, 18 Mar 2019 13:33:57 +0000 (14:33 +0100)]
Add the generic MSGTYPE_SMIME in isSMIME_m

* src/mail.cpp (Mail::isSMIME_m): Add MSGTYPE_SMIME.

--
Might be a cause for
GnuPG-Bug-Id: T4403

but the real issue there are tnef attachments.

4 months agoFix a false positive memdbg warning
Andre Heinecke [Mon, 18 Mar 2019 13:32:46 +0000 (14:32 +0100)]
Fix a false positive memdbg warning

* src/mapihelp.cpp (get_first_attach_mime_tag): Note the
ref on mapitable.

4 months agoDo not allow decrypt permanently in case of errors
Andre Heinecke [Mon, 18 Mar 2019 11:51:39 +0000 (12:51 +0100)]
Do not allow decrypt permanently in case of errors

* src/mail.cpp (Mail::decryptPermanently_o): Do not
allow this in case an error occured.

--
Otherwise we save the error string!

4 months agoGet / Show Diagnostic audit log after crypt failed
Andre Heinecke [Mon, 18 Mar 2019 11:49:07 +0000 (12:49 +0100)]
Get / Show Diagnostic audit log after crypt failed

* src/cryptcontroller.cpp (CryptController::do_crypto):
Return audit log if available.
* src/cryptcontroller.h: Update accordingly.
* src/mail.cpp (do_crypt): Check for audit log and show
if available.

--
This might help to avoid "General Error" cases.

4 months agoUse localized seperator for categories
Andre Heinecke [Mon, 18 Mar 2019 11:13:20 +0000 (12:13 +0100)]
Use localized seperator for categories

* src/categorymanager.cpp (CategoryManager::getSeperator): New.
* src/oomhelp.cpp (remove_category, add_category): Use it.

--
Outlook actually localizes the seperator. So if you run
two Outlooks on the same account with different locale
settings you are out of luck,.. weird.

4 months agoExpose readRegStr in common.h
Andre Heinecke [Mon, 18 Mar 2019 11:11:09 +0000 (12:11 +0100)]
Expose readRegStr in common.h

* src/common.h (readRegStr): Add prototype.

--
This is a useful function.

4 months agoSplit enable / disable window into two functions
Andre Heinecke [Thu, 14 Mar 2019 08:11:18 +0000 (09:11 +0100)]
Split enable / disable window into two functions

* src/mail.cpp (Mail::enableWindow, Mail::disableWindow_o): New.
* src/mail.h: Update accordingly.

--
This avoids giving me a heart attack when I se an _o function
called from a different thread.

4 months agoReduce spammy trace output
Andre Heinecke [Wed, 27 Feb 2019 10:12:37 +0000 (11:12 +0100)]
Reduce spammy trace output

* src/mapihelp.cpp (parse_headers_cb): Don't trace.

4 months agoFix decrypt permanently category removal
Andre Heinecke [Wed, 27 Feb 2019 10:11:38 +0000 (11:11 +0100)]
Fix decrypt permanently category removal

* src/mail.cpp (Mail::decryptPermanently_o): Remove
categories before removing the crypto state.

--
Otherwise removeCategories_o thinks that there are no
categories set for us.

4 months agoAdd debug output to show if S/MIME was detected
Andre Heinecke [Wed, 27 Feb 2019 10:11:06 +0000 (11:11 +0100)]
Add debug output to show if S/MIME was detected

* src/mail.cpp (Mail::isSMIME_m): Print detected state.

4 months agoAdd code to print out keycache inserts
Andre Heinecke [Wed, 27 Feb 2019 10:10:18 +0000 (11:10 +0100)]
Add code to print out keycache inserts

* src/keycache.cpp: Add default off code to print keycache inserts.

4 months agoAdd decrypt permanently feature
Andre Heinecke [Fri, 22 Feb 2019 05:47:18 +0000 (06:47 +0100)]
Add decrypt permanently feature

* src/gpgoladdin.cpp (GpgolRibbonExtender::GetIDsOfNames),
(GpgolRibbonExtender::Invoke),
(GetCustomUI_MIME): Add decrypt permanently.
* src/mail.cpp (Mail::decryptPermanently_o): New.
* src/ribbon-callbacks.cpp (decrypt_permanently): Wire up.

4 months agoAdd new mapi helpers for decrypt permanently
Andre Heinecke [Fri, 22 Feb 2019 05:46:02 +0000 (06:46 +0100)]
Add new mapi helpers for decrypt permanently

* src/mapihelp.cpp (mapi_delete_gpgol_tags): New. delete
our tags.
(mapi_set_message_class): Explicitly set a message class.

4 months agoFix encoding of protected header subject
Andre Heinecke [Fri, 22 Feb 2019 05:45:13 +0000 (06:45 +0100)]
Fix encoding of protected header subject

* src/mimedataprovider.cpp (MimeDataProvider::finalize): Parse
the subject through rfc2047

4 months agoAdd minimalistic protected-headers support
Andre Heinecke [Thu, 21 Feb 2019 14:16:49 +0000 (15:16 +0100)]
Add minimalistic protected-headers support

* src/mail.cpp (Mail::parsing_done): Update subject if one
was taken from a protected header.
* src/mailitem-events.cpp (prop_blacklist): Ignore subject related
changes.
* src/mimedataprovider.cpp (t2body): Handle protected headers.
(MimeDataProvider::finalize): Convert subject to a string.
(MimeDataProvider::get_internal_subject): New.
* src/parsecontroller.cpp (ParseController::get_internal_subject):
New accessor.
* src/parsecontroller.h, src/mimedataprovider.h: Update accordingly.

--
This is still bad but a little less bad then it was before.
We still ignore to and from from the protected headers but at
least we show the subject now.1

4 months agoRead autocrypt header for autoimport
Andre Heinecke [Thu, 21 Feb 2019 12:09:50 +0000 (13:09 +0100)]
Read autocrypt header for autoimport

* src/common_indep.h (autocrypt_s): Data transfer struct.
* src/keycache.cpp (KeyCache::import_pgp_key_data): Fix and
add more debugging.
* src/mail.cpp (Mail::preProcessMessage_m): Check for autocrypt
headers even on non crypto mails.
(Mail::decryptVerify_o): Parse autocrypt header for crypto mails.
* src/mapihelp.cpp (get_message_content_type_cb): Renamed
to parse_headers_cb.
(ac_get_value): New helper.
(prepare_key_data): New helper.
(mapi_get_header_info): General function for additional header info.
* src/mapihelp.h: Update accordingly.
* src/parsecontroller.cpp (handle_autocrypt_info): New helper.
(ParseController::parse): Handle autocrypt info on demand.
* src/parsecontroller.h: Update accordingly.

--
Ideally we want to do the import in the parse step as it is
then in the background thread. But for unencrypted mails we
have to do in in the pre processing because afterwards we no
longer look at the unencrypted mail.

mapi_get_header_info is intended as a new one time parse function
to get some more info from the headers. For now it only supports
autocrypt header.

4 months agoAdd cast to MAKE_SHARED macro
Andre Heinecke [Thu, 21 Feb 2019 12:08:40 +0000 (13:08 +0100)]
Add cast to MAKE_SHARED macro

* src/oomhelp.h (MAKE_SHARED): Cast to IDispatch.

--
This allows to make shared stuff like IMessage.

4 months agoAdd whitespace removal helper to cpphelp
Andre Heinecke [Thu, 21 Feb 2019 12:07:15 +0000 (13:07 +0100)]
Add whitespace removal helper to cpphelp

* src/cpphelp.cpp, src/cpphelp.h (remove_whitespace): New.

4 months agoMinor string fix
Andre Heinecke [Thu, 21 Feb 2019 12:06:37 +0000 (13:06 +0100)]
Minor string fix

* src/addin-options.cpp: Remove period at the end of an option.

4 months agoFix crash when sending encrypted mail
Andre Heinecke [Thu, 21 Feb 2019 11:38:00 +0000 (12:38 +0100)]
Fix crash when sending encrypted mail

* src/cryptcontroller.cpp (CryptController::update_mail_mapi):
Check if att_table exists before accessing it.

--
This was a regression caused by cf221afd which never made
it into a release.

4 months agoCleanly remove gpgol_sigstatus
Andre Heinecke [Thu, 21 Feb 2019 09:18:53 +0000 (10:18 +0100)]
Cleanly remove gpgol_sigstatus

* src/mapihelp.cpp (get_gpgolsigstatus_tag),
(mapi_has_sig_status, mapi_test_sig_status, mapi_get_sig_status)
(mapi_set_sig_status): Removed.
(mapi_change_message_class): Dont mark non crypto messages.
* src/mimemaker.cpp (finalize_message restore_msg_from_moss):
Do not set sigstatus.

--
The sigstatus is not used by current code and is never
read. The save changes caused by the property required
a modification and additional sync for unencrypted messages. So
we need to remove setting it.

5 months agoHandle autoimport for attached pgp keys
Andre Heinecke [Mon, 11 Feb 2019 14:48:05 +0000 (15:48 +0100)]
Handle autoimport for attached pgp keys

* src/keycache.cpp (KeyCache::import_pgp_key_data): New.
* src/keycache.h: Update accordingly.
* src/parsecontroller.cpp (ParseController::parse): Check for
pgp-keys attachments and import them.

5 months agoImplement auto encrypt untrusted
Andre Heinecke [Mon, 11 Feb 2019 14:46:00 +0000 (15:46 +0100)]
Implement auto encrypt untrusted

* src/keycache.cpp (getEncryptionKeys): Handle new option.

--
This allows opportunistic encryption to any key in the
keyring. As this is problematic it is off by default.

5 months agoAdd / parse new automation options
Andre Heinecke [Mon, 11 Feb 2019 14:45:22 +0000 (15:45 +0100)]
Add / parse new automation options

* src/common_indep.h (opt): Add new fields.
* src/main.c (read_options): Read them.

5 months agoStore content-type for attachments
Andre Heinecke [Mon, 11 Feb 2019 14:44:15 +0000 (15:44 +0100)]
Store content-type for attachments

* src/attachment.cpp (get_content_type, set_content_type): New.
* src/mimedataprovider.cpp (create_attachment): Set it.
* src/attachment.h: Update accordingly.

5 months agoFix syntax error
Andre Heinecke [Mon, 11 Feb 2019 13:36:45 +0000 (14:36 +0100)]
Fix syntax error

* src/addin-options.cpp: Fix syntax.

5 months agoFix implicit fallthrough warnings
Andre Heinecke [Mon, 11 Feb 2019 13:35:52 +0000 (14:35 +0100)]
Fix implicit fallthrough warnings

* src/application-events.cpp: Fix unintentional fallthrough from
QUIT.
* src/mailitem-events.cpp: Mark reply fallthrough as intentional.

5 months agoUse better names for our own attachments
Andre Heinecke [Mon, 11 Feb 2019 13:26:48 +0000 (14:26 +0100)]
Use better names for our own attachments

* src/mapihelp.h (MIMEATTACHFILENAME, PGPBODYFILENAME): Use
better file names.

--
This helps users to understand / analyze issues when they
introspect or see the hidden attachments due to some bug.

5 months agoAdd strings for new config options
Andre Heinecke [Mon, 11 Feb 2019 13:26:22 +0000 (14:26 +0100)]
Add strings for new config options

* src/addin-options.cpp: Add new strings.

6 months agoFix forwarding of sent mails
Andre Heinecke [Mon, 14 Jan 2019 09:15:25 +0000 (10:15 +0100)]
Fix forwarding of sent mails

* src/cryptcontroller.cpp (CryptController::update_mail_mapi):
Remove an existing MOSSTMPL if available.

--
Without this the MOSSTMPL was kept and we then had two
or more MOSSTMPLs. This resulted in undefined / buggy
behavior.

GnuPG-Bug-Id: T4321

6 months agoFix minor typo
Andre Heinecke [Mon, 14 Jan 2019 09:15:14 +0000 (10:15 +0100)]
Fix minor typo

--

6 months agoFix tooltip for bad signature
Andre Heinecke [Wed, 9 Jan 2019 09:07:26 +0000 (10:07 +0100)]
Fix tooltip for bad signature

* src/mail.cpp (Mail::getCryptoDetails_o): Handle bad signature
explicitly.

--
Otherwise the code would run into the key error checks and
would note wrongls that the UID does not match.

GnuPG-Bug-Id: T4299

6 months agopo: Auto update po files
Andre Heinecke [Mon, 7 Jan 2019 07:44:07 +0000 (08:44 +0100)]
po: Auto update po files

--

6 months agoMerge remote-tracking branch 'dutch-l10n/dutch'
Andre Heinecke [Mon, 7 Jan 2019 07:43:12 +0000 (08:43 +0100)]
Merge remote-tracking branch 'dutch-l10n/dutch'

6 months agoAdd translators comment
Andre Heinecke [Mon, 7 Jan 2019 07:41:59 +0000 (08:41 +0100)]
Add translators comment

* src/mail.cpp (Mail::updateCategories_o): Add comment to clarify
string.

--
The placeholders there need some explanation.

6 months agoUpdate Dutch translation
Erwin Bronkhorst [Thu, 3 Jan 2019 22:16:54 +0000 (23:16 +0100)]
Update Dutch translation

7 months agoFix two memdbg refcount errors
Andre Heinecke [Mon, 26 Nov 2018 13:41:24 +0000 (14:41 +0100)]
Fix two memdbg refcount errors

* src/mapihelp.cpp (is_really_cms_encrypted): Fix references.

--
This code is almost never run so that did not happen before.

7 months agoAvoid use of error msg class "IPM.Note.GpgOL"
Andre Heinecke [Mon, 26 Nov 2018 13:15:45 +0000 (14:15 +0100)]
Avoid use of error msg class "IPM.Note.GpgOL"

* src/mapihelp.cpp (change_message_class_ipm_note_secure_cex),
(change_message_class_ipm_note_smime): Use OpaqueEncrypted
rather then IPM.Note.GpgOL.
(mapi_change_message_class): Change old IPM.Note.GpgOL mails.

--
This should help debugging
GnuPG-Bug-Id: T4267

And in any case IPM.Note.GpgOL should never be used as
we do not handle it in decryption.

7 months agoInitalize pointer in mapi_get_header
Andre Heinecke [Mon, 19 Nov 2018 10:05:16 +0000 (11:05 +0100)]
Initalize pointer in mapi_get_header

* src/mapihelp.cpp (mapi_get_header): Initialize stream.

--
This would probably have avoided:

GnuPG-Bug-Id: T4262

7 months agoCheck for error in dbg decrated oom funcs
Andre Heinecke [Mon, 19 Nov 2018 09:58:20 +0000 (10:58 +0100)]
Check for error in dbg decrated oom funcs

* src/oomhelp.cpp (gpgol_openProperty, gpgol_queryInterface):
Check result before calling memdbg_addRef.

--
Calling something on the pointer on error is undefined
so we may not do it. memdbg_addRef tries to get the
name of the interface. That might then crash.
Usually the returned pointer should be NULL so
on error so it does not happen much.

GnuPG-Bug-Id: T4262

8 months agoFix log_addins and use it to log all addins
Andre Heinecke [Tue, 13 Nov 2018 09:56:58 +0000 (10:56 +0100)]
Fix log_addins and use it to log all addins

* src/mailitem-events.cpp (Read): call log_addins once.
* src/oomhelp.cpp (log_addins): Fix by invoking directly.

8 months agoPost release Version bump
Andre Heinecke [Mon, 12 Nov 2018 12:44:59 +0000 (13:44 +0100)]
Post release Version bump

--

8 months agoUpdate NEWS for todays release gpgol-2.3.2
Andre Heinecke [Mon, 12 Nov 2018 12:14:32 +0000 (13:14 +0100)]
Update NEWS for todays release

--

8 months agoFix l10n encoding in category manager
Andre Heinecke [Mon, 12 Nov 2018 12:09:45 +0000 (13:09 +0100)]
Fix l10n encoding in category manager

* src/categorymanager.cpp: Use utf8 gettext.

8 months agoUpdate german translation
Andre Heinecke [Mon, 12 Nov 2018 12:01:25 +0000 (13:01 +0100)]
Update german translation

* po/de.po: Translate new S/MIME warning.

8 months agoAuto update po files
Andre Heinecke [Mon, 12 Nov 2018 11:53:06 +0000 (12:53 +0100)]
Auto update po files

--

8 months agoImprove string for unsigned S/MIME reply
Andre Heinecke [Mon, 12 Nov 2018 11:51:28 +0000 (12:51 +0100)]
Improve string for unsigned S/MIME reply

* src/mailitem-events.cpp: Improve string for unsigned
S/MIME reply.

8 months agoDisable async crypt for mails without subject
Andre Heinecke [Fri, 9 Nov 2018 17:36:12 +0000 (18:36 +0100)]
Disable async crypt for mails without subject

* src/mail.cpp (Mail::check_inline_response): Disable also
for empty subject.
--
For mails with an empty subject Outlook asks if the mail
should be sent anyway. If we do async crypto it also asks
on our triggered send event. In that case the overlay
blocks it. So better just disable async in that case so
that there are no two questions.

GnuPG-Bug-Id: T4150

8 months agoAdd explicit decrypt as WindowMessage handler
Andre Heinecke [Fri, 9 Nov 2018 17:17:36 +0000 (18:17 +0100)]
Add explicit decrypt as WindowMessage handler

* src/mail.cpp (decryptVerify_o): Remove obsolete safeguard
against double decryption.
* src/windowmessages.cpp (EXT_API_DECRYPT): Add new command.

--
This is nice to have a close -> do something with the encrypted
mail -> decrypt again workflow.

GnuPG-Bug-Id: T4241

8 months agoPass write for closed mails
Andre Heinecke [Fri, 9 Nov 2018 14:44:21 +0000 (15:44 +0100)]
Pass write for closed mails

* src/folder-events.cpp (Invoke): Set is now implicit in close.
* src/mail.cpp: Change isAboutToBeMoved to passWrite.
(decryptVerify_o): Stop passing write when processing.
* src/mailitem-events.cpp (Write): Pass it when a mail was closed
by us.

--
After closing with discard changes it should be ok to write
as long as we are not decrypted again. This can be helpful
after an external close was triggered and is basically
the same as what we do for a move.

GnuPG-Bug-Id: T4241

8 months agoOverride file close cmd to trigger shutdown
Andre Heinecke [Fri, 9 Nov 2018 10:20:05 +0000 (11:20 +0100)]
Override file close cmd to trigger shutdown

* src/gpgoladdin.cpp (GpgolRibbonExtender::GetIDsOfNames)
(GpgolRibbonExtender::Invoke): Hookup override.
(GetCustomUI_MIME): Override File->Close command.
* src/ribbon-callbacks.cpp (override_file_close): New.
* src/ribbon-callbacks.h: Update accordingly.

--
There are two ways Outlook can be closed. Either through
a Windowmessage (which wie handled already) or through
the FileClose Command. We now also handle the FileClose
to shutdown.
Doing the shutdown later does not work for us because before
we get any events or shutdown notifications we already have
to close / discard our decrypted contents.

GnuPG-Bug-Id: T4236

8 months agoMinor debug output improvements
Andre Heinecke [Thu, 8 Nov 2018 14:43:36 +0000 (15:43 +0100)]
Minor debug output improvements

--

8 months agoRevert "Add InspectorEvents experiment"
Andre Heinecke [Thu, 8 Nov 2018 14:43:21 +0000 (15:43 +0100)]
Revert "Add InspectorEvents experiment"

This reverts commit db8f468e0462f2a4d600b41f8dd0e6b4135d38fa.

8 months agoAdd InspectorEvents experiment
Andre Heinecke [Thu, 8 Nov 2018 14:42:25 +0000 (15:42 +0100)]
Add InspectorEvents experiment

--
This commit is just an experiment to check the order
of events when closing.

8 months agoAdd some NEWS
Andre Heinecke [Thu, 8 Nov 2018 13:04:23 +0000 (14:04 +0100)]
Add some NEWS

--

8 months agoUse WM_USER without offset for ext messages
Andre Heinecke [Thu, 8 Nov 2018 13:01:40 +0000 (14:01 +0100)]
Use WM_USER without offset for ext messages

* src/windowmessages.cpp,
tests/run-messanger.cpp: Use WM_USER without offset.

--
Some documentation like the wine windowmessages list documents
that above WM_USER messages are still system defined.

8 months agoAdd tracing in shutdown
Andre Heinecke [Thu, 8 Nov 2018 13:01:06 +0000 (14:01 +0100)]
Add tracing in shutdown

* src/gpgoladdin.cpp (GpgolAddin::shutdown): Add tracing.

8 months agoSet validate keylist mode for keycache
Andre Heinecke [Thu, 8 Nov 2018 12:40:30 +0000 (13:40 +0100)]
Set validate keylist mode for keycache

* src/keycache.cpp (do_populate_protocol): Add validate option.

--
This fixes S/MIME keys for verfied signatures to have trust
level 2 (because their trust was unknown) before the key
is first updated.

8 months agoFix 64bit format error
Andre Heinecke [Thu, 8 Nov 2018 12:38:27 +0000 (13:38 +0100)]
Fix 64bit format error

* src/windowmessages.cpp (gpgol_window_proc): Fix message id.

8 months agoAdd external API with WindowMessages
Andre Heinecke [Thu, 8 Nov 2018 12:13:06 +0000 (13:13 +0100)]
Add external API with WindowMessages

* src/windowmessages.cpp: Handle new messages.
* src/windowmessagees.h: Add new codes.
* tests/Makefile.am: Update accordingly.
* tests/run-messenger.cpp: New.

--
The run-messenger can be used as an example how to use
this API. As we block saves while decrypted data is open
we add API to close the mails now. Either all or a specific
uuid.

e.g.:

run-messenger.exe 1301 1147d7ed-22fb-48d2-8678-a814df5009eb

GnuPG-Bug-Id: T4241

8 months agoUpdate POTFILES and po files and de.po
Andre Heinecke [Tue, 6 Nov 2018 10:51:28 +0000 (11:51 +0100)]
Update POTFILES and po files and de.po

--

8 months agoFix infographic url
Andre Heinecke [Tue, 6 Nov 2018 07:56:27 +0000 (08:56 +0100)]
Fix infographic url

* src/ribbon-callbacks.cpp (launch_cert_details): Fix url.

--
The old redirect redirects to 404 :-( Maybe time to
change the infographic.

8 months agoAdd junk mail handling
Andre Heinecke [Tue, 6 Nov 2018 07:54:26 +0000 (08:54 +0100)]
Add junk mail handling

* src/categorymanager.cpp (getJunkMailCategory): New.
* src/mail.cpp (Mail::decryptVerify_o): Handle junk.
* src/mail.h (Mail::m_is_junk): New.

--
Junk mails are special. An addon can't access the attachments
so we can't decrypt PGP-MIME. We just add a marker to let
the user now and register our folder event handler so
that the mail can be moved out of junk.

GnuPG-Bug-Id: T4188

8 months agoAdd junk/spam mail folder detection
Andre Heinecke [Mon, 5 Nov 2018 15:44:00 +0000 (16:44 +0100)]
Add junk/spam mail folder detection

* src/oomhelp.cpp, src/oomhelp.h (is_junk_mail): New.

--
We can't access attachments in junk so we need some special
handling. As there is no "Junk" property we do this by
comparing the entryid of the accounts junk folder with
the actual folder of the mail.

GnuPG-Bug-Id: T4188

8 months agoFix tests build for different gpgmepp prefix
Andre Heinecke [Mon, 5 Nov 2018 08:11:14 +0000 (09:11 +0100)]
Fix tests build for different gpgmepp prefix

* tests/Makefile.am: Add GPGME_CXXFLAGS to CXXFLAGS.

8 months agoFix Linux build of tests
Andre Heinecke [Tue, 30 Oct 2018 08:18:35 +0000 (09:18 +0100)]
Fix Linux build of tests

* src/common_indep.c: Include wchar.h
* src/cpphelp.cpp (in_de_vs_mode): use strcasecm
(get_registry_subkeys): Make conditional.
* src/cpphelp.h: Update accordinlgy.
* src/debug.cpp: Fix unused errors and do locking.
* src/parsecontroller.cpp (ParseController::parse): Remove unused
warning.
* tests/Makefile.am: Add definitions for linux

8 months agoMinor style improvement in run-parser output
Andre Heinecke [Tue, 30 Oct 2018 08:16:22 +0000 (09:16 +0100)]
Minor style improvement in run-parser output

* tests/run-parser.cpp (main): Add some newlines.

8 months agotests: Add repeats option to parser runner
Andre Heinecke [Mon, 29 Oct 2018 12:49:15 +0000 (13:49 +0100)]
tests: Add repeats option to parser runner

* tests/run-parser.cpp: Add repeats option.

8 months agoInitialize memory to X on trace + memdbg
Andre Heinecke [Mon, 29 Oct 2018 10:53:27 +0000 (11:53 +0100)]
Initialize memory to X on trace + memdbg

* src/xmalloc.h (xmalloc): Initialize memory to X on debug
level.

--
This is intended to better find memory errors.

8 months agoFix off by one in iconv_to_utf8
Andre Heinecke [Mon, 29 Oct 2018 10:52:23 +0000 (11:52 +0100)]
Fix off by one in iconv_to_utf8

* src/mlang-charset.cpp (iconv_to_utf8): Inlen needed
to include the zero.

--
This fixes a crash when this function is used for conversion.

8 months agoEnable building tests for windows
Andre Heinecke [Mon, 29 Oct 2018 10:13:08 +0000 (11:13 +0100)]
Enable building tests for windows

* src/debug.cpp: Use platform indepentent gpgrt_locks.
* src/main.c (initialize_main): Drop mutex init.

8 months agoPopulate keycache on startup
Andre Heinecke [Thu, 25 Oct 2018 12:03:36 +0000 (14:03 +0200)]
Populate keycache on startup

* src/gpgoladdin.cpp (GpgolAddin::OnStartupComplete): Populate
keycache.
* src/keycache.cpp (KeyCache::populate, do_populate)
(do_populate_protocol): New.
(KeyCache::getUltimateKeys): New.
* src/mail.cpp (level_4_check): Use getUltimateKeys from cache.
* src/parsecontroller.cpp, src/parsecontroller.h (get_ultimate_keys):
Removed.

--
This moves the ultimate keys cache into the keycache where it
belongs and should fix problems not finding signing keys when
sign always is set. It should also speed up the first verify
operation as keylistings are no longer required.

GnuPG-Bug-Id: T4218

8 months agoRevert "Explicitly set real access key for reg too"
Andre Heinecke [Thu, 25 Oct 2018 10:29:56 +0000 (12:29 +0200)]
Revert "Explicitly set real access key for reg too"

This reverts commit bf4ab9a6d16869aa6083b10b54a77fc9b8b95b41.

8 months agoExplicitly set real access key for reg too
Andre Heinecke [Thu, 25 Oct 2018 10:23:42 +0000 (12:23 +0200)]
Explicitly set real access key for reg too

* src/common.cpp (REAL_ACCESS): Define.

--
We have to make sure that we try both registry views.

8 months agoRead HKLM fallback from cross registry view
Andre Heinecke [Thu, 25 Oct 2018 09:50:58 +0000 (11:50 +0200)]
Read HKLM fallback from cross registry view

* src/addin-options.cpp (open-gpgolconfig): Do not pass w64 again.
* src/common.cpp (CROSS_ACCESS): New define.
(_readRegStr): Helper for readRegStr.
(readRegStr): More explicit fallbacks.

--
This should be more robust to handle cases where either
HKLM is set up as 32 bit registry key or as 64 bit registry
key.

8 months agoUse gpgrt_w32_iconv as fallback for mlang-charset
Andre Heinecke [Thu, 25 Oct 2018 07:15:18 +0000 (09:15 +0200)]
Use gpgrt_w32_iconv as fallback for mlang-charset

* src/mlan-charset.cpp (ansi_charset_to_uf8): Use gpgrt
as a fallback.

--
We only use it as a fallback as the old code is known to work
and we want to avoid regressions in case the charset names
differ between gpgrt and getcharsetinfo.

GnuPG-Bug-Id: T4156

8 months agoPass --w64 parameter to gpgolconfig
Andre Heinecke [Wed, 24 Oct 2018 12:45:33 +0000 (14:45 +0200)]
Pass --w64 parameter to gpgolconfig

* src/addin-options.cpp (open_gpgolconfig): Pass --64 on
64 bit systems.