8 days agoPost release version bump master
Andre Heinecke [Fri, 12 Jan 2018 10:11:25 +0000 (11:11 +0100)]
Post release version bump

* po: Auto update.

8 days agoUpdate NEWS gpgol-2.0.6
Andre Heinecke [Fri, 12 Jan 2018 09:50:39 +0000 (10:50 +0100)]
Update NEWS


8 days agoFix multipart signed mails
Andre Heinecke [Fri, 12 Jan 2018 09:37:20 +0000 (10:37 +0100)]
Fix multipart signed mails

* src/mimemaker.cpp (add_body_and_attachments): Add extra line for
multipart/related and multipart/alternative.

Outlook adds that line when the message is constructed. If that
line is not part of our hashed message we will create an invalid

GnuPG-Bug-Id: T3736

8 days agoAdd cmt to clarify base / non base msg usage
Andre Heinecke [Thu, 11 Jan 2018 15:53:01 +0000 (16:53 +0100)]
Add cmt to clarify base / non base msg usage


8 days agoAdd special sauce for Outlook S/MIME code interact
Andre Heinecke [Thu, 11 Jan 2018 15:40:31 +0000 (16:40 +0100)]
Add special sauce for Outlook S/MIME code interact

* src/mailitem-events.cpp (EVENT_SINK_INVOKE): Check if after
encryption msgclass is not gpgol on MAPI Message and activate
Hack if otherwise.
* src/windowmessage.cpp (delayed_close, CLOSE): New.
* src/windowmessage.h: Update Accordingly.

If somehow S/MIME is involved in Outlook, even if the S/MIME sign
button is just toggled and untoggled, Outlook changes behavior.
When that happened Send would send the plain text mail instead
of the encrypted mail.

Now this here is very much experimental programming:
 When the S/MIME Code is somehow involved the Message in MAPI
 (not the base message) is not correctly updated and shows the
 original IPM.Note message class. We detect that now.
 If that happens we use super low level MAPI to submit our
 constructed base message and then cancel the send / close the

GnuPG-Bug-Id: T3656

8 days agoRevert increased verbosity for T3656
Andre Heinecke [Thu, 11 Jan 2018 13:25:33 +0000 (14:25 +0100)]
Revert increased verbosity for T3656

The bug is now reproducable. It depends on Outlooks S/MIME settings.

8 days agoFix w64 build
Andre Heinecke [Thu, 11 Jan 2018 12:44:26 +0000 (13:44 +0100)]
Fix w64 build

* src/mimemaker.cpp (sink_std_write): Fix format for x64

8 days agoIncrease Verbosity for issue3656
Andre Heinecke [Thu, 11 Jan 2018 12:30:28 +0000 (13:30 +0100)]
Increase Verbosity for issue3656

This turns up logging around the encryption. As this puts
the full body of an encrypted mail in the debug log it should
not be part of a release.

GnuPG-Bug-Id: T3656

8 days agoUpdate NEWS
Andre Heinecke [Thu, 11 Jan 2018 12:30:17 +0000 (13:30 +0100)]
Update NEWS


9 days agoChange PGP/Inline behavior
Andre Heinecke [Wed, 10 Jan 2018 11:32:16 +0000 (12:32 +0100)]
Change PGP/Inline behavior

* src/mail.cpp (Mail::append_to_inline_body): New.
(Mail::inline_body_to_body): Put cached body into oom body.
* src/mail.h: Update accordingly.
* src/mailitem-events.cpp (EVENT_SINK_INVOKE): Call inline_body_to_body.
* src/mimemaker.cpp (sink_string_write): New.
(finalize_message): Don't change message class for inline.
(create_top_encryption_header): No MIME header for inline.
(mime_encrypt): Use sink_string_write if inline.

Instead of our nice trick to do the S/MIME to MIME conversion
with a text/plain part we now update the body. This is because
Exchange Online did not like our trick. The new code should
be a bit more robust.

And yes caching stuff in the mail object is my hammer.

GnuPG-Bug-Id: T3662

10 days agoCache recipients trough oom and add fallbacks
Andre Heinecke [Tue, 9 Jan 2018 15:12:55 +0000 (16:12 +0100)]
Cache recipients trough oom and add fallbacks

* src/mail.cpp (Mail::update_oom_data): Also cache recipients
from oom.
(Mail::Mail): Initialize cached recipients.
(Mail::~Mail): Free cached recipients.
(Mail::take_cached_recipients): New.
* src/mail.h: Update accordingly.
* src/message.cpp (get_recipients): Improve logging.
(sign_encrypt): Use cached recipients.
* src/oomhelp.cpp (get_oom_object): Tune down error.
(get_recipient_addr_fallbacks): New.
(get_oom_recipients): Improve with more fallbacks.
* src/oomhelp.h (PR_EMS_AB_PROXY_ADDRESSES_DASL): Define.

This is a blind fix as I can't reproduce scenarios where
this is necessary. Probably with exchange address books etc.
Adding more fallbacks should not hurt the current uses
where it would stop after the first lookup is successful.

GnuPG-Bug-Id: T3616

12 days agoFix return type for mails with override msgcls
Andre Heinecke [Mon, 8 Jan 2018 10:21:29 +0000 (11:21 +0100)]
Fix return type for mails with override msgcls

* src/mapihelp.cpp (mapi_change_message_class): Improve logging
in override case.
(mapi_change_message_class): Ensure r_type is set correctly.

This fixes some cases where the message class was already set.
Apparently this happens on Exchange / Exchange Online as I
was only able to reproduce the problem there. It might happen
in other set ups where the server already stores our GpgOL
message class.

GnuPG-Bug-Id: T3537

12 days agoImprove some debug outputs
Andre Heinecke [Mon, 8 Jan 2018 10:19:38 +0000 (11:19 +0100)]
Improve some debug outputs

* src/mail.cpp(Mail::pre_process_message): Log item ptr.
(Mail::decrypt_verify): Log on bailout for non crypto mail.
* src/mailitem-events.cpp (EVENT_SINK_INVOKE(MailItemEvents)):
Log on bailout for non crypto mail.

12 days agoFix memleak in mail object
Andre Heinecke [Mon, 8 Jan 2018 08:27:57 +0000 (09:27 +0100)]
Fix memleak in mail object

* src/mail.cpp (Mail::~Mail): Free cached body information.

5 weeks agoTake plain body from OOM and not MAPI
Andre Heinecke [Tue, 12 Dec 2017 07:23:04 +0000 (08:23 +0100)]
Take plain body from OOM and not MAPI

* src/mail.cpp (Mail::Mail): Initialize cache variables.
(Mail::take_cached_html_body): Optimize as take to avoid
string copies.
(Mail::take_cached_plain_body): New.
(Mail::update_oom_data): Also cache plain body.
* src/mail.h: Update accordingly.
* src/mimemaker.cpp (add_body): Adapt to take html
body logic.
(do_mime_sign, mime_encrypt): Prefer cached body over MAPI.

At least for multipart/alternative mails the MAPI property
is not updated correctly if the mail was saved as draft.
As we know that the update_oom_data / caching logic works
nicely for the HTML body we can use a similar logic for
the plain body to avoid any MAPI weirdness.

GnuPG-Bug-Id: T3419

6 weeks agoFix g sync account warning
Andre Heinecke [Fri, 8 Dec 2017 09:21:35 +0000 (10:21 +0100)]
Fix g sync account warning

* src/mail.cpp (Mail::encrypt_sign): Handle encoding
(Mail::Mail): Initialize check correctly.

6 weeks agoAuto update po files
Andre Heinecke [Fri, 8 Dec 2017 09:21:26 +0000 (10:21 +0100)]
Auto update po files


6 weeks agoPost release version bump
Andre Heinecke [Fri, 8 Dec 2017 06:43:45 +0000 (07:43 +0100)]
Post release version bump


6 weeks agoUpdate news gpgol-2.0.5
Andre Heinecke [Fri, 8 Dec 2017 05:58:02 +0000 (06:58 +0100)]
Update news


6 weeks agoUpdate german translation
Andre Heinecke [Fri, 8 Dec 2017 05:56:25 +0000 (06:56 +0100)]
Update german translation


6 weeks agoAuto update po files
Andre Heinecke [Fri, 8 Dec 2017 05:49:55 +0000 (06:49 +0100)]
Auto update po files


6 weeks agoMinor cleanup
Andre Heinecke [Fri, 8 Dec 2017 05:49:30 +0000 (06:49 +0100)]
Minor cleanup


6 weeks agoFix minor memleaks
Andre Heinecke [Fri, 8 Dec 2017 05:48:48 +0000 (06:48 +0100)]
Fix minor memleaks

* src/mail.cpp (Mail::close_inspector): Release inspector.
(Mail::check_attachments): Don't leak DisplayName.

6 weeks agoFix handling of attachments without extension
Andre Heinecke [Fri, 8 Dec 2017 05:46:54 +0000 (06:46 +0100)]
Fix handling of attachments without extension

* src/common.c (get_tmp_outfile): Handle the case that
fileext is NULL.

This fixes a crash for attachments without a file

GnuPG-Bug-ID: T3582

6 weeks agoPost release version bump
Andre Heinecke [Tue, 5 Dec 2017 10:36:02 +0000 (11:36 +0100)]
Post release version bump


6 weeks agoUpdate NEWS for todays release gpgol-2.0.4
Andre Heinecke [Tue, 5 Dec 2017 10:33:54 +0000 (11:33 +0100)]
Update NEWS for todays release


6 weeks agoFix german localisation error
Andre Heinecke [Sat, 2 Dec 2017 14:13:05 +0000 (15:13 +0100)]
Fix german localisation error


6 weeks agoRead Headers as stream
Andre Heinecke [Sat, 2 Dec 2017 14:08:38 +0000 (15:08 +0100)]
Read Headers as stream

* src/mapihelp.cpp (mapi_get_header): New helper.
(mapi_get_message_content_type): Use it.


This fixes accessing very large headers where
MAPI might not return it as a property but
instead error out with MAPI_E_NOT_ENOUGH_MEMORY.

GnuPG-Bug-Id: 3542

6 weeks agoImprove performance of beforeRead handling
Andre Heinecke [Sat, 2 Dec 2017 14:04:35 +0000 (15:04 +0100)]
Improve performance of beforeRead handling

* src/mapihelp.cpp (string_to_type): New Helper.
(mapi_get_message_type, mapi_change_message_class): Use it.
(mapi_change_message_class): Take optional type retval.
* src/inspectors.cpp, src/session-events.cpp,
src/user-events.cpp, src/message.cpp: Udpate calls.

Looking at an improvement for T3542 i measured the
time spent in beforeRead for "non crypto" mails.
With this change, which fixes a TODO the time is
halved because way fewer MAPI calls are required.

7 weeks agoAdd warnings about unsupported G Sync actions
Andre Heinecke [Thu, 30 Nov 2017 12:59:59 +0000 (13:59 +0100)]
Add warnings about unsupported G Sync actions

* src/mail.cpp (Mail::update_oom_data): Save if account
is gsync account.
(Mail::encrypt_sign): Warn / Block actions for GSync accounts.
* src/mimemaker.cpp (count_usable_attachments): Expose so that
it can be used in Mail.

It's better to fail early and loudly instead of creating
broken mails.

GnuPG-Bug-Id: T3545

7 weeks agoFix logic error in two options
Andre Heinecke [Thu, 30 Nov 2017 12:58:57 +0000 (13:58 +0100)]
Fix logic error in two options

* src/main.c (read_options): Fix reading autoresolve and

7 weeks agoImplement basic PGP/Inline support for Encryption
Andre Heinecke [Wed, 29 Nov 2017 12:15:37 +0000 (13:15 +0100)]
Implement basic PGP/Inline support for Encryption

* src/mail.cpp (Mail::encrypt_sign): Mark down if inline is
* src/mail.h (Mail::should_inline_crypt): New.
* src/mimedataprovider.cpp (MimeDataProvider::collect_input_lines):
Handle "MIME Inline" for our own sent messages.
* src/mimemaker.cpp (finalize_message): Handle is_inline.
(create_top_encryption_header): Handle is_inline to write
text/plain header.
(mime_encrypt): Support inline if no attachments exist.

This adds a first basic inline support. If the option
is set and a PGP Message without attachments is sent
the message will be sent as PGP Inline message.
Currently only supported for "Encrypt" not Encrypt / Sign.

GnuPG-Bug-Id: T3514

7 weeks agoSupress error message if UID not found
Andre Heinecke [Wed, 29 Nov 2017 10:29:45 +0000 (11:29 +0100)]
Supress error message if UID not found

* src/oomhelp.cpp (get_pa_variant): Add an extra check
before the error.

This error message happens and is expected because the
property is sometimes not set and we use the function to
check if the property is set.

7 weeks agoFix sender fallbacks in update_oom_data
Andre Heinecke [Tue, 28 Nov 2017 15:38:59 +0000 (16:38 +0100)]
Fix sender fallbacks in update_oom_data

* src/mail.cpp (Mail::update_oom_data): Fix sender fallbacks.

This fixes problems when the OOM returns objects but the
values are unexpected / empty. In that case our fallbacks
now properly pass through.

GnuPG-Bug-Id: T3424

7 weeks agoFix possible race bug of a crash observed
Andre Heinecke [Tue, 28 Nov 2017 15:35:15 +0000 (16:35 +0100)]
Fix possible race bug of a crash observed

* src/mail.cpp (Mail::close_all_mails): Check for valididy
of mail object before closing.

I observed a deleted mail beeing closed and then it crashed.
No idea how this could happen but this saveguard might help.

7 weeks agoHandle ms-tnef classified PGP/Inline mails
Andre Heinecke [Tue, 28 Nov 2017 12:57:17 +0000 (13:57 +0100)]
Handle ms-tnef classified PGP/Inline mails

* src/mail.cpp (get_attachment_stream): Add fallback
if attachment count is zero even if we think it's ciphered.
* src/mapihelp.cpp (get_internetcharsetbody_tag): Not
getting internet charset body happens for ms-tnef. Debug only.
(get_msgcls_from_pgp_lines): Use mapi_get_body_as_stream.
(change_message_class_ipm_note): Look into application/ms-tnef.

Some mails have content type ms-tnef but PGP/Inline body.
For those mails it also does not work to access our created
MOSS attachment trough OOM. So we now handle that and use
the MAPI Body directly.

GnuPG-Bug-Id: T3419

7 weeks agoAbort attachment open early if attachment count 0
Andre Heinecke [Tue, 28 Nov 2017 12:54:29 +0000 (13:54 +0100)]
Abort attachment open early if attachment count 0

* src/mail.cpp (get_attachment): Abort earlier if
attachment count is zero.

7 weeks agoMinor spacing issue in german translation
Andre Heinecke [Tue, 28 Nov 2017 12:53:17 +0000 (13:53 +0100)]
Minor spacing issue in german translation

* po/de.po: Fix minor spacing issue.

7 weeks agoMake it compile
Andre Heinecke [Mon, 27 Nov 2017 12:58:15 +0000 (13:58 +0100)]
Make it compile

Move on. Nothing to see here. :-P

7 weeks agoAdd checks to avoid assigning NULL to std::string
Andre Heinecke [Mon, 27 Nov 2017 12:53:28 +0000 (13:53 +0100)]
Add checks to avoid assigning NULL to std::string

* src/mail.cpp (Mail::update_oom_data): Safeguard against
NULL assignment to std::string.

Not sure if this really leads to a crash but it's undefined
so it should not be done.

GnuPG-Bug-Id: T3540

7 weeks agoImprove error handling for signed only
Andre Heinecke [Mon, 27 Nov 2017 09:48:32 +0000 (10:48 +0100)]
Improve error handling for signed only

* src/mail.cpp (Mail::get_crypto_details): Add msg for
verification error.
* src/ribbon-callbacks.cpp (get_sig_stip): Get mails
details for failed verification results.

In the details we can show the error. This might help
with bug reports.

GnuPG-Bug-Id: T3538

7 weeks agoRestore body on verification error
Andre Heinecke [Mon, 27 Nov 2017 09:46:38 +0000 (10:46 +0100)]
Restore body on verification error

* src/mail.cpp (Mail::update_body): Restore body if verify
(Mail::decrypt_verify): Save original body.

If there is an error during verification we should not
"eat" the body. Mostly this will be a technical error
and as we show the result as "insecure" this should
be ok.

GnuPG-Bug-Id: T3538

8 weeks agoFix multiple selection performance
Andre Heinecke [Fri, 24 Nov 2017 13:28:53 +0000 (14:28 +0100)]
Fix multiple selection performance

* src/ribbon-callbacks.cpp (get_mail_from_control): Treat
multiselection like no mail is selected.

Experiments with OutlookSpy and debug output have shown that
the call:
    mailitem = get_oom_object (context, "Selection.Item(1)");
triggered an ItemLoad event for each mail in a selection. This
is fun when there are thousands of mails selected and can
lead to out of resources. As a workaround for this Outlook
bug we now treat multi selection as if no mail was selected
and don't obtain the first item.

GnuPG-Bug-Id: T3523
GnuPG-Bug-Id: T3433

8 weeks agoAdditional check for mail destruction before parse
Andre Heinecke [Fri, 24 Nov 2017 13:26:59 +0000 (14:26 +0100)]
Additional check for mail destruction before parse

* src/mail.cpp (do_parsing): Check if mail was deleted while
waiting for lock.

This is a performance improvement when switching very fast
through crypto mails.

8 weeks agoRemove some disabled OL 2007 compat
Andre Heinecke [Fri, 24 Nov 2017 10:03:18 +0000 (11:03 +0100)]
Remove some disabled OL 2007 compat


8 weeks agoImprove / Fix UI Invalidation
Andre Heinecke [Fri, 24 Nov 2017 08:48:21 +0000 (09:48 +0100)]
Improve / Fix UI Invalidation

* src/explorers-events.cpp (EVENT_SINK_INVOKE): Don't cancel
invalidation when preview is disabled. Call delayed_invalidate_ui.
* src/mailitem-events.cpp (EVENT_SINK_INVOKE): Use
* src/windowmessages.cpp (delayed_invalidate_ui): New.

This fixes invalidation in that it is no longer prevented
if the reading pane is not found on selection change and by
using the delay with a guard for an already happening
invalidation it should fix loops / races of many invalidations.

GnuPG-Bug-Id: T3523
GnuPG-Bug-Id: T3535

2 months agoLaunch Kleo/GPA in the background on start
Andre Heinecke [Mon, 20 Nov 2017 10:54:08 +0000 (11:54 +0100)]
Launch Kleo/GPA in the background on start

* src/engine-assuan.c (spawn_background): New.
(op_assuan_init): Create background thread to launch kleo.

This does not slowdown the startup as it happens in a different
thread but is intended to speed up the opening of the key
resolution dialog when kleopatra is not running and help to
avoid startup problems mentioned in T3401

GnuPG-Bug-Id: T3401

2 months agoPost release version bump
Andre Heinecke [Mon, 20 Nov 2017 08:16:47 +0000 (09:16 +0100)]
Post release version bump


2 months agoUpdate NEWS for todays release gpgol-2.0.3
Andre Heinecke [Mon, 20 Nov 2017 08:10:32 +0000 (09:10 +0100)]
Update NEWS for todays release


2 months agoAuto update PO files
Andre Heinecke [Mon, 20 Nov 2017 08:10:16 +0000 (09:10 +0100)]
Auto update PO files


2 months agoAdd tracing in engine-assuan for T3401
Andre Heinecke [Mon, 20 Nov 2017 08:02:44 +0000 (09:02 +0100)]
Add tracing in engine-assuan for T3401

GnuPG-Bug-Id: T3401

2 months agoBail out immediately on send if crypt not needed
Andre Heinecke [Mon, 20 Nov 2017 07:45:36 +0000 (08:45 +0100)]
Bail out immediately on send if crypt not needed

* src/mailitem-events.cpp (EVENT_SINK_INVOKE): Break early
in case mail is not encrypted.

This should increase stability when sending mails and
this fixes that the body of unencrypted mails is not
wiped *cough*

GnuPG-Bug-Id: T3511

2 months agoAdd more fallbacks and error for body wipe
Andre Heinecke [Fri, 17 Nov 2017 12:33:40 +0000 (13:33 +0100)]
Add more fallbacks and error for body wipe

* src/mail.cpp, src/mail.h (Mail::wipe): Add force parameter.
* src/mailitem-events.cpp (EVENT_SINK_INVOKE): Check for
OOM wiped body and try again to wipe it in case there is

2 months agoRevert "Add some more tracing in mail"
Andre Heinecke [Fri, 17 Nov 2017 11:41:30 +0000 (12:41 +0100)]
Revert "Add some more tracing in mail"

This reverts commit 8d5e9d19ecaf0f753b5204a70d72d2505b373048.

2 months agoClarify comment about send event
Andre Heinecke [Fri, 17 Nov 2017 11:41:16 +0000 (12:41 +0100)]
Clarify comment about send event


2 months agoUse table view reading pane for OL <= 2013
Andre Heinecke [Thu, 16 Nov 2017 11:43:38 +0000 (12:43 +0100)]
Use table view reading pane for OL <= 2013

* src/explorer-events.cpp (EVENT_SINK_INVOKE),
src/ribbon-callbacks.cpp (get_mail_from_control): Check
version to determine codepath.

The crash only appeared on Outlook 2016. Older Versions
don't have the previewPane object. So we need to have
a fallback.

2 months agoRemove deleted file from potfiles
Andre Heinecke [Thu, 16 Nov 2017 09:26:36 +0000 (10:26 +0100)]
Remove deleted file from potfiles


2 months agoPost release version bump
Andre Heinecke [Thu, 16 Nov 2017 09:19:55 +0000 (10:19 +0100)]
Post release version bump


2 months agoUpdate NEWS gpgol-2.0.2
Andre Heinecke [Thu, 16 Nov 2017 09:01:58 +0000 (10:01 +0100)]
Update NEWS


2 months agoAuto update translations
Andre Heinecke [Thu, 16 Nov 2017 09:00:31 +0000 (10:00 +0100)]
Auto update translations


2 months agoFix Outlook 2010 TabComposeTools error
Andre Heinecke [Thu, 16 Nov 2017 08:42:59 +0000 (09:42 +0100)]
Fix Outlook 2010 TabComposeTools error

* src/gpgoladdin.cpp (GetCustomUI_mime): Handle OL2010

For OL2010 we don't have an inline editor so no TabComposeTools.

GnuPG-Bug-ID: T3441

2 months agoAdd comment about ref counting in get_oom_obj
Andre Heinecke [Thu, 16 Nov 2017 08:33:46 +0000 (09:33 +0100)]
Add comment about ref counting in get_oom_obj


2 months agoUgly fix for ugly crash when pasting recipients
Andre Heinecke [Wed, 15 Nov 2017 15:14:56 +0000 (16:14 +0100)]
Ugly fix for ugly crash when pasting recipients

* src/mailitem-events.cpp (do_delayed_locate): Delay
(EVENT_SINK_INVOKE): Only trigger once per change. Invoke
delayed thread.
* src/windowmessages.cpp (gpgol_window_proc): Handle
Recipient Added signal.

This is a fix for crashes that happend if a resolved recipient
is copied and pasted.
If we then access the recipients object in the Property
Change event Outlook says no (crash). Thus we do the delay dance.

2 months agoLock key lookup map
Andre Heinecke [Wed, 15 Nov 2017 15:10:49 +0000 (16:10 +0100)]
Lock key lookup map

* src/mail.cpp (do_locate): Comment out useless message.
(Mail::locate_keys): Guard list access with lock.

Does not really fix a bug but noticed a race there when

2 months agoFix ref leak of recipients obj
Andre Heinecke [Wed, 15 Nov 2017 15:10:01 +0000 (16:10 +0100)]
Fix ref leak of recipients obj

* src/mail.cpp (get_recipients): Unref recipients obj.

2 months agoTypos and spelling in comment about last commit
Andre Heinecke [Wed, 15 Nov 2017 13:34:25 +0000 (14:34 +0100)]
Typos and spelling in comment about last commit


2 months agoWorkaround crash when accessing CurrentView
Andre Heinecke [Wed, 15 Nov 2017 13:34:25 +0000 (14:34 +0100)]
Workaround crash when accessing CurrentView

* src/explorer-events.cpp (EVENT_SINK_INVOKE),
src/ribbon-callbacks.cpp (get_mail_from_control): Use
preview pane instead.

Somehow latest Outlook 2016 crashes when accessing the current view
of the Explorer. This is even reproducible with
GpgOL disabled and only with Outlook Spy active. If you select
the explorer of an resource and then access
the CurrentView and close the CurrentView again in Outlook Spy
outlook crashes.

GnuPG-Bug-Id: T3484

2 months agoReturn correct charset for html
Andre Heinecke [Wed, 15 Nov 2017 13:05:28 +0000 (14:05 +0100)]
Return correct charset for html

* src/parsecontroller.cpp (get_html_charset): Do it.

No comment.

GnuPG-Bug-Id: T3455

2 months agoFix reversion for S/MIME mails if S/MIME disabled
Andre Heinecke [Fri, 10 Nov 2017 16:56:57 +0000 (17:56 +0100)]
Fix reversion for S/MIME mails if S/MIME disabled

* src/mailitem-events.cpp (EVENT_SINK_INVOKE): Revert
again if S/MIME is disabled but we parsed the mail.

While reversion is no longer neccessary for crypto mails
to hide the plaintext we still might need it to change
the message class back. And wiping the body etc. is also
a good idea when we "leave a mail alone"

GnuPG-Bug-ID: T3494

2 months agoFix handling of "own" S/MIME Mails
Andre Heinecke [Fri, 10 Nov 2017 16:52:01 +0000 (17:52 +0100)]
Fix handling of "own" S/MIME Mails

* src/mimedataprovider.cpp (MimeDataProvider::collect_data):
Expect headers if the first line of the data starts with MIME-Version.


This fixes the problem that S/MIME Mails in the sent folder
are not handled.

The problem is that for received S/MIME Mails GpgOL sees
the S/MIME part as the original structure and just needs
to copy this part to gpgol.
But for our own mails in the sent mails folder we get our
MIME Structure that we created for the MAPI to MIME conversion
including headers.

To avoid a big mess with another content type we check the
first bytes of the data we parse if they say "MIME-Version"
in that case we expect MIME headers.

GnuPG-Bug-ID: T3442

2 months agoAdd some more tracing in mail
Andre Heinecke [Fri, 10 Nov 2017 16:51:18 +0000 (17:51 +0100)]
Add some more tracing in mail

* src/mail.cpp (Mail::update_body): Add some traces.

Possibly something fishy in here where we crash.

2 months agoFix build example by adding --enable-static
Andre Heinecke [Fri, 10 Nov 2017 16:48:26 +0000 (17:48 +0100)]
Fix build example by adding --enable-static

Dependencies are needed as static libs so this must
be enabled.

2 months agoRemove obsolete info from README
Andre Heinecke [Fri, 10 Nov 2017 16:47:04 +0000 (17:47 +0100)]
Remove obsolete info from README


2 months agoImprove debug output in parsecontroller
Andre Heinecke [Fri, 10 Nov 2017 16:09:53 +0000 (17:09 +0100)]
Improve debug output in parsecontroller

* src/parsecontroller.cpp: Debug detected type.

3 months agoUpdate Portugese translations
Jochen Saalfeld [Mon, 16 Oct 2017 13:32:49 +0000 (15:32 +0200)]
Update Portugese translations

* po/pt.po: Update

Translation provided by Marco A.G. Pinto.

4 months agoPost release updates
Andre Heinecke [Thu, 14 Sep 2017 14:50:42 +0000 (16:50 +0200)]
Post release updates


4 months 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.

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


4 months 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


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

* po: Auto update.

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

* po/de.po: Update translation.

4 months 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

4 months 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

4 months 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.

4 months 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.

4 months 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

4 months 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.

4 months 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...

4 months 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

4 months 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.

4 months 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

Hey here is your password encrypted:

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

4 months 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.

4 months 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.

4 months 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.

4 months 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.

4 months 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.

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


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


5 months 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

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

* po/de.po: Translate.