| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
This class is not simply a factory creating instances
of crypto plugins, but it's more like a service,
providing methods on QMailMessagePart to execute
cryptographic operations like signing or signature
verification.
Change-Id: I74f65f27137e3bfe78c0f9614728eca37a031b0c
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When saving an attachment to disk, and the
destination file already exists, the previous
solution was to change the destination to
something like <random chars>.<filename>.
This patch changes this scheme to something
like <filename>(XX).<ext>.
Change-Id: Ia7055c0862660c734c70f864fc6e34e7f890b261
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, setBody() is called to set content to an
empty part. Everywhere in the code, this method is
called like an initializer, or behind a test checking
that the part is indeed MultipartNone.
But setBody() being in the public API, nothing
restrain the user to call it on a part that
already contains something, including several
subparts.
Ensure that subparts are removed when setting
a body with content. Similar to what is done in
addAttachmentsToMultipart(), unset the attachment
flag if the part we set a body to is actually a
message itself.
Change-Id: I245c5543cd85afed1176987e190900ff930efdbb
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
| |
Allow to list *.asc and *.sig (i.e. signature data)
as attachments when they are not used in a
multipart/signed context. Only hide such files
when they are used as second part in a
multipart/signed email.
Change-Id: Ie4ac7af88f30c817b10c044d986aba44e27faaf1
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Regression on the D-Bus ipc which introduced
e.g. Q_DECLARE_USER_METATYPE(QMailMessagePart) on qmailmessage.h.
On Qt6 the qRegisterMetaType() ends up instantiating
template<QDebug> QMailMessagePartPrivate::serialize(type)
which then fails to build due to not having << operator for
combination of QDebug and QMailMessagePartContainer::Location.
Compiler ends up spewing pages and pages of errors and warnings.
Not entirely following what's causing the difference to Qt5, and
how QDebug serialize() works with one class but not on other, but
suppose this explicit operator should be clean enough and avoiding
side-effects on the actually running code.
Change-Id: I4939e89d625ac06c682adbb5e31803e1ef019fd1
Reviewed-by: Damien Caliste <dcaliste@free.fr>
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduces a CalendarCancellation flag similar to the
QMailMessage::CalendarInvitation to be matched against the
QMailMessage::status() bitfield.
While the CalendarInvitation flag indicates that the message contains an
attachment of type text/calendar with "REQUEST" method, the
CalendarCancellation flag indicates that there's an attachment of type
text/calendar with "CANCEL" method type. In other words, a calendar
event cancellation.
For reference, the "CANCEL" method of the Content Type header is
described in RFC2447 (iMIP) Section 2.4 [1] in combination with the
RFC2446 (iTIP) sections 3.2 and 3.2.5 [2]
[1] https://tools.ietf.org/html/rfc2447#section-2.4
[2] https://tools.ietf.org/html/rfc2446#section-3.2
Change-Id: I1ef1d8a070e527552dae1ebe1677156bc07ba04d
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
That's actually a violation of the spec (RFC 2047):
https://tools.ietf.org/html/rfc2047#section-5
Each 'encoded-word' MUST represent an integral number of characters.
A multi-octet character may not be split across adjacent 'encoded-
word's.
but if charsets match, the data can be concatenated first and then
converted to characters. Which is what all other email clients seem
to be doing - I haven't found a single one which wouldn't handle it.
Change-Id: I5bbb785343ad60459fa6e52f5728fd796c7e5961
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
Reviewed-by: Christopher Adams <chris.adams@qinetic.com.au>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are two IPC mechanisms in QMF:
- one between the messageserver and clients
to perform actions like fetch emails,
search, etc.
- one between every mailstore instances
to notify other instances of changes
in the mail database.
QCop being discontinued, this patch switchs
to use DBus as an IPC transport layer.
The first mechanism is implemented by registering
an object on the session bus (/messageserver)
providing a service (org.qt.messageserver).
The second mechanism is implemented by
registering each client as an object to the
session bus (/mailstore/client) for the
interface org.qt.mailstore. Other clients
can then listen to updated() signal on this
interface.
DBus IPC requires to implement operator<<()
and operator>>() with QDBusArgument for the
objects that need to be transported. In all
cases, each objects are serialised up to
unitary elemental elements like int, byte
arrays, etc. Except for the QMailKeyArgument
that uses first a serialisation into a
byte array before being sent. This is due to
the recursive declaration of QMailKeyArgument
with the subKeys members, not working well
with QDBusArgument serialisation.
Change-Id: I8f10b8b00f73d4b75dad778b591159a765e9fb89
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
|
|
|
|
|
| |
Change-Id: I5eef7a1e8b566e43af9e5dcb86d00b4aa0c891dd
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some mails don't provide the Content-Disposition:
tag, providing just a Content-Type:. This commit
modifies the findAttachment strategy to treat all
such parts as attachments if they are not of text
type, or known cryptographic parts. Example of such
disposition:
-------------02837317639187261987642987516514411
Content-Type: application/pdf; name=ebillet_1_2.pdf
Content-Transfer-Encoding: base64
Change-Id: I4eecc04134dcf40d2e39b856c29a0e60531221e8
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
| |
For some reason the '/' character that is defined as a protected
character in RFC2045 for values of parameters in header
Content-Type field, was missing. As a result the protocol
parameter for multipart/signed emails was not escaped which
is faulty and was confusing some email clients.
Change-Id: Id9d43b883187317ec152eea56819822612bfe307
Reviewed-by: Christopher Adams <chris.adams@jolla.com>
|
|
|
|
|
|
|
|
|
|
| |
Any case where the address of an element is taken and stored or
used, must be changed to use QmfList instead of QList, otherwise
non-const operations will cause the reference to become invalid.
Change-Id: Ic0017cb9eddcf27b93d26adb3ea9c71682c4421b
Reviewed-by: Christopher Adams <chris.adams@jolla.com>
Reviewed-by: David Llewellyn-Jones <david.llewellyn-jones@jolla.com>
|
|
|
|
|
|
| |
Change-Id: I834645859e56a793f875892b038467c5d48291ef
Reviewed-by: Christopher Adams <chris.adams@jolla.com>
Reviewed-by: David Llewellyn-Jones <david.llewellyn-jones@jolla.com>
|
|
|
|
|
|
|
| |
Change-Id: I01f034b6099b414dce1bb59de79f6a50f61ad4de
Reviewed-by: Damien Caliste <dcaliste@free.fr>
Reviewed-by: David Llewellyn-Jones <david.llewellyn-jones@jolla.com>
Reviewed-by: Christopher Adams <chris.adams@jolla.com>
|
|
|
|
|
|
| |
Change-Id: I9db04a4f251b9e987b0e994135ee6e7ab12210cd
Reviewed-by: Christopher Adams <chris.adams@jolla.com>
Reviewed-by: David Llewellyn-Jones <david.llewellyn-jones@jolla.com>
|
|
|
|
|
|
| |
Change-Id: I51d2a292275f100f1250ae46c223098b6fedfd11
Reviewed-by: Christopher Adams <chris.adams@jolla.com>
Reviewed-by: David Llewellyn-Jones <david.llewellyn-jones@jolla.com>
|
|
|
|
|
|
|
|
| |
This requires Qt5.10.
Change-Id: I66057190a83912d97b135b17e51a6e6f429447c3
Reviewed-by: Christopher Adams <chris.adams@jolla.com>
Reviewed-by: David Llewellyn-Jones <david.llewellyn-jones@jolla.com>
|
|
|
|
|
|
| |
Change-Id: I7ecda5acf3be4216d92e363bc1c2e022e131eb05
Reviewed-by: Christopher Adams <chris.adams@jolla.com>
Reviewed-by: David Llewellyn-Jones <david.llewellyn-jones@jolla.com>
|
|
|
|
|
|
| |
Change-Id: Ifc92e357298e1d9d57e279d0523acd3dc8fd67c1
Reviewed-by: Christopher Adams <chris.adams@jolla.com>
Reviewed-by: David Llewellyn-Jones <david.llewellyn-jones@jolla.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QMailStore specifies a NOT NULL constraint for the preview
field of the mailmessages table. If a client attempts to
clear the preview for the message by passing in a
default-constructed QString(), the subsequent database operation
will fail due to the violated constraint.
This commit ensures that the preview field is handled similarly
to other fields (like rfcId) such that a non-null (but still
empty) string value is used in that case.
Change-Id: Ia527adea1f68de4d59b8837c3f8ce288d454a7d7
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is an issue with the current implementation that downloads twice the
part content in case of subparts and signed mails. For instance a mail with
this layout:
1: multipart/signed
1.1: text/plain
1.2: image/png
2: application/pgp-signature
will trigger in mode RetrievalAction::Auto the following requests:
1-HEADER // as a signed part
1-BODY // as a signed part
1.1-BODY // as a text part
2-BODY // as a non attachment part
which will result in text/plain part being downloaded twice and appended twice
in a text file. To avoid this, this patch don't append to the list of requests
any requests that are within a signed part.
Change-Id: I654d020acf2a6a1fe26ae53ad667a84e7ea90c2e
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
|
|
|
|
|
|
|
|
|
|
|
|
| |
In a multipart messages, boundaries are generated when calling
QMailMessage::toRfc2822(). For signature purposes, there is a
need to generate RFC2822 compliant output for QMailMessagePart
only. Previous implementation of QMailMessagePart::toRfc2822()
introduced for signature purposes was lacking boundary
generation.
Change-Id: I7381cf2cb3a8bf83267f36e2f3f7369e8b040cef
Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The signature data of PGP or S/MIME standards requires to be checked
on the undecoded data of another part of the email. This other part
is available internally through the undecoded() method, but is not
available outside QMF. There is thus no point to propose the signature
data as an attachment that may become visible to the user.
This patch remove the signature data of these two protocols from the
list of attachment, as it was done for the calendar data for instance.
It also updates and extends the tests of the findAttachmentLocations()
method.
Since imap plugin is using findAttachmentLocations() to decide to retrieve
parts or full message, a modification was required to ensure that
signature data are properly parsed in case of full message download.
Change-Id: If0da27ce06d78b15a44c40bfb409f84635a3a8f6
Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following usage of API is creating RFC not compliant emails:
QMailMessage m;
m.setFrom(QMailAddress("bla@bla.org"));
m.appendHeaderField("From:", "bla@bla.org");
This construction may happen for instance if the appendHeaderField() call is done
in a for loop copying all headers from another email.
Several header fields from RFC2822, 3.6, are mentioned to be present at
maximum only once. A filter based on field name is set to change the
append call into an update call for these specific fields.
Change-Id: Iece09438b3252e2a6888b7a6aafb3c9cc280558c
Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Create a new interface for cryptographic operations like digital signatures.
Also implement two plug-ins based on GPGme implementing the OpenPGP and S/MIME
protocols.
To allow digital signature checking to work, pristine data as received from
the server need to be stored. This patch is adding such "undecodedData()"
information to the content manager. The IMAP implementation has been updated also
to ensure that pristine data can be retrieved and saved.
Change-Id: Ic801b0de84b42c16f6c64fffdd67dc51c2b8b9b9
Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
|
|
|
|
|
|
|
|
|
|
| |
Nothing avoid or warn when calling setType("text/plain; charset=UTF-8").
Later calls to subType() or charset() return a wrong value then. Patch
simply checks that ';' or '/' is not part of the argument in setType().
Change-Id: I1839c2a5800328e00f422054d5c19e9797be1a94
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
|
|
|
|
|
|
|
|
|
|
|
| |
Add two tests to check that attachment finder is working for level 1
and level 2 attachment locations. It's a follow up of previous commit
"Add recursion when looking for attachments". It also check that
calendar invitation is not returned as an attachment.
Change-Id: If84bc67687d50720ab1bc0458e7b57ed21650348
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
|
|
|
|
|
|
| |
Change-Id: I2a88dafc4b47d42e27ae25c22ba03654c3830ff9
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Regular expression are not appropriated tool to parse a none regular language
like html, a proper parse should be used.
This commit introduces a dependency on QtGui making the messageserver
binary marginally bigger in size. Usage of Html parse is optional
can be defined via USE_HTML_PARSER compile flag.
Change-Id: I2dba9042bb7f5340bfd8c24cb59c2a769489a7c6
Reviewed-by: Damien Caliste <dcaliste@free.fr>
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
|
|
|
|
|
|
|
|
|
|
|
| |
Create a new function to ensure that content type matching is always done
case insensitive.
Originally the comparison was done after a toLower(), but forgetting this, like
in src/libraries/qmfclient/qmailmessage.cpp#6252, can create bugs.
Change-Id: Ia93e068e5374c346c94c2afe4de768d3833b4a9a
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some attachments are stored like that on disk for instance:
$ ll 1454950441.21419.3MYc5-parts
total 204
-rw-r--r-- 1 nemo 197093 Feb 8 17:54 2.1
-rw-r--r-- 1 nemo 936 Feb 8 17:54 1.2
-rw-r--r-- 1 nemo 936 Feb 8 17:54 1.1
The file 2.1 being a PDF. This kind of attachments are not listed, coming
from the fact that in src/libraries/qmfclient/qmailmessage.cpp:1199, the
inMultipartMixed() method is not recursive. It is listing only the first
level of attachments (i.e. parts that are named [0-9]+ on disk).
Making the attachment finder recursive have the drawback that some calendar
invitations are now visible as attachment. This patch is taking care of
this too.
Structure of a failing email:
Content-Type: multipart/mixed;
boundary=--boundary_1233_7a77cb73-30a7-446e-ac29-52a7fda0bb71
MIME-Version: 1.0
----boundary_1233_7a77cb73-30a7-446e-ac29-52a7fda0bb71
Content-Type: multipart/alternative;
boundary=--boundary_1232_a7997778-4b33-4b26-a978-c17ad93d215e
----boundary_1232_a7997778-4b33-4b26-a978-c17ad93d215e
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: base64
----boundary_1232_a7997778-4b33-4b26-a978-c17ad93d215e
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64
----boundary_1232_a7997778-4b33-4b26-a978-c17ad93d215e--
----boundary_1233_7a77cb73-30a7-446e-ac29-52a7fda0bb71
Content-Type: multipart/mixed;
boundary=--boundary_1234_3ec882e1-3b08-47d3-965b-1380c61b8e8e
----boundary_1234_3ec882e1-3b08-47d3-965b-1380c61b8e8e
Content-Type: application/octet-stream;
name="air china c.a. - itinerary receipt.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment
----boundary_1234_3ec882e1-3b08-47d3-965b-1380c61b8e8e--
----boundary_1233_7a77cb73-30a7-446e-ac29-52a7fda0bb71--
Change-Id: I00e6d0b1755fbfb6ecbd347b812c0db983d221f6
Reviewed-by: Michael Nosov <Michael.Nosov@harman.com>
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some servers (e.g mail.ru) report boundaries as NIL for multipart messages.
from my understanding of RFC2046 this is invalid, but we can gracefully handle
those by setting them to empty.
Avoids crash when requesting a partAt() for a message that does not exist,
this happened due to NIL boundaries, but no need to crash in such cases.
Change-Id: I676e444184ad1ca39f93bc8d18635f134a315d0a
Done-with: Valério Valério <valerio.valerio@jolla.com>
Reviewed-by: Valerio Valerio <vdv100@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to RFC1806, see 3. Examples, it is valid to set content-disposition
to a message itself, or even to a multipart container. Currently, QMF cannot
represent a message as given in the first example, because QMailMessage inherits
only QMailMessagePartContainer but the content disposition is stored in
QMailMessagePart.
This change would allow to treat a message whose only content is marked as
an attachment.
Change-Id: Ifeada93dfca7e1a351c1a73049e9209d3eacd2fc
Reviewed-by: Michael Nosov <Michael.Nosov@harman.com>
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
|
|
|
|
|
|
|
|
|
| |
multipart/signed parts can be the top level part having any other valid
containers inside as per RFC1847.
Change-Id: I0ff16bc04223ca4d984d946a7fb763a9d52356aa
Done-with: Valério Valério <valerio.valerio@jolla.com>
Reviewed-by: Valerio Valerio <vdv100@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Like earlier fixes, mostly adding QLatin1String everywhere.
Occasionally QStringLiteral, QByteArray or QString/QChar::fromLatin1
or something similar.
Still warnings left, but rest might need more work than latin1 wrapping.
Change-Id: I0fb2fc74e56e497342a78d9497370db6a7f2b169
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
Reviewed-by: Joona Petrell <joona.petrell@jollamobile.com>
|
|
|
|
|
| |
Change-Id: I67eb29e13c5e643ee2f58a0696400e085999c01c
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
|
|
|
|
|
|
|
|
| |
QMailMessagePartContainer::findInlinePartLocations() returns the locations of the inline parts
in a HTML body container, only parts with a content id reference will be returned.
Change-Id: I65ed51a52bc64d2fa60e019caf0e059397a3e71e
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
|
|
|
|
|
| |
Change-Id: I5ee07f902ddb7f6b2d6ea4662070757df74f22ad
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
|
|
|
|
|
| |
Change-Id: Icce55517963f0cbc35211e9fc6f1a0fc413f5676
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
| |
properly.
E.g of quoted email address: "From: \"=?ISO-8859-1?Q?=22Joh=F1_D=F6e=22?=\" <jdoe@example.net>"
Change-Id: I640fb127d640585099289558c6080cd1b698c331
Signed-off-by: Valerio Valerio <valerio.valerio@jollamobile.com>
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
|
|
|
|
|
|
|
|
| |
Update code base to match latest release of Qt.
Signed-off-by: Valerio Valerio <valerio.valerio@jollamobile.com>
Change-Id: I02c2ff250ea8cd960938b81903e92b04c745ae9c
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
|
|
|
|
|
| |
Change-Id: If0f4427ee93a37de4ebd9e097defd8b3956f0fc6
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This flag indicates that a new message notification should not be shown
for the message. e.g. an older message retrieved in a folder that has previously
been synchronized, or an existing message moved to a folder such as trash, or a
message externalized by saving in a drafts or sent folder
It should only be used for new messages, e.g. messageAdded signal.
(I've also included some missing doc in the commit.)
|
|
|
|
| |
Doc was buggy, and so was pop plugin setting of this field.
|
|
|
|
| |
letter mails in particular account.
|
| |
|
|
|
|
|
|
| |
Port from QMF MeeGo.
Don't encode the attachment filename if it's ascii.
Add new public method "addAttachment".
|
|
|
|
|
| |
Port from MeeGo QMF.
Prefer the Content-Disposition/Size to the body size.
|
|
|
|
| |
Fixes NB#291875 also update CHANGES file to correct previous tag name.
|
|
|
|
|
|
|
|
|
|
|
| |
Follow up fix for NB#294947.
Required to make unit tests pass, otherwise Content-Type header
field output by QMailMessage::toRfc2822 has a spurious empty
charset parameter e.g.
Content-Type: text/plain; charset=
Instead of
Content-Type: text/plain;
|