Commit Graph

5267 Commits

Author SHA1 Message Date
Joe Steele c861b27df8 Fix outgoing server settings display
Add test for username == "".

Without it, the mRequireLoginView remains checked, and the empty username
and password boxes are not hidden.

The problem occurs if importing an SMTP server that has an
authenticationType, but no username or password (i.e., no authentication
required).

That's the way settings were exported in 4.904 and before.
2014-08-11 11:06:48 -04:00
Joe Steele 373c7569ed Fix password prompts on account import
Don't prompt if server's AuthType == EXTERNAL

Don't prompt for SMTP servers that don't require authentication
(no user name).
2014-08-11 11:06:46 -04:00
Joe Steele 6d8497a3c3 Fix WebDAV manual account setup
When creating a new account, the Incoming Server Settings screen
was initialized with the user name = PLAIN.
2014-08-11 11:06:45 -04:00
Joe Steele bef10812d3 Fix so WebDAV does not have STARTTLS auth. type option 2014-08-11 11:06:43 -04:00
Joe Steele eb68bc0a9d Avoid NPE on export
Occurs when the SMTP server doesn't require authentication
(authenticationType == null).

The javadoc for ServerSettings says that both authenticationType and
connectionSecurity may be null.
2014-08-11 11:06:42 -04:00
Joe Steele 34fd6d3ea7 Import/Export client certificate alias setting 2014-08-11 11:06:40 -04:00
Joe Steele ada74db8d5 Refactor KeyChainKeyManager()'s sClientCertificateReferenceWorkaround
The referenced issue states that it is only applicable to Android < 4.2
(testing confirms the problem on 4.1.2, but not on 4.2.2).

A test was added for the version code, primarily as a finder's aid for a
day when K-9 Mail no longer supports Android < 4.2 and the work-around can
be removed.

The referenced issue also states that it is only necessary to hold a
reference to the first PrivateKey retrieved. (Testing indicates that the
problem is avoided so long at least one reference is always maintained to
a PrivateKey -- it doesn't actually need to be a continuous reference to
the first PrivateKey.)

From my understanding, a normal class loader never unloads a class, so the
static reference can be safely kept privately in KeyChainKeyManager.
2014-08-11 11:06:38 -04:00
Joe Steele 51829a2451 Reorganize the server setup layouts
This only changes the vertical display order of the widgets.

The user will likely review the settings from top to bottom, but
the way they were previously arranged, settings lower on the list
were affecting things higher on the list.

Generally show top to bottom:
Server
security type
port (affected by security type above)
require login checkbox (SMTP only, affects everything below)
user
auth. type (affected by security type above, affects everything below)
password (affected by auth. type above)
client cert (affected by auth. type above)
2014-08-11 11:05:18 -04:00
Philipp Haselwarter 7aa4c1308e Configure mail notifications by folder class
In response to Issue 1794,
- add a configuration option in the account preferences to show
  notifications only for 1st/2nd/etc class folders
- add an option in the folder preferences to set the notification class
  as 1st, 2nd or inherited from the folder's push class

The default behaviour remains unchanged.
2014-08-06 11:04:07 +02:00
Joe Steele 41570e4305 Fix leaked window error in FolderList
Observed after wiping data and then tapping a launcher shortcut
for an account.
2014-07-30 19:26:43 -04:00
Joe Steele fe49a5f005 Avoid NPE in MessageOpenPgpView.handleError()
E/AndroidRuntime(25655): FATAL EXCEPTION: main
E/AndroidRuntime(25655): Process: com.fsck.k9, PID: 25655
E/AndroidRuntime(25655): java.lang.NullPointerException
E/AndroidRuntime(25655):     at com.fsck.k9.view.MessageOpenPgpView.handleError(MessageOpenPgpView.java:385)
E/AndroidRuntime(25655):     at com.fsck.k9.view.MessageOpenPgpView.access$3(MessageOpenPgpView.java:384)
E/AndroidRuntime(25655):     at com.fsck.k9.view.MessageOpenPgpView$DecryptVerifyCallback.onReturn(MessageOpenPgpView.java:357)
E/AndroidRuntime(25655):     at org.openintents.openpgp.util.OpenPgpApi$OpenPgpAsyncTask.onPostExecute(OpenPgpApi.java:195)
E/AndroidRuntime(25655):     at org.openintents.openpgp.util.OpenPgpApi$OpenPgpAsyncTask.onPostExecute(OpenPgpApi.java:1)
E/AndroidRuntime(25655):     at android.os.AsyncTask.finish(AsyncTask.java:632)
E/AndroidRuntime(25655):     at android.os.AsyncTask.access$600(AsyncTask.java:177)
E/AndroidRuntime(25655):     at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
E/AndroidRuntime(25655):     at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(25655):     at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(25655):     at android.app.ActivityThread.main(ActivityThread.java:5128)
E/AndroidRuntime(25655):     at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(25655):     at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(25655):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
E/AndroidRuntime(25655):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:611)
E/AndroidRuntime(25655):     at dalvik.system.NativeStart.main(Native Method)
2014-07-30 19:26:41 -04:00
Joe Steele 710e7a4430 Notify user of invalid account-setup settings combo
Specifically, warn and block them when attempting to configure Client
Certificate Authentication in combination with Connection Security = None.

If this were not made obvious to the user, they might not understand why
they are not permitted to tap "Next".

Also, move the initialization of all view listeners out of onCreate() into
initializeViewListeners() which is then called near the end of onCreate(),
helping to assure that the listeners won't be triggered during the
initialization of views inside onCreate().
2014-07-28 22:55:34 -04:00
cketti c36d2d7a5e Use latest Gradle Android plugin and build tools 2014-07-26 18:06:20 +02:00
cketti 96be55a262 Merge pull request #481
Sort apple emails in own category, add apple.com and icloud.com
2014-07-26 16:56:47 +02:00
cketti f463aa9fa0 Fix indentation 2014-07-26 16:53:03 +02:00
miguelpinheiro a671e51052 Sort apple emails in own category and add icloud.com 2014-07-19 15:48:44 +01:00
miguelpinheiro 2486caaf2d Sort apple emails in own category and add icloud.com 2014-07-19 15:46:11 +01:00
miguelpinheiro 14032088db Update providers.xml
Added apple mail providers (apple.com, mac.com, me.com, icloud.com)
2014-07-19 15:22:51 +01:00
Joe Steele 3c025379d4 Rework validateFields() and updateViewFromAuthType()
Previously, it was possible to have "Require sign-in" unchecked and a
"Security = None" setting for the outgoing server and still not be able to
tap "Next" because of a hidden (and irrelevant) "Authentication = Client
certificate" setting.

Check that the user has actually chosen a client certificate in
AccountSetupOutgoing.validateFields().

Also, there's no need to clear the password and certificate fields when
hiding them.  The user may accidentally change settings and want to change
them back without wiping out the existing settings.
2014-07-13 16:02:21 -04:00
Joe Steele 008891a375 Clean up indentation
White space changes only.
2014-07-13 16:01:51 -04:00
Ashley Willis 0a507463c4 Merge pull request #478 from typingArtist/master
Fix: HELO/EHLO with literal IPv6 address not conformant to RFC5321
verified in spec – ashleywillis
2014-07-05 13:12:38 -04:00
Matthias Wächter acd756e642 Fixed https://github.com/typingArtist/k-9/issues/1. HELO/EHLO IPv6 address literals
are now conforming to RFC5321.
2014-07-05 18:59:48 +02:00
Joe Steele cf718780f6 Fixes needed after merging in master
Also, fix unit tests.
2014-07-04 19:23:43 -04:00
Joe Steele 3142a9a225 Merge branch 'master' into tls-client-cert-auth
Conflicts:
	src/com/fsck/k9/fragment/ConfirmationDialogFragment.java
2014-07-04 18:08:07 -04:00
cketti 731da2747e Merge pull request #476 from k9mail/remove_actionbarsherlock
Remove ActionBarSherlock
2014-06-28 03:41:23 +02:00
Koji Arai 750e4a7808 Updated Japanese translation of the changelog. 2014-06-22 11:03:22 +09:00
cketti ba69b3a647 Remove ActionBarSherlock 2014-06-21 17:09:45 +02:00
cketti 103f85aa01 Fix 'testsOnJVM' Gradle task 2014-06-21 15:33:45 +02:00
cketti 324db56569 Use latest Gradle Android plugin and build tools 2014-06-14 03:29:44 +02:00
cketti 59bda357e0 Merge pull request #472 from mikeperry-tor/improve-header-privacy
Improve header privacy (Issues 6372, 3559, and 4690)
2014-06-14 03:02:49 +02:00
Mike Perry d67a59b77f Fixes for cketti's code review on pull req #472
Leave the hostname == null checks so we can fall back if a hostname is not
found. Also convert message-id to upper case to match Apple Mail (for
privacy).
2014-06-13 17:49:26 -07:00
Dominik Schürmann aad171ff7e Client Certificate Authentication 2014-06-05 21:03:18 +02:00
Mike Perry 38c90146e1 Issue 6372: Add preference for setting timezone to UTC.
This is a privacy preference to avoid leaking your current location while
replying to email.
2014-05-27 07:53:50 -07:00
Mike Perry 87802a01ef Issue 4690: Add privacy pref to omit K-9 User-Agent header. 2014-05-27 07:53:18 -07:00
Mike Perry 7ac7fe2cfe Issue 3559: Use From or ReplyTo hostname in Message-ID if available.
I wrote this fix to avoid obviously specifying that I am using a mobile device
to reply to an email.

Others want this for ease of filtering messages from their host by Message-ID.
2014-05-27 07:51:23 -07:00
cketti 2fdcb77c5c Merge pull request #470 from k9mail/issue_6260_delete_confirmation_in_message_list
Add support for delete confirmation in message list
2014-05-22 12:46:28 +02:00
cketti 082e13df26 Add support for delete confirmation in message list
Fixes issue 6260
2014-05-18 20:21:33 +02:00
cketti 95f33c38fe Merge pull request #468
Extract a TextBodyBuilder class

Conflicts:
	src/com/fsck/k9/activity/MessageCompose.java
2014-05-04 03:54:10 +02:00
Joe Steele ed3fcf375a Eliminate unused variable & redundant call
There are no side effects.

The subsequent executeOpenPgpMethod() calls
getOpenPgpInputStream() which calls
buildText(false)
2014-05-03 12:58:46 -04:00
Joe Steele 00a60a0f4f Clean up lint items
Eliminate unused variables/fields/imports
2014-05-03 12:51:37 -04:00
Joe Steele 523180020c Don't use enum ordinal as array index, v. 2
This revises commit 51aa34d per the GitHub comments therewith.
2014-05-03 11:44:21 -04:00
Joe Steele 58efee8be2 Avoid StrictMode error in OpenPgpApi
E/StrictMode(9278): A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
E/StrictMode(9278): java.lang.Throwable: Explicit termination method 'close' not called
E/StrictMode(9278): 	at dalvik.system.CloseGuard.open(CloseGuard.java:184)
E/StrictMode(9278): 	at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:179)
E/StrictMode(9278): 	at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:168)
E/StrictMode(9278): 	at android.os.ParcelFileDescriptor.createPipe(ParcelFileDescriptor.java:362)
E/StrictMode(9278): 	at org.openintents.openpgp.util.ParcelFileDescriptorUtil.pipeFrom(ParcelFileDescriptorUtil.java:34)
E/StrictMode(9278): 	at org.openintents.openpgp.util.OpenPgpApi.executeApi(OpenPgpApi.java:222)
E/StrictMode(9278): 	at org.openintents.openpgp.util.OpenPgpApi$OpenPgpAsyncTask.doInBackground(OpenPgpApi.java:189)
E/StrictMode(9278): 	at org.openintents.openpgp.util.OpenPgpApi$OpenPgpAsyncTask.doInBackground(OpenPgpApi.java:1)
E/StrictMode(9278): 	at android.os.AsyncTask$2.call(AsyncTask.java:288)
E/StrictMode(9278): 	at java.util.concurrent.FutureTask.run(FutureTask.java:237)
E/StrictMode(9278): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E/StrictMode(9278): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E/StrictMode(9278): 	at java.lang.Thread.run(Thread.java:841)
2014-05-03 11:43:45 -04:00
Joe Steele 5cc4d7c6a9 Avoid NPE in MessageOpenPgpView.updateLayout()
E/AndroidRuntime(24914): FATAL EXCEPTION: main
E/AndroidRuntime(24914): Process: com.fsck.k9, PID: 24914
E/AndroidRuntime(24914): java.lang.NullPointerException
E/AndroidRuntime(24914):    at org.openintents.openpgp.util.OpenPgpServiceConnection.<init>(OpenPgpServiceConnection.java:35)
E/AndroidRuntime(24914):    at com.fsck.k9.view.MessageOpenPgpView.updateLayout(MessageOpenPgpView.java:115)
E/AndroidRuntime(24914):    at com.fsck.k9.view.SingleMessageView.setMessage(SingleMessageView.java:623)
E/AndroidRuntime(24914):    at com.fsck.k9.fragment.MessageViewFragment$Listener$2.run(MessageViewFragment.java:602)
E/AndroidRuntime(24914):    at android.os.Handler.handleCallback(Handler.java:733)
E/AndroidRuntime(24914):    at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(24914):    at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(24914):    at android.app.ActivityThread.main(ActivityThread.java:5081)
E/AndroidRuntime(24914):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(24914):    at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(24914):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime(24914):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
E/AndroidRuntime(24914):    at dalvik.system.NativeStart.main(Native Method)
2014-05-03 11:43:05 -04:00
Joe Steele f17b45c152 Provide Eclipse .project file for new plugin
This gives the openpgp-api-library an Eclipse
project name consistent with the names used for
the other plugins.  This helps with initial
project setup and avoids project naming collisions.
2014-05-03 10:38:06 -04:00
Joe Steele e0ce5fc4ce Eliminate superclass callbacks
Service components don't need to call
super.onCreate() and super.onDestroy()
2014-05-03 10:36:36 -04:00
cketti e2cffa074f Update/remove comments 2014-05-03 06:33:33 +02:00
cketti a9cfa9ae68 Code style
No functional changes
2014-05-03 06:13:38 +02:00
Koji Arai 3a02bfb0a9 I have deleted a change in 0323af0. 2014-05-03 06:12:56 +02:00
Koji Arai 9c5b9cce90 Adapt to the astyle version 2.04.
* max-instatement-indent:
The valid value is 40 thru 120.

* brackets=attach:
We should change the brackets options to the style option in v2.02 or later.

For more detail, see the http://astyle.sourceforge.net/news.html.
2014-05-02 14:31:13 +09:00
Koji Arai 0a09060ed7 adapt to product code 2014-05-02 13:42:05 +09:00