Andre Heinecke [Fri, 16 Dec 2016 15:01:28 +0000 (16:01 +0100)]
Handle button click for encrypted only mails
* src/ribbon-callbacks.cpp (launch_cert_details): Handle
the case were a mail is unsigned.
Andre Heinecke [Fri, 16 Dec 2016 14:58:20 +0000 (15:58 +0100)]
Use signed and encrypted again in tooltip
* src/ribbon-callbacks.cpp (get_sig_ttip): Use signed
and encrypted again.
--
This makes it more transparent and obvious for our existing
users what the new UI language means by secure, signed but
not secure etc.
Andre Heinecke [Fri, 16 Dec 2016 14:53:28 +0000 (15:53 +0100)]
Implement direct trust handling
* src/mail.cpp (level_4_check): Do the actual check for direct
trust.
(Mail::get_crypto_details): Handle level 4 subcases with different
details.
* src/parsecontroller.cpp (ParseController::parse): Fetch
ultimately trusted keys if a sig was fully or ultimately valid.
(ParseController::get_ultimate_keys): New Helper function
to cache the ultimately valid keys.
* src/parsecontroller.h: Update accordingly.
Andre Heinecke [Thu, 15 Dec 2016 16:55:11 +0000 (17:55 +0100)]
Don't add a dot after the tooltip
* src/ribbon-callbacks.cpp (get_sig_ttip): Remove dot.
Andre Heinecke [Thu, 15 Dec 2016 16:54:20 +0000 (17:54 +0100)]
Fix signature level for unencrypted mails
* src/mail.cpp (Mail::get_signature_level): Don't always
return 0 for unencrytped mails.
Andre Heinecke [Thu, 15 Dec 2016 16:53:41 +0000 (17:53 +0100)]
Various string fixes for crypto_details
* src/mail.cpp (Mail::get_crypto_details): Various string
fixes.
Andre Heinecke [Thu, 15 Dec 2016 16:52:13 +0000 (17:52 +0100)]
Invert category order
* src/mail.cpp (Mail::update_categories): Invert order.
--
This should help when outlook decides to only show one category
because now the verified sender which is more important is shown
first.
Andre Heinecke [Thu, 15 Dec 2016 16:50:58 +0000 (17:50 +0100)]
Use insecure instead of signed to sum up lvl1
* src/mail.cpp (Mail::get_crypto_summary): Use insecure instead
of signed.
--
The word signed implies security and so might make phishing
easier if a signed phishing mail is shown as signed and not
as insecure.
Andre Heinecke [Thu, 15 Dec 2016 16:50:10 +0000 (17:50 +0100)]
Fix sigstate setting
* src/mail.cpp (Mail::update_sigstate): Skip empty uids
instead of non empty ones :-)
Andre Heinecke [Thu, 15 Dec 2016 16:48:48 +0000 (17:48 +0100)]
Pass key by reference to get_uid
* src/mail.cpp (get_uid_for_sender): Pass key by reference
to avoid a copy.
Andre Heinecke [Thu, 15 Dec 2016 16:07:09 +0000 (17:07 +0100)]
Always activate the GpgOL read button
* src/gpgoladdin.cpp (getCustomUI_MIME): Always enable button.
* src/ribbon-callbacks.cpp (launch_cert_details): Open
the emailselfdefense infographic for unencrypted / unsigned
mails.
--
Maybe a bit too much, but the idea is to raise awareness
that unencrypted / unsigned mails are insecure.
Andre Heinecke [Thu, 15 Dec 2016 11:01:25 +0000 (12:01 +0100)]
Handle opaque signed inline pgp messages
* src/parsecontroller.cpp (ParseController::parse):
Handle opaque signed PGP Messages.
--
For signed only messages decryptandverify would create no
output we need to just verify in that case.
Andre Heinecke [Wed, 14 Dec 2016 16:04:08 +0000 (17:04 +0100)]
Fix / improve inline PGP decryption
* src/mapihelp.cpp (change_message_class_ipm_note): Look for
PGP Lines even without content type.
* src/mimedataprovider.cpp (MimeDataProvider::write): Respect
m_collect_everything.
* src/parsecontroller.cpp (ParseController::ParseController): Don't
expect MIME headers for inline pgp data.
(expect_no_mime): New.
Andre Heinecke [Wed, 14 Dec 2016 16:03:20 +0000 (17:03 +0100)]
Update copyright year
--
Andre Heinecke [Wed, 14 Dec 2016 15:51:17 +0000 (16:51 +0100)]
Update signature status display
* src/icons: Add new Icons, remove old icons.
* src/icons/Makefile.am (EXTRA_DIST): Update accordingly.
* src/dialogs.h: Define ids
* src/dialogs.rc: Include new icons.
* src/gpgoladdin.cpp: Update some function names.
* src/mail.cpp (Mail::update_sigstate): Use tofu validity
from gnupg.
(Mail::get_valid_sig): Removed. Too confusing.
(Mail::is_signed): Constify.
(Mail::is_encrypted): New, similar to is_signed.
(level_4_check): Helper to figure out the correct message
for level 4.
(Mail::get_crypto_summary): New. More differntiated title.
(Mail::get_signature_level): New. defines levels.
(Mail::get_crypto_details): New. Replacement for get_signature_status
(Mail::get_crypto_icon_id): Use levels and new icons.
* src/mail.h: Update accordingly.
* src/ribbon-callbacks.cpp (get_is_crypto): Renamed from
get_is_signed.
(get_sig_label): Use get_crypto_summary.
(get_sig_ttip): Use get_crypto_summary.
(get_sig_stip): Use get_crypto_details.
(get_crypto_icon): Use renamed function.
* src/ribbon-callbacks.h: Update accordingly.
--
This commits starts implementing signature / crypto status
display as discussed on:
https://wiki.gnupg.org/EasyGpg2016/AutomatedEncryption
Apologies for the large commits that mushes the string
and icon changes.
There are still bugs but I needed to commit some changes so
that I won't get lost completely.
Andre Heinecke [Fri, 9 Dec 2016 14:19:22 +0000 (15:19 +0100)]
Recuce Sign and Encrypt to single split button
* src/dialogs.h: Add new icon ids.
* src/ribbon-callbacks.h: Add new ids.
* src/ribbon-callbacks.cpp (GpgolRibbonExtender::GetIDsOfNames),
(GpgolRibbonExtender::Invoke): Handle new ids.
(GetCustomUI_MIME): Use split button.
* src/ribbon-callbacks.cpp (mark_mime_action): Invalidate ui.
(get_crypt_pressed): Handle queries for multiple flags.
Andre Heinecke [Fri, 9 Dec 2016 14:17:13 +0000 (15:17 +0100)]
Improve messagelist icon
* encr-s.ico, encr-s.xcf: Imrpove 1bit alpha use by mixing more
white into the still transparent colors. Remove line in the middle
this was too small for 16x16
Andre Heinecke [Fri, 9 Dec 2016 14:23:08 +0000 (15:23 +0100)]
Add new icons for sign / encrypt
* src/icons/Makefile.am (EXTRA_DIST): Update accordingly.
* encrypt-20.png, encrypt.svg, sign-20.png, sign-enc-40.png,
sign-enc.svg, sign.svg: New.
--
This is more in the visual language of Outlook with the ribbon
as a signature icon. It's also using the new lock of gpgol.
Andre Heinecke [Mon, 5 Dec 2016 16:43:43 +0000 (17:43 +0100)]
Fix multipart/alternative html mails
* src/mimemaker.cpp (add_body_and_attachments): Properly
handle the case when inner and outer boundary is null.
Andre Heinecke [Mon, 5 Dec 2016 16:42:00 +0000 (17:42 +0100)]
Use MAPI message for mapi_get_uid
* src/mapihelp.cpp, src/mapihelp.h (mapi_get_message):
Change to take message as argument.
* src/ribbon-callbacks.cpp (get_mail_from_control): Update usage.
Andre Heinecke [Mon, 5 Dec 2016 16:21:23 +0000 (17:21 +0100)]
Mention srcname / func in debug of invalidation
* src/gpgoladdin.cpp (gpgoladdin_invalidate_ui): Put srcname
and func in debug.
--
Makes debug output easier to read.
Andre Heinecke [Mon, 5 Dec 2016 16:19:50 +0000 (17:19 +0100)]
Prepare OOM Event handler for OL 2007
* src/mailitem-events.cpp (EVENT_SINK_INVOKE): Set uuid
on Open and pre_process in Read for OL 2007.
Andre Heinecke [Mon, 5 Dec 2016 16:17:54 +0000 (17:17 +0100)]
Add send_seen as member variable to Mail object
* src/mail.cpp, src/mail.h (Mail::needs_encrypt),
(Mail::set_needs_encrypt): New.
* src/mailitem-events.cpp (EVENT_SINK_INVOKE): Use new functions.
--
This puts the last state variable from the event handler into
the Mail object. It will be needed to Support Outlook 2007
where we have two event handlers.
Andre Heinecke [Mon, 5 Dec 2016 16:14:54 +0000 (17:14 +0100)]
Add fallback to create categories
* src/oomhelp.cpp (ensure_category_exists): Fallback to
Session.Categories.
--
If there are not multiple sessions this fallback is needed
t least for outlook 2007.
Andre Heinecke [Mon, 5 Dec 2016 16:12:56 +0000 (17:12 +0100)]
Always initialize execpinfo
* src/oomhelp.cpp (get_oom_object, put_oom_string),
(add_oom_attachment, get_pa_variant, invoke_oom_method_with_parms):
Initialize execepinfo.
--
It is not assured that invoke sets excepinfo. This might have
lead to crashes in dump_excepinfo.
Andre Heinecke [Thu, 1 Dec 2016 16:37:57 +0000 (17:37 +0100)]
Preselect sign / encrypt for reply / forward
* src/mail.cpp (Mail::Mail): Initalize crypto flags.
(Mail::get_crypto_flags): New.
(Mail::parsing_done): Set crypto flags.
* src/mailitem-events.cpp (EVENT_SINK_INVOKE): Handle reply, forward
and ReplyAll.
--
This sets sign for signed mails, encrypt for encrypted mails
and sign & encrypt for signed and encrypted mails.
Andre Heinecke [Thu, 1 Dec 2016 16:22:05 +0000 (17:22 +0100)]
Fix Reply event ID
* src/mailitem-events.cpp (MailEvent): Fix reply id.
--
This explains why the reply event behaved surprisingly as
it was actually the ReadComplete event...
Andre Heinecke [Thu, 1 Dec 2016 16:13:14 +0000 (17:13 +0100)]
Add supertip for unsigned messages
* src/ribbon-callbacks.cpp (get_sig_stip): Handle mail not found
case.
--
Mail not found means no crypto mail
Andre Heinecke [Thu, 1 Dec 2016 16:09:30 +0000 (17:09 +0100)]
Fix crash when viewing unsigned mails
* src/ribbon-callbacks.cpp (get_sig_label): Return early
if mail not found.
--
Ooops. Although it could be considered a security feature ;-)
Andre Heinecke [Thu, 1 Dec 2016 15:57:43 +0000 (16:57 +0100)]
Add missing icon
* src/icons/emblem-success-yellow-64.png: New.
Andre Heinecke [Thu, 1 Dec 2016 15:52:35 +0000 (16:52 +0100)]
Remove some development debugs
* src/mail.cpp (update_oom_data): Remove some development
debug statements.
Andre Heinecke [Thu, 1 Dec 2016 15:47:39 +0000 (16:47 +0100)]
Change wording to better distinguish fully trusted
* src/mail.cpp (Mail::get_signature_status): Distinguish between
trusted and fully trusted.
* src/ribbon-callbacks.cpp (get_sig_label): Use three labels
instead of two.
--
Only changing the icon color was a too weak distinction. Especially
regarding accessibility.
Andre Heinecke [Thu, 1 Dec 2016 14:48:12 +0000 (15:48 +0100)]
Change wording in signature details
* src/mail.cpp (Mail::get_signature_status): Change wording.
* src/ribbon-callbacks.cpp (get_sig_label): Use trust instead
verified.
--
Trusted Sender is still very easygoing but we now have a better
distinction between fully trusted and marginally trusted.
Andre Heinecke [Thu, 1 Dec 2016 14:47:30 +0000 (15:47 +0100)]
Log if a uid was skipped because of no email
* src/mail.cpp (get_uid_for_sender): Log if mail is null.
Andre Heinecke [Thu, 1 Dec 2016 14:45:36 +0000 (15:45 +0100)]
Change valid category to Trusted Sender Address
* src/gpgoladdin.cpp (GpgolAddin::OnStartupComplete): Change
category name.
(Mail::remove_categories, Mail::update_categories): Use new
name.
--
Verified Sender was too strong, we now relate to the
address.
Andre Heinecke [Thu, 1 Dec 2016 14:44:17 +0000 (15:44 +0100)]
Enable clearsigned support again for reading
* src/mapihelp.cpp (get_msgcls_from_pgp_lines): Enable clearsigned
support.
--
I just forgot that this was disabled. We can support this now.
Andre Heinecke [Thu, 1 Dec 2016 14:42:32 +0000 (15:42 +0100)]
Add yellow checker for basic / marginal trust
* src/dialogs.h, src/dialogs.rc: Update accordingly.
* src/icons/emblem-success-yellow.svg,
src/icons/emblem-success-yellow-64.png: New.
* src/icons/Makefile.am (EXTRA_DIST): Add new icon and
svg icons.
* srC/mail.cpp (Mail::get_signature_icon_id): Use it.
Andre Heinecke [Wed, 30 Nov 2016 16:17:14 +0000 (17:17 +0100)]
Support multipart/related reading
* src/attachment.cpp (Attachment::set_content_id)
(Attachment::get_content_id): New.
* src/mail.cpp (get_attachment): Return last attachment on -1 pos
(fixup_last_attachment): New. Set content id.
(add_attachments): Call fixup.
* src/oomhelp.h (PR_ATTACH_CONTENT_ID_DASL): New.
* src/mimedataprovider.cpp (t2body): Parse content-id.
(MimeDataProvider::create_attachment): Set content-id.
--
This magically hides the attachment from the attachment list
and Outlook shows images in the body.
Andre Heinecke [Wed, 30 Nov 2016 14:34:11 +0000 (15:34 +0100)]
Support sending embedded images(multipart/related)
* src/mimemaker.cpp (add_body_and_attachments): New. Common
multipart handling for the encrypt / sign functions.
* src/mimemaker.cpp (mime_encrypt, do_mime_sign):
Use add_body_and_attachments.
(is_related): New. Check if we have a multipart/related.
(write_attachments): Allow to filter out related attachments.
(write_part): Write Content-ID if there is one.
* src/mymapitags.h (PR_ATTACH_CONTENT_ID): New.
--
This enables multipart/related and multipart/mixed with a
multipart/related subpart.
Andre Heinecke [Wed, 30 Nov 2016 14:30:55 +0000 (15:30 +0100)]
Add content_id to our attach table
* src/common_indep.h (mapi_attach_item_t): Extend with
content_id.
* src/mapihelp.cpp (get_attach_content_id): New.
(mapi_create_attach_table): Use it.
(mapi_release_attach_table): Free it.
Andre Heinecke [Wed, 30 Nov 2016 14:29:19 +0000 (15:29 +0100)]
Fix content type detection
* src/mimemaker.cpp (infer_content_type): Fix it.
--
This never worked because the tolower did not increase the
suffix pointer and just filled the buffer with the first letter
of the suffix.
Now we have c++ we can simplify the tolower.
Andre Heinecke [Tue, 29 Nov 2016 17:22:49 +0000 (18:22 +0100)]
Fix mulipart/mixed with alternative content
* src/mimemaker.cpp (add_body): Open new part if in mixed structure.
Andre Heinecke [Tue, 29 Nov 2016 17:01:19 +0000 (18:01 +0100)]
Support HTML sending and fix sender updates
* src/mail.cpp (Mail::Mail): Update init.
(Mail::get_sender): Sender is now a string.
(Mail::encrypt_sign): Update accordingly.
(Mail::update_sender): Changed to update_oom_data.
(Mail::update_oom_data): More generic. Caches BodyFormat,
HTMLBody and sender. Changed order for sender retrieval
when composing mails.
(Mail::update_sigstate): Update accordingly.
(Mail::is_html_alternative, Mail::get_cached_html_body): New.
* src/mail.h: Update accordingly.
* src/mailitem-events.cpp (EVENT_SINK_INVOKE): Update oom data
on send.
* src/mimemaker.cpp (create_mapi_attachment): Fix another use
after free.
(infer_content_type): is_mapibody now defines text/html or
text/plain. The naive content deduction is removed.
(add_body): Handler for the HTML / multipart body.
(do_mime_sign, mime_encrypt): Use add_body.
(mime_sign, mime_sign_encrypt): Pass on mail object.
--
We now send multipart/alternative mails in case HTML or RichText
is selected as body format. This is the way outlook does it, too.
The sender update fix is a bit mushed in as this is now all
update_oom_data.
Andre Heinecke [Tue, 29 Nov 2016 16:51:26 +0000 (17:51 +0100)]
Ignore more property changes
* src/mailitem-events.cpp (prop_blacklist): Add OutlookVersion
and OutlookInternalVersion.
--
For mails imported from the filesystem outlook changed these
properties.
Andre Heinecke [Mon, 28 Nov 2016 15:45:26 +0000 (16:45 +0100)]
Rework close and remove hacks for bad events
* src/mail.cpp (Mail::close): Make it static to handle the
case were close causes a mail deletion.
(Mail::close_inspector): Make it static.
(Mail::close_all_mails): Close inspector first. Handle
map changes and object deletion.
(Mail::~Mail): Don't delete event sink.
(Mail::get_close_triggered, Mail::set_close_triggered): New.
* src/mailitem-events.h (EVENT_SINK_INVOKE): Remove
uneccessary Close hacks. Fix fallthrough from Open to
before read. Fix fallthrough from Close to unload.
Check if a close was triggered by us.
(request_close, request_decrypt): Remvoed.
* src/windowmessages.cpp, src/windowmessages.h (REQUEST_DECRYPT)
(REQUEST_CLOSE): Removed.
--
This fixes various inconsistentcies in the Close handling, especially
if the Object calling the close was deleted during the call. Also
closing the inspectors before closing the mail fixes a crash that
could be triggered if more then one mail was open when closing.
The proper closing now also prevents the necessity for decrypt again.
The Open to BeforeRead fallthrough should not be a big issue,
still a problem. And the close to unload fallthrough with my
long comments explaining it,.. well *facepalm*..
GnuPG-Bug-Id: 2855
Andre Heinecke [Mon, 28 Nov 2016 13:59:48 +0000 (14:59 +0100)]
Don't close non-crypto mails
* src/mail.cpp (Mail::close_all_mails): Ignore non crypto mails.
Don't delete mail on error.
--
Closing non crypto mails is a chance for data loss as it could
have caused drafts to be discarded. The delete on error is also
not good as we don't know if the close already triggered the
unload event and so may have unloaded the mail already.
Andre Heinecke [Mon, 28 Nov 2016 13:58:09 +0000 (14:58 +0100)]
Fix race between deletion and parser access
* src/mail.cpp (Mail::~Mail): Lock destruction.
(do_decrypt): Lock validity check and parser access.
--
This fixes a crash that could be triggered by wildly switching
between encrypted / signed mails.
Andre Heinecke [Mon, 28 Nov 2016 11:38:44 +0000 (12:38 +0100)]
Use inline text as body if no body seen
* src/mimedataprovider.cpp (t2body): Use first text
attachment as body if it is an inline attachment.
(MimeDataProvider::create_attachment): Log the attachment
name.
--
This fixes handling mails from kmail 1
Andre Heinecke [Mon, 28 Nov 2016 11:36:13 +0000 (12:36 +0100)]
Handle detected attachments without filenames
* src/mail.cpp (Mail::add_attachments): Ingore attachments without
filenames.
(Mail::parsing_done): Don't fail hard on attachment add failure.
--
This fixes the case if some mimestructure or unknown multipart/mixed
attachments like the "private-headers" mimepart from Enigmail is
present. Before this the first empty attachment filename would
result in an error and no other attachments would have been shown.
Andre Heinecke [Thu, 17 Nov 2016 15:57:26 +0000 (16:57 +0100)]
Ignoore WM_SYSCOMMAND / SC_CLOSE
* src/windowmessages.cpp (gpgol_hook): Ignore WM_SYSCOMMAND
SC_CLOSE.
--
I have not found a way where SC_CLOSE is sent but WM_CLOSE
is not sent. This fixes double close crashes when both WM_SYCOMMAND
and SC_CLOSE are handled but the close did not complete the
unload of the message.
Maybe we should remove our mails from the internal map as soon
as we call close.
Andre Heinecke [Thu, 17 Nov 2016 14:48:59 +0000 (15:48 +0100)]
Improve wording in debug output for failed crypto
--
Andre Heinecke [Thu, 17 Nov 2016 14:47:31 +0000 (15:47 +0100)]
Don't show MessageBox when encryption failed
* src/message.cpp (sign_encrypt): Disable messagebox
--
At least kleopatra returns -1 if encryption is cancelled by
the user. In that case we really really don't want to have
that messagebox.
Andre Heinecke [Thu, 17 Nov 2016 14:36:45 +0000 (15:36 +0100)]
Start locate-keys when a recipient is added
* src/mail.cpp (Mail::locate_keys): Check for recipient keys.
(do_locate): New.
(Mail::needs_crypto): Return flags.
* src/mail.h: Update accordingly.
* src/mailitem-events.cpp (EVENT_SINK_INVOKE): Handle recipient
changes and do locate_keys if necessary.
--
Checked addresses are stored in a set so that they are not
searched twice per session to avoid spammy requests.
This feature is mostly useful for users of auto-key-locate
where this can be used to retrieve keys from dane etc.
Andre Heinecke [Thu, 17 Nov 2016 14:34:07 +0000 (15:34 +0100)]
Add autoresolve keys option for encryption
* src/addin-options.cpp (set_labels): Improve wording.
* src/dialogs.rc: Fix layout of autoresolve option.
* src/main.c (read_options, write_options): Handle option.
Andre Heinecke [Thu, 17 Nov 2016 12:35:14 +0000 (13:35 +0100)]
Sleep a bit in engine_wait
* src/engine.c (engine_wait): Sleep in the busy wait loop.
Andre Heinecke [Thu, 17 Nov 2016 12:32:06 +0000 (13:32 +0100)]
Fix minor memory leak in error condition
* src/ommon_indep.c (qp_encode): Free outbuf on error.
Andre Heinecke [Wed, 16 Nov 2016 09:00:15 +0000 (10:00 +0100)]
Add some NEWS
--
Andre Heinecke [Tue, 15 Nov 2016 14:16:59 +0000 (15:16 +0100)]
Use undecoded body if charset unkown or not found
* src/mlang-charset.cpp (ansi_charset_to_utf8): Handle no charset.
Andre Heinecke [Tue, 15 Nov 2016 14:16:18 +0000 (15:16 +0100)]
Add some more error messages to finalize_message
* src/mimemaker.cpp (finalize_message): Add some more errors.
Andre Heinecke [Tue, 15 Nov 2016 14:15:14 +0000 (15:15 +0100)]
Fix use after free in mimemaker
* src/mimemaker.cpp (create_mapi_attachment),
(finalize_message): Do not use GpgOLStr for assignments.
Andre Heinecke [Tue, 15 Nov 2016 14:12:54 +0000 (15:12 +0100)]
Fix use after free & double free
* src/mail.cpp (Mail::get_signature_status): Do not append / free
buf as it is no longer set in the above block.
Andre Heinecke [Tue, 15 Nov 2016 12:06:06 +0000 (13:06 +0100)]
Install forms for formpath forms
* forms/Makefile.am (cfg): Add new forms.
Andre Heinecke [Tue, 15 Nov 2016 10:28:57 +0000 (11:28 +0100)]
Ignore UnRead property change notification
* src/mailitem-events.cpp: Ignore UnRead
--
UnRead is handled, we just ignore the notification.
Andre Heinecke [Tue, 15 Nov 2016 09:48:16 +0000 (10:48 +0100)]
Fix check for gpgme-w32spawn
* src/main.cpp (get_gpgme_w32_inst_dir): Fix name of
gpgme-w32spawn.exe
Andre Heinecke [Tue, 15 Nov 2016 08:26:38 +0000 (09:26 +0100)]
Remove buggy debug output warning
* src/main.c (read_options): Don't show messagebox about
debug output.
--
Let's assume that users that have enabled debug output know
that. This message also was only shown if log_file was set
(even if set to an empty string) and debug output was off.
Andre Heinecke [Mon, 14 Nov 2016 17:38:48 +0000 (18:38 +0100)]
Look for libgpgmepp in the right libdir
* src/Makefile.am (libgpgmepp.a): Use correct prefix.
Andre Heinecke [Mon, 14 Nov 2016 17:17:24 +0000 (18:17 +0100)]
Fix errors from
1b822ad2
* src/mail.cpp: Fix utf8 macro.
(Mail::get_signature_status): Fix typo.
* src/mailitem-events.cpp: Fix utf8 macro.
--
One should never push without compiling.
Andre Heinecke [Mon, 14 Nov 2016 14:10:46 +0000 (15:10 +0100)]
Update translations and translate german
* po/POTFILES.in: Add all files containing gettext macros.
* po/de.po: Update and translate.
* po/fr.po, po/pt.po, po/sv.po, po/zh_CN.po, po/zh_TW.po: Autoupdate
Andre Heinecke [Mon, 14 Nov 2016 14:10:05 +0000 (15:10 +0100)]
Improve some strings for l10n
--
Andre Heinecke [Mon, 14 Nov 2016 10:03:36 +0000 (11:03 +0100)]
Make gpgme install dir selection more flexible
* src/main.c (get_gpgme_w32_inst_dir): New.
(DllMain): Use it.
--
This makes the w32-inst-dir finding work with gpg4win-2 where
gpg-w32-spawn is not in the bin dir.
Andre Heinecke [Fri, 11 Nov 2016 16:35:55 +0000 (17:35 +0100)]
Next version will be 2.0.0
* NEWS, configure.ac: Bump version
--
This helps beta version numbering. The next version
brings major changes.
Andre Heinecke [Fri, 11 Nov 2016 16:23:13 +0000 (17:23 +0100)]
Use _WIN64 instead of WIN64 to detect arch
* common_indep.h, config-dialog.c, olflange-dlgs.cpp: Use
_WIN64 instead of WIN64.
--
Somehow WIN64 is no longer defined by my mingw like
it was before. _WIN64 is more correct.
Andre Heinecke [Fri, 11 Nov 2016 15:51:13 +0000 (16:51 +0100)]
Add automake test-driver
* build-aux/test-driver: New. From debian jessie.
--
Automake told me to do this.
Andre Heinecke [Fri, 11 Nov 2016 15:01:18 +0000 (16:01 +0100)]
Add property change warning
* src/mailitem-events.cpp (EVENT_SINK_INVOKE): Warn on property
change done by the user.
--
See the comment in the PropertyChange event why we can't handle
this.
Andre Heinecke [Fri, 11 Nov 2016 15:00:34 +0000 (16:00 +0100)]
Add helper method to get active window handle
* src/oomhelp.cpp, src/oomhelp.h (get_active_hwnd): New get the
handle of the active window.
Andre Heinecke [Fri, 11 Nov 2016 14:14:07 +0000 (15:14 +0100)]
Clean up some debug output
* src/ribbon-callbacks.cpp (get_mail_from_control): Don't
print the Subject
Andre Heinecke [Fri, 11 Nov 2016 14:11:56 +0000 (15:11 +0100)]
Remove accidentally commited AddRef experiment
* src/mailitem-events.cpp (EVENT_SINK_INVOKE): Do not add
another ref on read.
--
This was part of an experiment if the additional ref prevented
an unload.
Andre Heinecke [Fri, 11 Nov 2016 14:07:30 +0000 (15:07 +0100)]
Fix WM_CLOSE handling
* src/windowmessages.h (add_explorer, remove_explorer): Use LPDISPATCH
* src/windowmessages.cpp (add_explorer, remove_explorer): Update
accordingly.
(gpgol_hook): Use FindWindowEx to find all explorer windows.
* src/gpgoladdin.cpp (install_explorer_sinks): Register explorer
dispatch.
* src/explorer-events.cpp (EVENT_SINK_INVOKE): Remove explorer
on close.
--
At least with Outlook 2016 casting to IOlewindow and using
GetWindow did not work anymore. The returned handle was always 1.
FindWindowEx should work reliably.
Andre Heinecke [Fri, 11 Nov 2016 14:05:16 +0000 (15:05 +0100)]
Fix UI Invalidation after selection change
* src/explorer-events.cpp (EVENT_SINK_INVOKE): Invalidate again
on selection change.
(invalidate_ui): Delay invalidation.
--
We sleep before the invalidation to give outlook a chance to
actually read the mail properly after the selection is changed
before we invalidate the ui. This fixes some races after selection
change.
Andre Heinecke [Fri, 11 Nov 2016 14:01:51 +0000 (15:01 +0100)]
Ensure uuid's are always logged
* src/mail.cpp (Mail::set_uuid): Log uuid changes.
Andre Heinecke [Fri, 11 Nov 2016 13:58:56 +0000 (14:58 +0100)]
Fix sigstate code for multiple signatures
* src/mail.cpp (Mail::update_sigstate): Fix signature selection code.
--
Previously the first signature was selected always even if this
signature did not have the uid belonging to the sender. This
might be considered a security problem but was thankfully not
released yet.
Thanks to Daniel Vrátil <dvratil@kdab.com> for seeing this issue.
Andre Heinecke [Fri, 11 Nov 2016 13:58:23 +0000 (14:58 +0100)]
Set uuid again in close
* src/mail.cpp (Mail::close): Set uuid again.
--
This fixes the decrypt again code.
Andre Heinecke [Fri, 11 Nov 2016 13:56:53 +0000 (14:56 +0100)]
Remove old error message template
* src/mail.cpp (HTML_TEMPLATE): Remove.
(Mail::wipe): Just empty out body.
--
This should no longer be needed. Only if close errors out
is wipe actually called.
Andre Heinecke [Tue, 8 Nov 2016 17:13:35 +0000 (18:13 +0100)]
Only decrypt / verify one mail at once
* src/mail.cpp (do_parsing): Lock parsing
--
This fixes some threading problems when there were very
quick mail switches but it also makes the code more stable
and improves performance as it filters out parser calls
for mails that were already unloaded.
Andre Heinecke [Mon, 7 Nov 2016 17:14:05 +0000 (18:14 +0100)]
Only close on WM_CLOSE of explorers
* src/explorer-events.cpp (EVENT_SINK_INVOKE): Track explorers.
* src/gpgoladdin.cpp (install_explorer_sinks): Install sinks.
* src/windowmessages.cpp (add_explorer_window)
(remove_explorer_window): New.
(gpgol_hook): Only react to explorers.
--
This prevents mails from beeing closed when they are opened
in a reader. Still todo is to close only the mails from the
selection of the explorer that is currently closing and
only to close all mails if it is the last explorer.
Andre Heinecke [Mon, 7 Nov 2016 14:28:53 +0000 (15:28 +0100)]
Remove the need to revert mails
* src/application-events.cpp (EVENT_SINK_INVOKE): Remove comment.
* src/gpgoladdin.cpp (GpgolAddin::OnDisconnection): Close instead
revert.
(GpgolAddin::OnStartupComplete): Create Window message hook.
* src/mail.cpp (Mail::close_all_mails): New.
* src/mail.h: Update accordingly.
* src/mailitem-events.cpp (request_close): New.
src/mailitem-events.cpp (EVENT_SINK_INVOKE): Update event
handling to new logic. See comments.
* src/windowmessages.cpp (gpgol_hook): New.
(create_message_hook): New. Registers gpgol_hook.
src/windowmessages.h: Update accordingly.
--
This is basically the yewel of the nomapi branch. Without
persistent changes in MAPI we can just close the Mails with
discard changes set to true to "revert" our mails. This
removes the need for a revert and Outlook won't create new
mails containing our reverted mails.
There should be no more need for revert at all. It's left
in as an additional fallback in case something fails.
Andre Heinecke [Mon, 7 Nov 2016 14:27:14 +0000 (15:27 +0100)]
Disable ui invalidation in explorers for now
* src/explorer-events.cpp, src/explorers-events.cpp
(EVENT_SINK_INVOKE): Disable ui invalidation.
--
This triggers a bug causing duplicated mailitems so
disabled for now.
Andre Heinecke [Mon, 7 Nov 2016 13:50:10 +0000 (14:50 +0100)]
Always discard changes on close for now
* src/mail.cpp, src/mail.h (Mail::close): Remove save changes
parameter.
--
We need to figure out if we want to save after disarding changes
by ourself depending on property changes.
Andre Heinecke [Mon, 7 Nov 2016 13:47:38 +0000 (14:47 +0100)]
Add request_close windowmessage
* src/windowmessage.h (REQUEST_CLOSE): Declare.
* src/windowmessages.cpp (gpgol_window_proc): Handle REQUEST_CLOSE.
* src/ribbon-callbacks.cpp (get_mail_from_control): Update to new
get_unique_id signature.
Andre Heinecke [Mon, 7 Nov 2016 11:59:50 +0000 (12:59 +0100)]
Use msgclass to determine if a mail is crypto
* src/mail.cpp (is_crypto_mail): Use messageclass instead
of processed.
* src/mail.h: Update accordingly.
--
This makes the function usable after prerproceessing and
not only after decryption.
Andre Heinecke [Mon, 7 Nov 2016 11:57:05 +0000 (12:57 +0100)]
Add IID and install functions for explorer sinks
* src/eventsinks.h (install_ExplorerEvents_sink)
(install_ExplorersEvents_sink): Declare.
* src/oomhelp.h: Add missing uuids.
Andre Heinecke [Mon, 7 Nov 2016 11:53:07 +0000 (12:53 +0100)]
Use shared_ptr for parser object
* src/mail.cpp (m_parser): Change to shared_ptr
(Mail::parsing_done): Check if parser already deleted.
* src/mail.h: Update accordingly.
--
The state in which this happens should no longer be
reached due to the previous commit that prevents
duplication in the uuid map. Still better handle
it.
Andre Heinecke [Mon, 7 Nov 2016 11:50:13 +0000 (12:50 +0100)]
Check for duplicates in mail map
* src/mail.cpp (Mail::set_uuid): Check for duplicates in mail
map and handle them.
--
Sometimes we have the troubling state that multiple
item load events occur for the same mail,
as identified by uuid. This is bad but now at least
we have some handling and report it as an error
otherwise it could lead to cases where a parser
returned for a wrong mail
According to documentation this should not
happen as this means that multiple ItemLoad
events occured for the same mailobject without
unload / destruction of the mail.
But it happens. If you invalidate the UI
in the selection change event Outlook loads a
new mailobject for the mail. Might happen in
other surprising cases. We replace in that
case as experiments have shown that the last
mailobject is the one that is visible.
Andre Heinecke [Mon, 7 Nov 2016 11:40:43 +0000 (12:40 +0100)]
Fix build by adding new event handlers to Makefile
* src/Makefile.am (gpgol_SOURCES): Add new files.
--
Forgotten in previous commit.
Andre Heinecke [Thu, 3 Nov 2016 13:46:57 +0000 (14:46 +0100)]
Add explorer and explorers event handler
* explorer-events.cpp: New. Invalidate ui on selection change.
* explorers-events.cpp: New. Install event handler for new explorers.
* gpgoladdin.cpp (GpgolAddin::~GpgolAddin): Release explorers event
handler.
(install_explorer_sinks): Install explorers and explorer event
handler.
(GpgolAddin::OnStartupComplete): call install_explorer_sinks
--
This fixes the problem that without another read by outlook
the state of the ui might not have matched to the signature
state, which is critical as it may have shown the wrong sigstate.
Andre Heinecke [Thu, 3 Nov 2016 12:39:54 +0000 (13:39 +0100)]
Add mapi helpers for uuid retrieval
* src/mapihelp.cpp, src/mapihelp.h: (get_gpgoluid_tag)
(mapi_get_uid): New.
--
Used in some experiments regarding UUID structures.
Andre Heinecke [Thu, 3 Nov 2016 09:50:49 +0000 (10:50 +0100)]
Allow to reset uuid
* src/mail.cpp (Mail::set_uuid): Set uuid even if the mail
object already tracks a uuid.
* src/oomhelp.cpp (get_unique_id): Extend with uuid param.
* src/oomhelp.h: Update accordingly
--
This is important if we close with discard changes to set our
uuid again after the close.
Andre Heinecke [Thu, 3 Nov 2016 09:48:52 +0000 (10:48 +0100)]
Add close function to Mails
* src/mail.cpp (Mail::close): New, close a mail.
--
Closing a Mail with discard changes prevents the Save Changes
popup without the requirement for a revert.
Andre Heinecke [Thu, 3 Nov 2016 09:47:49 +0000 (10:47 +0100)]
Add extra debug output for mail destruction
* src/mail.cpp (Mail::~Mail): Print uuid in dtor
Andre Heinecke [Wed, 2 Nov 2016 10:34:16 +0000 (11:34 +0100)]
Disable revert all mails on quit
* src/application-events.cpp (EVENT_SINK_INVOKE): Disable
revert_all_mails.
--
Reverting all mails in quit brings outlook into a buggy state
in that it syncs the mail endlessly after the next start.