Commit Graph

102 Commits

Author SHA1 Message Date
Danny Baumann 39e1c44e7c Allow download of compressed attachments.
Assuming all compressed files are malware is a little extreme.

Change-Id: I0ef776f3ad4af1fb73199989c99ab05171353d17
2015-10-18 14:06:01 -07:00
Jorge Ruesga a7d1b42409 email: start handshake before hostname verification
Start handshake prior to hostname verification to ensure exceptions do not get silenced

Change-Id: Ide60753663d82d63b0f410b985447b7b26efd8f1
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
2015-10-18 14:02:22 -07:00
Jorge Ruesga 761a860cee email: add support for Server Name Indication (SNI)
Change the underlying socket factory reference to SSLCertificateSocketFactory which
has support for SNI since 4.2, and remove the access to the obsolete methods from
the old factory reference.
This change will setup the socket with a proper hostname prior to the ssl handshake.

Change-Id: Ic3315f3924f33470ea2da14e8ac3b946d039b1d5
JIRA: CYAN-3775
Issue: https://jira.cyanogenmod.org/browse/CYAN-3775
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
2015-10-18 14:02:22 -07:00
Martin Hibdon 21dc44d235 Merge "Add analytics to track of what cipher suites are being used" into ub-gmail-ur14-dev 2014-10-24 19:34:10 +00:00
Martin Hibdon 93a9662d8d Add analytics to track of what cipher suites are being used
b/18001842
I do this in MailTransport, which is only used by POP and IMAP.
I can't log Analytics in SSLSocketFactoryWrapper, because that
is in emailcommon and would cause a circular dependancy between
emailcomman and UnifiedEmail.
This will not yet work for Exchange, because it gets its socket
indirectly through EmailClientConnectionManager, using a
SchemeRegistry. Still, it will be helpful to get this info for POP
and IMAP.

Change-Id: Ibb9d22c83c49d0ba5090295b5321ca6afb09e65b
2014-10-24 11:46:48 -07:00
Martin Hibdon 303b553b13 Allow an external security provider to be installed
b/18001842

Change-Id: I8312fe541896e1ceeb6c5102f90bdbb0bb945151
2014-10-21 15:20:56 -07:00
Martin Hibdon 4ecd51a794 Add deprecated cipher suites to our SSLSocket
b/18001842
In the L platform, some cipher suites are disabled by
default. Unfortunately, some of these are still in use
by common email providers. We need them to be enabled
for email to work with these providers.

Change-Id: Ia3a9bab5467c26626db9259074f77ec476610fa5
2014-10-21 12:58:25 -07:00
Martin Hibdon 601700a61e Get SSLSocketFactory from GmsCore
b/15721931
This follows an example pattern from GoogleHttpClient.
It tries to get the SSLCertificateSocketFactory from
GmsCore using reflection. If that fails, (because GmsCore
is not installed on the device) then it will fall back
to the platform implementation.
MailApplication sets a static object in SSLUtils that
allows it to get an externally created SSLCertifcateSocketFactory.
If this method is set, then it will use it, otherwise it
will fall back to the platform factory. This way there
is no reference to GmsCore in the AOSP email.

Change-Id: I0890fe4c3d79283fb98a4dc5a62a32efd320e52a
2014-10-02 10:54:52 -07:00
Tony Mantler f1789afa53 Switch null checks to TextUtils.isEmpty()
b/16872654

Change-Id: Ib8943f068ad6988ff08f8bfd54e2df8fa5ce0274
2014-08-07 14:11:02 -07:00
Tony Mantler f765f9b976 Clean up cert activity handling
Fix re-displaying the dialog on orientation change b/5622284
Add host/port when available b/4988512
Disambiguate intent between AOSP and EmailGoogle

Change-Id: Ideeda20dfd9bd0070998ccf42d8042765866ca0e
2014-06-05 13:21:08 -07:00
Tony Mantler 82a207132b Move account backup/restore to userdata in AccountManager
Change-Id: Iea9f2a1b1f2d87e07d63cbb1df5a0d6355ea4031
2014-05-14 15:15:49 -07:00
Tony Mantler 9a80ffce14 Handle attachment filenames with % characters
b/14571903

Change-Id: I3296bebfb4c6902750c68c9d3fb79ce644dbb137
2014-05-06 10:26:45 -07:00
Tony Mantler aab514c942 Catch empty mime type and substitute application/octet-stream
b/14564897

Change-Id: Id91dd18ef8b3fab449eb178bde73303107b78590
2014-05-05 13:26:22 -07:00
Tony Mantler 32471fc22e Catch exceptions when DownloadManager is disabled
b/14562210

Change-Id: If3f2da034e8492de049bc3bcac910a033c47d600
2014-05-05 10:23:12 -07:00
Tony Mantler 564a5343cc Merge "Don't allow empty or null filenames" into ub-mail-master 2014-05-05 16:14:56 +00:00
Tony Mantler d0b54a2948 Don't allow empty or null filenames
b/14500106

Change-Id: I519e4a0fe392c3bdbb84f1ccbdea89f07b9c1426
2014-05-02 16:42:46 -07:00
Jay Shrauner 2fc13087e7 Parse abbreviated date fields
Add support for abbreviated dates with no timestamp (eg, "2009-01-02") to
parseEmailDateTimeToMillis.

Bug:14496986
Change-Id: Ifc77cb75fd9e23536b48c8f6ecefc0e2e8f1cc2c
2014-05-02 16:17:17 -07:00
Tony Mantler d786b90cb5 Don't allow non-constant format strings
Also clean up warnings and delete unused code

b/14488939

Change-Id: I0fc552b8437958331c30f2ddd05ae33c0010e79f
2014-05-02 10:05:27 -07:00
Jay Shrauner 988d2b6e85 Fix Exchange crash when parsing abbreviated dates
Detect fully qualified and abbreviated date/time stamps in parseDateTime.
Previously parsed fully qualified forms like 20090211T180303Z; now also
parses 20090211.

Bug:14279251
Change-Id: I9a99ae16a5c1fe87b977fbebdba307baa653d539
2014-04-30 09:53:00 -07:00
Tony Mantler 3dd85723a1 Cleanup in EmailContent
Change-Id: Ifa251eb206779f59ea003f99395d454c7e407bc2
2014-04-14 12:54:39 -07:00
Tony Mantler 80d7676985 Remove flawed body-mangling code, add some finals
Change-Id: Ia3dc53cc36e5c2912d4366d4e1a0d69b87c4409b
2014-04-11 14:50:22 -07:00
Scott Kennedy 048a2956da Revert "email: add support for Server Name Indication (SNI)"
This reverts commit 75cf76875e.

Bug: 13744933
Change-Id: I6ef39dfa13dcadc5a41c79f65bc0eed9d27dd447
2014-04-01 20:21:05 +00:00
Jorge Ruesga 75cf76875e email: add support for Server Name Indication (SNI)
Change the underlaying socket factory reference to SSLCertificateSocketFactory which
has support for SNI since 4.2, and remove the access to the obsolete methods from
the old factory reference.
This change will setup the socket with a proper hostname prior to the ssl handshake.

Change-Id: Ie537b1d8c3da33de3665e481320be134939155ca
Signed-off-by: Jorge Ruesga <j.ruesga.criado@gmail.com>
2014-03-31 10:54:16 -07:00
Tony Mantler 0c8696c2eb Fix IMAP message upsync to include attachments.
b/13138456

Change-Id: If16b619a650c640a37cb4563750a6327a5e601e6
2014-03-26 11:49:38 -07:00
James Lemieux 0dffe3afd7 Keep on getting a couldn't sign-in notification
b/11551107

This is caused by ImapConnection.doLogin() only throwing
AuthenticationFailedExceptions and not other varieties of exceptions.

While fixing this bug, I discovered that the ConversationListFooterView
that is displayed in response to a authentication failure contains a
button called "Sign In" that didn't actually do anything. I made it
navigate to the incoming account settings fragment where the user is
free to change the relevant account credentials.

Change-Id: I2c772ecab18f3e57059eceeae01de08f1fdab4c2
2014-03-07 16:38:47 -08:00
Tony Mantler 76472ae40c Merge setup fragments under a single activity
Change-Id: I10cf8bb9f6bc1a26ea97ae664f0196ae9e9493b5
2014-02-26 13:47:41 -08:00
Tony Mantler feeb1e3ada Mark otherwise unused method as @VisibleForTesting
Also fix spelling cancellAllInterrupt -> cancelAllInterrupt

b/13082964

Change-Id: I2fef949bb351a536fdd0d7058b3df2b03eecb39e
2014-02-18 15:59:03 -08:00
Anthony Lee 37a4c65e58 Introduce an SSL handshake timeout value of 30 seconds.
Motorola 0009-IKXREL1KK-5011 patch. Hanging on an SSL handshake is
a real situation that needs to be handled. 30 seconds is more than
enough of a timeout to abort on a potential hang. The coincidental
thing is that there was a fix that was made a while back to email 1
that addressed the same issue in similar code. You can reference it
here: b/7583420.

Change-Id: I0533e57f8c5d45d241adb7f37d54ebe1f0ad9368
2014-02-13 08:32:10 -08:00
Jerry Xie 17d3a29c9d Get Email units to compile
Change-Id: I171a0e2421c5006d9862ad94f886932146547020
2013-12-05 11:11:21 -08:00
Tony Mantler 4b629cf258 Null check certificate alias before trying to configure it
Bug: 11678638

Change-Id: Ia12789ac3553ef959a8c9bbf13f017b1a154f560
2013-11-15 20:51:00 +00:00
Tony Mantler 2ed113c713 Foreign characters may be letters and digits, but they're not allowed in Uri/Url schemes
b/11356390

Change-Id: Ic510607ab5f671e3f3f474ea3c2f4af7e9966cb1
2013-10-31 16:39:03 -07:00
Yu Ping Hu feacaf6351 Do not try to load nameless attachments.
Bug: 11347094
Change-Id: I46321755cebe25858c0188f35270d428dfe4a435
2013-10-25 14:21:02 -07:00
Alon Albert c4d139c4f4 Auth Notification
Some changes that allow a notification to open Account Settings for a specific
account

Bug: 10930585
Change-Id: Ib329e339b405ccbc0631d5ce6a23bf8fa6d62b83
2013-09-27 17:52:48 -07:00
Tony Mantler 463584d23f Fix account matching at initial screen to match against email address
b/10210901

Change-Id: I64d60ca33a42a19e085dd98a7a61d68ac30027f9
2013-09-26 13:41:09 -07:00
Tony Mantler ed4accb24f Clean up warnings, finals, dead and useless code
Change-Id: I8225a78c3b1712479bb5752161e3585a2bc2be2e
2013-08-23 14:43:31 -07:00
Martin Hibdon 8708594f03 Use insecure socketFactory if "accept all certificates"
b/9176386

Change-Id: I1edc92bb4207d166e9b252bf3ed98ad8b2c4d996
2013-08-15 17:45:36 -07:00
Scott Kennedy 9a0382bb46 Remove more warnings
Change-Id: I0b7475a3569a05c90aa1ab6540c875326da96768
2013-08-01 08:55:38 -07:00
Scott Kennedy 560bfadc31 Unify LogTag
There is now only one LogTag class. The static initializer of
GmailApplication (existing) and EmailApplication (new) will now set
the log tag to "Gmail" and "Email", respectively. Up until that code
is run, it will be "UnifiedEmail".

"setprop log.tag.Gmail VERBOSE" (or .Email) will trigger all logs to
be printed as long as they go through LogUtils, regardless of what tag
is used by that individual log. This lets us still turn on logging
everywhere in one command, but also lets us use more descriptive tags
(like the class name).

And since we no longer have three com.android.mail.utils.LogTag
classes, builds will be much easier.

Also, we now use LogUtils everywhere.

Change-Id: I55f1c7a66ce50ead54877a13e40256422a56dc39
2013-06-05 20:06:15 -07:00
Andrew Sapperstein 6be411edd0 Refactoring to support eml viewer in UnifiedEmail.
Moved two files out of Email into UnifiedEmail and
removed their dependencies on EmailContent. As a result,
those classes now return the data directly via a data only
class.

Change-Id: Iaf0618dd6879c9dc2a41943d3d15428904b65768
2013-06-04 15:37:40 -07:00
Andrew Sapperstein 91973256c2 Moved code out of emailcommon to UnifedEmail.
This CL is mostly just deletion since the new code
is in a new project.

Change-Id: I4aee519187a6ed7514c97d2a7a85ed29ea29d25f
2013-05-31 16:28:51 -07:00
Paul Westbrook 5a3aebbd2d Fix problem with sending attachments in Exchange
The problem was that when the attachment was attempted to be opened
from the Exchange process, it didn't have access to the cached file.
Instead, use a content provider uri to reference the cached file.

Bug: 8400456

Change-Id: I80abd66642e938cf09f73bf0e9bd049aa8d7ba1d
2013-03-21 17:34:19 -07:00
Paul Westbrook 9a95253846 Cache attachments on send
Cache attachments in a email directory when sending to allow sending
to succeed when the content provider has a permission

Bug: 7381557
Change-Id: Icf9faead2048de237228625f998b42feade48978
2013-02-27 09:43:31 -08:00
Scott Kennedy b34608228f Move notifications to UnifiedEmail
This involves redoing the persistence model, to split general,
account, and folder settings into separate SharedPreference stores.

It also requires some preferences to be moved into UnifiedEmail.

Depends on Ibe2e3f93ec164370535ffc5f5b2409544cc8d36d (UnifiedEmail)

Change-Id: Ie6ec389b5b5d2e7ab1b299d0877811ae716526e2
2013-02-08 09:48:22 -08:00
Marc Blank 4792546584 Don't delete smart-forward attachments
Bug: 7115207
Change-Id: I3f0782a01e9faa83834e5abbaf40cdb2ac0f8718
2012-09-15 10:33:37 -07:00
Marc Blank 6e5bccf2c9 Use correct attachment provider authority
* Make sure new code works with old Attachment rows

Bug: 7130972
Change-Id: Ia5d258930f39266517eead535a92bb4380fdb594
2012-09-09 09:32:14 -07:00
Marc Blank e714bb9d15 Convert authorities, intents, and account manager types
* Tested ok on wiped Nexus
* Tested ok on S3
* Upgrade verified on Nexus

Change-Id: If5d4ce594f8a309cdb59589d10b1d33f3b79326c
2012-08-31 23:26:36 -07:00
Marc Blank 0e969171bb Update client connection manager w/ bdc fix in AOSP branch
Bug: 6838215
Change-Id: I39a2ea0b54aca34062e1a2ccc472e701c3ef2f79
2012-08-16 11:45:13 -07:00
Marc Blank 7d5e2a7c08 Do "same certificate" checking when using "trust certificates"
* Refactor/simplify Transport/MailTransport
* Add serverCert column to HostAuth table in EmailProvider
* During first connection to server, save the server certificate
  in the HostAuth; on subsequent connections, ensure that the
  certificate presented has the same public key as the one
  stored
* For now, we'll just fail to connect (with a CertificateException)
  if there's a mismatch

TODO: Add some UI to handle different certificates

Bug: 6888866
Change-Id: Ia79497e89eaad8d43617b50d3771121b2ed7f687
2012-08-01 09:04:44 -07:00
Marc Blank a8b683cf3f More work on Imap2
* Handle sending mail and moving to sent folder
* Implement picker for sent folder
* Upload sent items to server
* Add support for "automatic" sync window
* Move some files from Email -> emailcommon
* The added files are copied directly from Email (and can be
  removed if/when Imap2 is merged back with Email)

Change-Id: I3a6a3d224826e547748be2f1b567b6294ad5db89
2012-07-19 14:27:17 -07:00
Marc Blank f419287f22 DO NOT MERGE: Move emailcommon2 sources to emailcommon
Change-Id: I06df7e467cd2e0117df8b8db3ddc6ff9da13f1c7
2012-06-28 11:15:06 -07:00