gpgol.git
2 years agoFix regression for multipart/signed mails gpgol-2.0.1
Andre Heinecke [Thu, 14 Sep 2017 14:41:35 +0000 (16:41 +0200)]
Fix regression for multipart/signed mails

* src/mapihelp.cpp (mapi_change_message_class): Call
change_message_class_ipm_note_smime_multipartsigned even
if S/MIME is disabled.

--
This function actually checks if a message with the class
IPM.Note.SMIME.MultipartSigned is actually a PGP / MIME mail
so it needs to be called even if S/MIME is disabled.

This fixes multipart signed mail handling.

2 years agoPost release updates
Andre Heinecke [Tue, 12 Sep 2017 11:40:36 +0000 (13:40 +0200)]
Post release updates

--

2 years agoRelease GpgOL 2.2.0 gpgol-2.0.0
Andre Heinecke [Tue, 12 Sep 2017 11:28:38 +0000 (13:28 +0200)]
Release GpgOL 2.2.0

--

2 years agoAuto: Update translations
Andre Heinecke [Tue, 12 Sep 2017 11:26:16 +0000 (13:26 +0200)]
Auto: Update translations

* po: Auto update.

2 years agoUpdate german translation
Andre Heinecke [Tue, 12 Sep 2017 11:25:46 +0000 (13:25 +0200)]
Update german translation

* po/de.po: Update translation.

2 years agoIncrease Options dialog width
Andre Heinecke [Tue, 12 Sep 2017 09:48:01 +0000 (11:48 +0200)]
Increase Options dialog width

* src/dialogs.rc (IDD_ADDIN_OPTIONS): Increase width by 20px

2 years agoFixing typo and consistency in addin-options dialogue
Jochen Saalfeld [Mon, 4 Sep 2017 09:24:26 +0000 (11:24 +0200)]
Fixing typo and consistency in addin-options dialogue

--
The typo and inconsistency was reported via
https://wald.intevation.org/forum/message.php?msg_id=5100

2 years agoUpdate Portugese translations
Jochen Saalfeld [Mon, 28 Aug 2017 11:17:29 +0000 (13:17 +0200)]
Update Portugese translations

* po/pt.po: Update

--
Translation provided by Marco A.G. Pinto.

2 years agoOnly do debug output if enableDebug is set
Andre Heinecke [Fri, 25 Aug 2017 11:51:09 +0000 (13:51 +0200)]
Only do debug output if enableDebug is set

* src/common_indep.c (do_log): Abort if enable_debug is
not set.

--
This is more in line with what users expect.

2 years agoDelete Body MAPI Props after MIME creation
Andre Heinecke [Fri, 25 Aug 2017 11:12:06 +0000 (13:12 +0200)]
Delete Body MAPI Props after MIME creation

* src/mimemaker.cpp (finalize_message): Delete Body Props.

--

Somehow this is now required. For outgoing mails over SMTP
the body is removed when the mime structure of our mime attachment
is used. But for exchange <> exchange or in the sent mail
folder this no longer happens. Causing a plain text leak.

We now explicitly delete the MAPI Body after our attachment
is created.

GnuPG-Bug-Id: T3369

2 years agoAdd more debug output during parsing
Andre Heinecke [Fri, 25 Aug 2017 09:10:02 +0000 (11:10 +0200)]
Add more debug output during parsing

* src/mail.cpp (Mail::decrypt_verify): Put out parser + subject.
* src/parsecontroller.cpp (ParseController::parse): Add more debug.

--
This should show it better where we hand of control to gpgme / gnupg.

2 years agoFix compliance mode check
Andre Heinecke [Fri, 25 Aug 2017 08:53:59 +0000 (10:53 +0200)]
Fix compliance mode check

* src/mail.cpp (in_de_vs_mode): Fix logic.

--
Yeah it shows that I coded too little C in the last year...

2 years agoFix handling of inline PGP Mails with attachment
Andre Heinecke [Fri, 25 Aug 2017 08:22:08 +0000 (10:22 +0200)]
Fix handling of inline PGP Mails with attachment

* src/mapihelp.cpp (mapi_mark_or_create_moss_attach): Repeat check
after attachment creation.

--
The created MOSS attachment does not neccessary has position 1
it might change depending on the attachment count so the wrong
attachment may be picked up. Repeat the check for our newly
created attachment in that case.

GnuPG-Bug-Id: T3365

2 years agoFix encoding error for unsigned / unencrypted
Andre Heinecke [Mon, 21 Aug 2017 11:31:50 +0000 (13:31 +0200)]
Fix encoding error for unsigned / unencrypted

* src/ribbon-callbacks.cpp (get_sig_stip): Use utf8-gettext.

2 years agoBe more relaxed if something is before PGP Marker
Andre Heinecke [Mon, 21 Aug 2017 11:21:15 +0000 (13:21 +0200)]
Be more relaxed if something is before PGP Marker

* src/mapihelp.cpp (get_msgcls_from_pgp_lines): Remove abort
statement for text before message.

--
This might cause problems in case somone does something
like:

Hey here is your password encrypted:
-----BEGIN PGP MESSAGE-----

But meh. It's more robutst this way in case we have an
MTA that modifies the body.

2 years agoAccept more inline PGP Messages
Andre Heinecke [Mon, 21 Aug 2017 11:20:05 +0000 (13:20 +0200)]
Accept more inline PGP Messages

* src/mapihelp.cpp (change_message_class_ipm_note): Accept
html only and multipart/related to check for pgp lines.

2 years agoAdd hack to replace doubled linefeeds
Andre Heinecke [Mon, 21 Aug 2017 11:04:55 +0000 (13:04 +0200)]
Add hack to replace doubled linefeeds

* src/mail.cpp (Mail::update_body): Replace doubled linefeeds before
a newline.
(find_and_replace): New helper.

2 years agoImprove formatting if VS-NFD is active
Andre Heinecke [Mon, 21 Aug 2017 10:05:58 +0000 (12:05 +0200)]
Improve formatting if VS-NFD is active

* src/mail.cpp (Mail::get_crypto_details): Add a linefeed.

2 years agoFix message for unsigned mails
Andre Heinecke [Mon, 21 Aug 2017 10:05:24 +0000 (12:05 +0200)]
Fix message for unsigned mails

* src/mail.cpp (Mail::get_crypto_details): Return earlier.

2 years agoHandle Symmetric encryption
Andre Heinecke [Mon, 21 Aug 2017 10:04:22 +0000 (12:04 +0200)]
Handle Symmetric encryption

* src/mail.cpp (Mail::parsing_done, Mail::update_categories)
(Mail::is_encrypted): Use decryptResult.isNull instead of numRecp.

--
For symmetric encryption we have no recipients.

2 years agoUpdate German translation
Andre Heinecke [Thu, 27 Jul 2017 07:19:26 +0000 (09:19 +0200)]
Update German translation

--

2 years agoAuto update po files
Andre Heinecke [Thu, 27 Jul 2017 07:17:46 +0000 (09:17 +0200)]
Auto update po files

--

2 years agoChange VS to VS-NfD for deVS stuff
Andre Heinecke [Thu, 27 Jul 2017 07:16:49 +0000 (09:16 +0200)]
Change VS to VS-NfD for deVS stuff

* src/mail.cpp (Mail::get_crypto_details): Change VS to VS-NfD

2 years agoDo German translation
Andre Heinecke [Tue, 25 Jul 2017 12:45:53 +0000 (14:45 +0200)]
Do German translation

* po/de.po: Translate.

2 years agoAuto: Update po files
Andre Heinecke [Tue, 25 Jul 2017 12:39:12 +0000 (14:39 +0200)]
Auto: Update po files

--

2 years agoEnsure that the correct window is enabled again
Andre Heinecke [Tue, 25 Jul 2017 12:04:28 +0000 (14:04 +0200)]
Ensure that the correct window is enabled again

* src/mail.cpp (encrypt_sign): Store window handle.

--
This fixes a rare case where the active window changes during
encrypt and the wrong window would be enabled again. This would
result in an unsresponsive Outlook.

2 years agoAdd handling for de-vs compliant results
Andre Heinecke [Mon, 10 Jul 2017 15:24:07 +0000 (17:24 +0200)]
Add handling for de-vs compliant results

* configure.ac: Bump required GPGME version to 1.9
* src/mail.cpp (in_de_vs_mode): New helper.
(Mail::get_crypto_details): Add texts about de-vs states.
(Mail::get_signature_level): Only return 3 or 4 in vs-mode if
the signature was actually de-vs compliant.

2 years agoAdd deprecation warning for OL2003/2007
Andre Heinecke [Sun, 14 May 2017 10:55:48 +0000 (12:55 +0200)]
Add deprecation warning for OL2003/2007

* src/common_indep.h (opt.deprecation_shown): New option.
* src/main.c (write_options, read_options): Handle new option.
* src/olflange.cpp: Show warning for old versions.

--
GnuPG-Bug-Id: T3153

2 years agoMake it possible to register locally as user
Andre Heinecke [Sun, 14 May 2017 08:54:40 +0000 (10:54 +0200)]
Make it possible to register locally as user

* src/olflange.cpp (DllRegisterServer): Register depending on
elevation level.

2 years agoAdd UAC elevation check
Andre Heinecke [Sun, 14 May 2017 08:53:10 +0000 (10:53 +0200)]
Add UAC elevation check

* src/common.c (is_elevated, has_high_integrity): New.
* src/common.h (is_elevated): Exposed.

2 years agoFix implicit vector include
Andre Heinecke [Mon, 8 May 2017 08:59:54 +0000 (10:59 +0200)]
Fix implicit vector include

* src/mimedataprovider.cpp: Fix build with newer stdc++ lib.

2 years agoFix misleading indentation warning
Andre Heinecke [Mon, 8 May 2017 08:12:24 +0000 (10:12 +0200)]
Fix misleading indentation warning

* src/w32-gettext.c (internal_gettext): Fix misleading indentation
warning.

2 years agoAdd missing copyright statements
Andre Heinecke [Tue, 25 Apr 2017 11:25:16 +0000 (13:25 +0200)]
Add missing copyright statements

* src/common.c,
src/common.h,
src/mimemaker.h,
src/revert.cpp: Add copyright.

--
I've modified more then 30% of theese files in 2015 and 2016
so the copyright statement should reflect that.

2 years agoUnify Copyright header indentation
Andre Heinecke [Tue, 25 Apr 2017 11:23:20 +0000 (13:23 +0200)]
Unify Copyright header indentation

--
This should help avoiding too long lines for the BSI header.

2 years agoChange copyright from Intevation to BSI
Andre Heinecke [Tue, 25 Apr 2017 11:10:17 +0000 (13:10 +0200)]
Change copyright from Intevation to BSI

* src/Makefile.am,
src/addin-options.cpp,
src/addin-options.h,
src/application-events.cpp,
src/attachment.cpp,
src/attachment.h,
src/common_indep.c,
src/common_indep.h,
src/eventsink.h,
src/eventsinks.h,
src/exechelp.c,
src/exechelp.h,
src/explorer-events.cpp,
src/explorers-events.cpp,
src/gpgoladdin.cpp,
src/gpgoladdin.h,
src/gpgolstr.cpp,
src/gpgolstr.h,
src/icons/Makefile.am,
src/mail.cpp,
src/mail.h,
src/mailitem-events.cpp,
src/mimedataprovider.cpp,
src/mimedataprovider.h,
src/mimemaker.cpp,
src/mlang-charset.cpp,
src/mlang-charset.h,
src/mymapi.h,
src/oomhelp.cpp,
src/oomhelp.h,
src/parsecontroller.cpp,
src/parsecontroller.h,
src/rfc2047parse.c,
src/rfc2047parse.h,
src/ribbon-callbacks.cpp,
src/ribbon-callbacks.h,
src/windowmessages.cpp,
src/windowmessages.h,
tests/Makefile.am,
tests/run-parser.cpp,
tests/t-parser.cpp: Change copyright to BSI.

--
This should make it more transparent who the copyright holder
actually is as most work since 2015 was done under development
contracts.

2 years agoSet the sender on verify / decrypt
Andre Heinecke [Thu, 23 Mar 2017 10:33:52 +0000 (11:33 +0100)]
Set the sender on verify / decrypt

* src/mail.cpp (Mail::decrypt_verify): Set sender on parser.
* src/parsecontroller.cpp (ParseController::setSender): Add API

--
This allows gnupg to use locate-key to locate a key not published
on keyserver and also enables proper tofu handling.

2 years agoAdd locate-keys option again
Andre Heinecke [Fri, 3 Mar 2017 14:41:18 +0000 (15:41 +0100)]
Add locate-keys option again

* src/addin-options.cpp: Uncomment autoresolve.
* src/dialogs.rc: Update accordingly.

--
To properly work this still requires auto-key-locate to
be configured in the gpg.conf

2 years agoImprove german translation
Andre Heinecke [Fri, 3 Mar 2017 14:14:56 +0000 (15:14 +0100)]
Improve german translation

--

2 years agoAssign maintainer
Werner Koch [Tue, 7 Feb 2017 14:41:16 +0000 (15:41 +0100)]
Assign maintainer

--

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agoUpdate translations and add german translation
Andre Heinecke [Tue, 17 Jan 2017 10:55:55 +0000 (11:55 +0100)]
Update translations and add german translation

* po/de.po: Translate
* po/fr.po, po/pt.po, po/sv.po, po/zh_CN.po, po/zh_TW.po: Auto update.

2 years agoMinor string improvements
Andre Heinecke [Tue, 17 Jan 2017 10:55:45 +0000 (11:55 +0100)]
Minor string improvements

--

2 years agoProgramatically resize window after category set
Andre Heinecke [Mon, 16 Jan 2017 14:52:37 +0000 (15:52 +0100)]
Programatically resize window after category set

* src/mail.cpp (resize_active_window): New. Resize window by 1px
and back.
(Mail::update_categories): Use it.

--
This fixes a display issue when categories are updated, mostly..

2 years agoHandle non trustworthy or unknown CA better
Andre Heinecke [Mon, 16 Jan 2017 14:33:54 +0000 (15:33 +0100)]
Handle non trustworthy or unknown CA better

* src/mail.cpp (Mail::get_crypto_details): Add handling for
unknown validity for S/MIME

2 years agoAdd option to disable crypt reply selection
Andre Heinecke [Fri, 13 Jan 2017 16:42:19 +0000 (17:42 +0100)]
Add option to disable crypt reply selection

* src/addin-options.cpp: Update accordingly.
* src/dialogs.h, src/dialogs.rc: Add new option.
* src/mailitem-events.cpp (EVENT_SINK_INVOKE): Handle option.
* src/main.c (read_options, write_options): Handle new option.

--
There are some usecases e.g. when using an encryption gateway
where choosing the reply crypto state based on the original
message might not be welcome. So make it optional.

2 years agoImprove decryption failed errors
Andre Heinecke [Fri, 13 Jan 2017 16:23:38 +0000 (17:23 +0100)]
Improve decryption failed errors

* src/parsecontroller.cpp (format_recipients): Add names to
known recipients and add the GPGME Error.

--
This would be much nicer if gnupg would return decent errors
e.g. if a user canceled the pinentry. Now we mostly have
"Decryption Failed: Decryption Failed" Super!

2 years agoDisable explorer sigstatus icon if preview off
Andre Heinecke [Fri, 13 Jan 2017 16:22:25 +0000 (17:22 +0100)]
Disable explorer sigstatus icon if preview off

* src/ribbon-callbacks.cpp (get_mail_from_control): Don't show
wrong sigstatus when preview pane is disabled.

2 years agoOnly invalidate UI when mail is not crypto mail
Andre Heinecke [Fri, 13 Jan 2017 16:01:04 +0000 (17:01 +0100)]
Only invalidate UI when mail is not crypto mail

* src/application-events.cpp (EVENT_SINK_INVOKE): Don't
invalidate on every load.
* src/mailitem-events.cpp (EVENT_SINK_INVOKE): Invalidate on
Read.

--
For crypto mails the invalidation will be done after the
mail has been processed. This further reduces uneccesary invalidations.

2 years agoReduce UI invalidations
Andre Heinecke [Fri, 13 Jan 2017 16:00:10 +0000 (17:00 +0100)]
Reduce UI invalidations

* src/explorer-events.cpp (EVENT_SINK_INVOKE): Only invalidate
if the current explorer has a reading pane.

2 years agoUpdate po files
Andre Heinecke [Fri, 13 Jan 2017 14:35:07 +0000 (15:35 +0100)]
Update po files

--

2 years agoDo not release the central application obj
Andre Heinecke [Fri, 13 Jan 2017 11:35:25 +0000 (12:35 +0100)]
Do not release the central application obj

* src/oomhelp.cpp (get_active_hwnd): Do not release central
application Object.

--
This was a 0x8000FFFF

2 years agoHandle QueryInterface errors
Andre Heinecke [Fri, 13 Jan 2017 11:34:30 +0000 (12:34 +0100)]
Handle QueryInterface errors

* src/oomhelp.cpp (get_oom_object): Handle QueryInterface errors.

--
Not a problem in practice but noticed that an error there is
unhandled while debugging another problem.

2 years agoTreat marginal in WoT as lvel 2
Andre Heinecke [Mon, 9 Jan 2017 12:13:43 +0000 (13:13 +0100)]
Treat marginal in WoT as lvel 2

* src/mail.cpp (Mail::update_sigstate): Set marginal trust
as level 2.

--
This is what we did before and also what kleopatra did.
Marginal trust is shown as trusted certificate and "green".

Only with tofu trust model we do marginal later because
it can be automatically reached and any seen key is marginal
in tofu.

2 years agoRelease attachments object earlier
Andre Heinecke [Mon, 9 Jan 2017 12:12:42 +0000 (13:12 +0100)]
Release attachments object earlier

* src/mail.cpp (Mail::check_attachments): Release
attachments object earlier.

2 years agoDeactive Outlook Window during encryption
Andre Heinecke [Mon, 9 Jan 2017 12:11:45 +0000 (13:11 +0100)]
Deactive Outlook Window during encryption

* src/mail.cpp (encrypt_sign): Deactivate Outlook Window.

--
Not optimal but this at least allows to move the outlook
window during encryption. Kleopatra must do some work to
really become modal.

2 years agoDisable button and fix msgs if no mail selected
Andre Heinecke [Mon, 9 Jan 2017 12:09:27 +0000 (13:09 +0100)]
Disable button and fix msgs if no mail selected

* src/gpgoladdin.cpp (GpgolRibbonExtender::GetIDsOfNames)
(GpgolRibbonExtender::Invoke, GetCustomUI_MIME): Update
for get_is_details_enabled.
* src/ribbon-callbacks.cpp (get_is_details_enabled): New.
(get_mail_from_control): Extend with selection state.

2 years agoAdd logo to options dialog
Andre Heinecke [Mon, 9 Jan 2017 12:08:18 +0000 (13:08 +0100)]
Add logo to options dialog

--

2 years agoSay PGP/Inline instead of inline-pgp
Andre Heinecke [Mon, 9 Jan 2017 12:06:28 +0000 (13:06 +0100)]
Say PGP/Inline instead of inline-pgp

* src/addion-options.cpp (set_labels): Change inline-pgp to
PGP/Inline.

--
This should be more inline with PGP/MIME

2 years agoWarn if partial crypto with attachments is found
Andre Heinecke [Fri, 6 Jan 2017 14:09:07 +0000 (15:09 +0100)]
Warn if partial crypto with attachments is found

* src/mail.cpp (Mail::check_attachments): Check if
all attachments are hidden and warn otherwise.
(Mail::parsing_done): Call check_attachments.
* src/mail.h: Update accordingly.
* src/oomhelp.p: Add new DASL.

--
This is important for inline Crypto mails where Attachments
may not have been signed or encrypted.

For MIME Mails we don't have the problem as we only handle
Crypto MIME Mails if the top level mime part is a crypto part
and so everything is crypto or not.

2 years agoUpdate crypto summary and lvl2 icon
Andre Heinecke [Fri, 6 Jan 2017 12:32:21 +0000 (13:32 +0100)]
Update crypto summary and lvl2 icon

* src/dialogs.rc: Use the same icon for lvl2 and 3
* src/mail.cpp (Mail::get_crypto_summary): Change wording.
(Mail::get_crypto_summary): Fix comment.
(Mail::get_crypto_one_line): New. Move one liner also into
mail class.
(Mail::get_crypto_details): Minor wording change.
* src/mail.h: Update accordingly.
* src/ribbon-callbacks.cpp (get_sig_ttip): Use one liner funct.

--
The difference between trusted / certified highly trusted
is more confusing then just using "Level" imo. Different
security levels are a real world concept and are hopefully
understandable.

2 years agoHide WKD Option for now
Andre Heinecke [Thu, 5 Jan 2017 16:42:50 +0000 (17:42 +0100)]
Hide WKD Option for now

--
Does not work yet because of missing HTTPS support and
we would also need to change the gpg.conf setting.
Let's hope we can revert this soon.

2 years agoAllow different UUIDs for the same mail
Andre Heinecke [Thu, 5 Jan 2017 16:25:44 +0000 (17:25 +0100)]
Allow different UUIDs for the same mail

* src/oomhelp.cpp (get_unique_id): Always create one if
called with create parameter.

--
Outlook can have multiple Event Handler for the Same Mail.
E.g. If you attach a mail to another mail it becomes so decoupled
that it has it's own event handler.

We must handle that case to avoid messing up or event handling /
internal state. It is now:
One UUID for One mailitem-events handler.

2 years agoFix crash when sending plain text mails
Andre Heinecke [Thu, 5 Jan 2017 13:17:17 +0000 (14:17 +0100)]
Fix crash when sending plain text mails

* src/mimemaker.cpp (add_body): Fix boundary handling.

2 years agoFix encrypt icon name in EXTRA_DIST
Andre Heinecke [Tue, 3 Jan 2017 14:59:21 +0000 (15:59 +0100)]
Fix encrypt icon name in EXTRA_DIST

* src/icons/Makefile.am (EXTRA_DIST): Fix encrypt name.

2 years agoFix direct trust handling
Andre Heinecke [Fri, 16 Dec 2016 18:08:04 +0000 (19:08 +0100)]
Fix direct trust handling

* mail.cpp (level_4_check): Fix it.
(Mail::get_crypto_details): Use it correctly.

2 years agoImprove some strings
Andre Heinecke [Fri, 16 Dec 2016 18:06:44 +0000 (19:06 +0100)]
Improve some strings

* src/gpgoladdin.cpp (GetCustomUI_MIME): Change some strings.
* src/mail.cpp(Mail::get_crypto_summary): Use trusted instead
of trustworthy.
(Mail::get_crypto_details): Update some strings.

2 years agoUpdate icons for level 2
Andre Heinecke [Fri, 16 Dec 2016 18:05:10 +0000 (19:05 +0100)]
Update icons for level 2

* src/icons: Update level2 icon
* src/icons/level-3-enc.png: Reexport

2 years agoHandle button click for encrypted only mails
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.

2 years agoUse signed and encrypted again in tooltip
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.

2 years agoImplement direct trust handling
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.

2 years agoDon't add a dot after the tooltip
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.

2 years agoFix signature level for unencrypted mails
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.

2 years agoVarious string fixes for crypto_details
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.

2 years agoInvert category order
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.

2 years agoUse insecure instead of signed to sum up lvl1
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.

2 years agoFix sigstate setting
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 :-)

2 years agoPass key by reference to get_uid
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.

2 years agoAlways activate the GpgOL read button
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.

2 years agoHandle opaque signed inline pgp messages
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.

2 years agoFix / improve inline PGP decryption
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.

2 years agoUpdate copyright year
Andre Heinecke [Wed, 14 Dec 2016 16:03:20 +0000 (17:03 +0100)]
Update copyright year

--

2 years agoUpdate signature status display
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.

2 years agoRecuce Sign and Encrypt to single split button
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.

2 years agoImprove messagelist icon
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

2 years agoAdd new icons for sign / encrypt
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.

3 years agoFix multipart/alternative html mails
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.

3 years agoUse MAPI message for mapi_get_uid
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.

3 years agoMention srcname / func in debug of invalidation
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.

3 years agoPrepare OOM Event handler for OL 2007
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.

3 years agoAdd send_seen as member variable to Mail object
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.

3 years agoAdd fallback to create categories
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.

3 years agoAlways initialize execpinfo
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.

3 years agoPreselect sign / encrypt for reply / forward
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.

3 years agoFix Reply event ID
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...

3 years agoAdd supertip for unsigned messages
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

3 years agoFix crash when viewing unsigned mails
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 ;-)

3 years agoAdd missing icon
Andre Heinecke [Thu, 1 Dec 2016 15:57:43 +0000 (16:57 +0100)]
Add missing icon

* src/icons/emblem-success-yellow-64.png: New.

3 years agoRemove some development debugs
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.

3 years agoChange wording to better distinguish fully trusted
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.

3 years agoChange wording in signature details
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.

3 years agoLog if a uid was skipped because of no email
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.