1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 03:32:16 -05:00

Merge into 'trunk'

r51837@31b (orig r127):  ismarc31 | 2008-11-10 19:10:50 -0500
Experimental branch for Exchange WebDAV support

r51838@31b (orig r128):  ismarc31 | 2008-11-10 19:24:52 -0500
Initial proof-of-concept code for WebDav support

r51839@31b (orig r129):  ismarc31 | 2008-11-10 22:02:37 -0500
Fixed a couple of migration issues and enabled WebDav as a mail type

r53269@31b (orig r132):  ismarc31 | 2008-11-21 21:55:55 -0500
Mostly rewritten class and organization.  Better implementation of message fetching.
Consolidated response parsing.  Removed a large number of redundant calls.  There is still 
some unused functions needing cleaning up, and some unimplemented actions

r53338@31b (orig r133):  ismarc31 | 2008-11-22 16:50:02 -0500
Removed more redundant and unused calls.  Implemented checking read status

r53453@31b (orig r134):  ismarc31 | 2008-11-24 20:13:24 -0500
Added support for marking messages as read.

r53454@31b (orig r135):  ismarc31 | 2008-11-24 22:04:04 -0500
Added support for deleting messages server side

r53455@31b (orig r136):  ismarc31 | 2008-11-25 01:32:19 -0500
Improved flag setting functionality, do bulk HTTP request instead of lots of little ones

r53589@31b (orig r138):  young.bradley | 2008-11-29 16:18:25 -0500
Missing some ports (webDavPorts); this causes an array index out of bounds exception when anything other than "None" or "SSL (Optional)" are selected.

Adding the three additional ports solves this issue.
r53590@31b (orig r139):  young.bradley | 2008-11-30 00:47:42 -0500
Initial support for sending via WebDav
r53591@31b (orig r140):  ismarc31 | 2008-11-30 20:12:41 -0500
Fix for display names being URL Encoded for folders.  Initial support of Uid Hashmaps instead 
of plain arrays.

r53592@31b (orig r141):  ismarc31 | 2008-11-30 21:46:06 -0500
Fix to constructor of HttpGeneric(final String uri).  URLs returned from Exchange aren't 
always fully encoded, this fixes the encoding before creating the method.

r53593@31b (orig r142):  ismarc31 | 2008-12-01 02:22:16 -0500
Completed support for using hashmaps instead of arrays for indexing urls to emails and read 
status.  Delete is safe again and read status is correct the first time through.

r53594@31b (orig r143):  ismarc31 | 2008-12-01 22:20:50 -0500
Fix for double-Inbox display issue.  Removed volumous amounts of Log.d messages.

r53644@31b (orig r157):  young.bradley | 2008-12-04 15:14:28 -0500
Fix for wildcard certificates (e.g. issued to *.example.com).  Only checking the
trust of the certificate itself, since apparently the full chain causes it to
not work.
r53765@31b (orig r161):  ismarc31 | 2008-12-06 18:55:08 -0500
Implemented new functionality for pulling message envelope.  Uses a WebDAV call for all messages rather than parsing the stream.  Message size is properly set now as well.

r54055@31b (orig r163):  jessev | 2008-12-06 19:28:24 -0500
* merge fixes
This commit is contained in:
Jesse Vincent 2008-12-07 00:29:11 +00:00
parent b8e686039f
commit d1d8345278
13 changed files with 2131 additions and 185 deletions

View File

@ -27,4 +27,12 @@
android:minWidth="@dimen/button_minWidth"
android:layout_gravity="center_horizontal"
/>
<Button
android:id="@+id/webdav"
android:text="@string/account_setup_account_type_webdav_action"
android:layout_height="wrap_content"
android:layout_width="150sp"
android:minWidth="@dimen/button_minWidth"
android:layout_gravity="center_horizontal"
/>
</LinearLayout>

View File

@ -94,6 +94,13 @@
android:layout_height="wrap_content"
android:layout_width="fill_parent" />
</LinearLayout>
<LinearLayout
android:id="@+id/webdav_path_prefix_section"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="0px"

View File

@ -161,12 +161,14 @@ Welcome to K-9 Mail setup. K-9 is an open source email client for Android based
<string name="account_setup_account_type_instructions">What type of account is this?</string>
<string name="account_setup_account_type_pop_action">POP3 account</string>
<string name="account_setup_account_type_imap_action">IMAP account</string>
<string name="account_setup_account_type_webdav_action">WebDav(Exchange) account</string>
<string name="account_setup_incoming_title">Incoming server settings</string>
<string name="account_setup_incoming_username_label">Username</string>
<string name="account_setup_incoming_password_label">Password</string>
<string name="account_setup_incoming_pop_server_label">POP3 server</string>
<string name="account_setup_incoming_imap_server_label">IMAP server</string>
<string name="account_setup_incoming_webdav_server_label">WebDav(Exchange) server</string>
<string name="account_setup_incoming_port_label">Port</string>
<string name="account_setup_incoming_security_label">Security type</string>
<string name="account_setup_incoming_security_none_label">None</string>
@ -180,6 +182,8 @@ Welcome to K-9 Mail setup. K-9 is an open source email client for Android based
<string name="account_setup_incoming_delete_policy_delete_label">When I delete from Inbox</string>
<string name="account_setup_incoming_imap_path_prefix_label">IMAP path prefix</string>
<string name="account_setup_incoming_imap_path_prefix_hint">Optional</string>
<string name="account_setup_incoming_webdav_path_prefix_label">WebDav(Exchange) path prefix</string>
<string name="account_setup_incoming_webdav_path_prefix_hint">Optional</string>
<string name="account_setup_outgoing_title">Outgoing server settings</string>
<string name="account_setup_outgoing_smtp_server_label">SMTP server</string>
@ -199,6 +203,7 @@ Welcome to K-9 Mail setup. K-9 is an open source email client for Android based
<string name="account_setup_outgoing_authentication_basic_password_label">Password</string>
<string name="account_setup_outgoing_authentication_pop_before_smtp_label">POP before SMTP</string>
<string name="account_setup_outgoing_authentication_imap_before_smtp_label">IMAP before SMTP</string>
<string name="account_setup_outgoing_authentication_webdav_before_smtp_label">WebDav(Exchange) before SMTP</string>
<string name="account_setup_options_title">Account options</string>
<string name="account_setup_options_mail_check_frequency_label">Email checking frequency</string>

View File

@ -91,91 +91,93 @@ public final class R {
public static final int text_box_light=0x7f020043;
}
public static final class id {
public static final int account_always_bcc=0x7f0a000b;
public static final int account_check_frequency=0x7f0a0018;
public static final int account_default=0x7f0a0005;
public static final int account_delete_policy=0x7f0a0013;
public static final int account_delete_policy_label=0x7f0a0012;
public static final int account_description=0x7f0a0016;
public static final int account_email=0x7f0a0002;
public static final int account_name=0x7f0a000a;
public static final int account_notify=0x7f0a0019;
public static final int account_password=0x7f0a0003;
public static final int account_port=0x7f0a0010;
public static final int account_require_login=0x7f0a001a;
public static final int account_require_login_settings=0x7f0a001b;
public static final int account_security_type=0x7f0a0011;
public static final int account_server=0x7f0a000f;
public static final int account_server_label=0x7f0a000e;
public static final int account_settings=0x7f0a004e;
public static final int account_signature=0x7f0a000c;
public static final int account_username=0x7f0a000d;
public static final int accounts=0x7f0a004d;
public static final int add_attachment=0x7f0a0053;
public static final int add_cc_bcc=0x7f0a004f;
public static final int add_new_account=0x7f0a001d;
public static final int attachment=0x7f0a003d;
public static final int attachment_delete=0x7f0a0033;
public static final int attachment_icon=0x7f0a0039;
public static final int attachment_info=0x7f0a003a;
public static final int attachment_name=0x7f0a0034;
public static final int attachments=0x7f0a002e;
public static final int bcc=0x7f0a002d;
public static final int cancel=0x7f0a0009;
public static final int cc=0x7f0a002c;
public static final int check_mail=0x7f0a0047;
public static final int chip=0x7f0a0024;
public static final int compose=0x7f0a0048;
public static final int date=0x7f0a0027;
public static final int debug_logging=0x7f0a0022;
public static final int delete=0x7f0a0038;
public static final int delete_account=0x7f0a0046;
public static final int description=0x7f0a001e;
public static final int discard=0x7f0a0052;
public static final int done=0x7f0a0017;
public static final int download=0x7f0a003b;
public static final int dump_settings=0x7f0a0049;
public static final int edit_account=0x7f0a0045;
public static final int email=0x7f0a001f;
public static final int empty=0x7f0a001c;
public static final int folder_name=0x7f0a0029;
public static final int folder_status=0x7f0a002a;
public static final int forward=0x7f0a004a;
public static final int from=0x7f0a0026;
public static final int account_always_bcc=0x7f0a000c;
public static final int account_check_frequency=0x7f0a001a;
public static final int account_default=0x7f0a0006;
public static final int account_delete_policy=0x7f0a0014;
public static final int account_delete_policy_label=0x7f0a0013;
public static final int account_description=0x7f0a0018;
public static final int account_email=0x7f0a0003;
public static final int account_name=0x7f0a000b;
public static final int account_notify=0x7f0a001b;
public static final int account_password=0x7f0a0004;
public static final int account_port=0x7f0a0011;
public static final int account_require_login=0x7f0a001c;
public static final int account_require_login_settings=0x7f0a001d;
public static final int account_security_type=0x7f0a0012;
public static final int account_server=0x7f0a0010;
public static final int account_server_label=0x7f0a000f;
public static final int account_settings=0x7f0a0050;
public static final int account_signature=0x7f0a000d;
public static final int account_username=0x7f0a000e;
public static final int accounts=0x7f0a004f;
public static final int add_attachment=0x7f0a0055;
public static final int add_cc_bcc=0x7f0a0051;
public static final int add_new_account=0x7f0a001f;
public static final int attachment=0x7f0a003f;
public static final int attachment_delete=0x7f0a0035;
public static final int attachment_icon=0x7f0a003b;
public static final int attachment_info=0x7f0a003c;
public static final int attachment_name=0x7f0a0036;
public static final int attachments=0x7f0a0030;
public static final int bcc=0x7f0a002f;
public static final int cancel=0x7f0a000a;
public static final int cc=0x7f0a002e;
public static final int check_mail=0x7f0a0049;
public static final int chip=0x7f0a0026;
public static final int compose=0x7f0a004a;
public static final int date=0x7f0a0029;
public static final int debug_logging=0x7f0a0024;
public static final int delete=0x7f0a003a;
public static final int delete_account=0x7f0a0048;
public static final int description=0x7f0a0020;
public static final int discard=0x7f0a0054;
public static final int done=0x7f0a0019;
public static final int download=0x7f0a003d;
public static final int dump_settings=0x7f0a004b;
public static final int edit_account=0x7f0a0047;
public static final int email=0x7f0a0021;
public static final int empty=0x7f0a001e;
public static final int folder_name=0x7f0a002b;
public static final int folder_status=0x7f0a002c;
public static final int forward=0x7f0a004c;
public static final int from=0x7f0a0028;
public static final int imap=0x7f0a0001;
public static final int imap_path_prefix=0x7f0a0015;
public static final int imap_path_prefix_section=0x7f0a0014;
public static final int main_text=0x7f0a0028;
public static final int manual_setup=0x7f0a0006;
public static final int mark_as_read=0x7f0a004b;
public static final int mark_as_unread=0x7f0a0054;
public static final int message=0x7f0a0007;
public static final int message_content=0x7f0a002f;
public static final int new_message_count=0x7f0a0020;
public static final int next=0x7f0a0004;
public static final int open=0x7f0a0044;
public static final int imap_path_prefix=0x7f0a0016;
public static final int imap_path_prefix_section=0x7f0a0015;
public static final int main_text=0x7f0a002a;
public static final int manual_setup=0x7f0a0007;
public static final int mark_as_read=0x7f0a004d;
public static final int mark_as_unread=0x7f0a0056;
public static final int message=0x7f0a0008;
public static final int message_content=0x7f0a0031;
public static final int new_message_count=0x7f0a0022;
public static final int next=0x7f0a0005;
public static final int open=0x7f0a0046;
public static final int pop=0x7f0a0000;
public static final int previous=0x7f0a0035;
public static final int progress=0x7f0a0008;
public static final int quoted_text=0x7f0a0032;
public static final int quoted_text_bar=0x7f0a0030;
public static final int quoted_text_delete=0x7f0a0031;
public static final int refresh=0x7f0a004c;
public static final int reply=0x7f0a0036;
public static final int reply_all=0x7f0a0037;
public static final int save=0x7f0a0051;
public static final int send=0x7f0a0050;
public static final int sensitive_logging=0x7f0a0023;
public static final int show_pictures=0x7f0a0041;
public static final int show_pictures_section=0x7f0a0040;
public static final int subject=0x7f0a0025;
public static final int text1=0x7f0a0042;
public static final int text2=0x7f0a0043;
public static final int to=0x7f0a002b;
public static final int to_container=0x7f0a003e;
public static final int to_label=0x7f0a003f;
public static final int version=0x7f0a0021;
public static final int view=0x7f0a003c;
public static final int previous=0x7f0a0037;
public static final int progress=0x7f0a0009;
public static final int quoted_text=0x7f0a0034;
public static final int quoted_text_bar=0x7f0a0032;
public static final int quoted_text_delete=0x7f0a0033;
public static final int refresh=0x7f0a004e;
public static final int reply=0x7f0a0038;
public static final int reply_all=0x7f0a0039;
public static final int save=0x7f0a0053;
public static final int send=0x7f0a0052;
public static final int sensitive_logging=0x7f0a0025;
public static final int show_pictures=0x7f0a0043;
public static final int show_pictures_section=0x7f0a0042;
public static final int subject=0x7f0a0027;
public static final int text1=0x7f0a0044;
public static final int text2=0x7f0a0045;
public static final int to=0x7f0a002d;
public static final int to_container=0x7f0a0040;
public static final int to_label=0x7f0a0041;
public static final int version=0x7f0a0023;
public static final int view=0x7f0a003e;
public static final int webdav=0x7f0a0002;
public static final int webdav_path_prefix_section=0x7f0a0017;
}
public static final class layout {
public static final int account_setup_account_type=0x7f030000;
@ -209,42 +211,43 @@ public final class R {
public static final int message_view_option=0x7f090006;
}
public static final class string {
public static final int account_delete_dlg_instructions_fmt=0x7f0600ca;
public static final int account_delete_dlg_title=0x7f0600c9;
public static final int account_delete_dlg_instructions_fmt=0x7f0600cf;
public static final int account_delete_dlg_title=0x7f0600ce;
public static final int account_settings_action=0x7f06001b;
public static final int account_settings_add_account_label=0x7f0600b9;
public static final int account_settings_always_bcc_label=0x7f0600c3;
public static final int account_settings_always_bcc_summary=0x7f0600c4;
public static final int account_settings_composition_label=0x7f0600c2;
public static final int account_settings_composition_title=0x7f0600c1;
public static final int account_settings_default=0x7f0600ad;
public static final int account_settings_default_label=0x7f0600ae;
public static final int account_settings_default_summary=0x7f0600af;
public static final int account_settings_description_label=0x7f0600ba;
public static final int account_settings_email_label=0x7f0600b1;
public static final int account_settings_incoming_label=0x7f0600b5;
public static final int account_settings_incoming_summary=0x7f0600b6;
public static final int account_settings_mail_check_frequency_label=0x7f0600b4;
public static final int account_settings_name_label=0x7f0600bb;
public static final int account_settings_notifications=0x7f0600bc;
public static final int account_settings_notify_label=0x7f0600b0;
public static final int account_settings_notify_summary=0x7f0600b2;
public static final int account_settings_outgoing_label=0x7f0600b7;
public static final int account_settings_outgoing_summary=0x7f0600b8;
public static final int account_settings_ringtone=0x7f0600bf;
public static final int account_settings_sent_items_label=0x7f0600c7;
public static final int account_settings_sent_items_summary=0x7f0600c8;
public static final int account_settings_servers=0x7f0600c0;
public static final int account_settings_show_combined_label=0x7f0600b3;
public static final int account_settings_signature_label=0x7f0600c5;
public static final int account_settings_signature_summary=0x7f0600c6;
public static final int account_settings_title_fmt=0x7f0600ac;
public static final int account_settings_vibrate_enable=0x7f0600bd;
public static final int account_settings_vibrate_summary=0x7f0600be;
public static final int account_settings_add_account_label=0x7f0600be;
public static final int account_settings_always_bcc_label=0x7f0600c8;
public static final int account_settings_always_bcc_summary=0x7f0600c9;
public static final int account_settings_composition_label=0x7f0600c7;
public static final int account_settings_composition_title=0x7f0600c6;
public static final int account_settings_default=0x7f0600b2;
public static final int account_settings_default_label=0x7f0600b3;
public static final int account_settings_default_summary=0x7f0600b4;
public static final int account_settings_description_label=0x7f0600bf;
public static final int account_settings_email_label=0x7f0600b6;
public static final int account_settings_incoming_label=0x7f0600ba;
public static final int account_settings_incoming_summary=0x7f0600bb;
public static final int account_settings_mail_check_frequency_label=0x7f0600b9;
public static final int account_settings_name_label=0x7f0600c0;
public static final int account_settings_notifications=0x7f0600c1;
public static final int account_settings_notify_label=0x7f0600b5;
public static final int account_settings_notify_summary=0x7f0600b7;
public static final int account_settings_outgoing_label=0x7f0600bc;
public static final int account_settings_outgoing_summary=0x7f0600bd;
public static final int account_settings_ringtone=0x7f0600c4;
public static final int account_settings_sent_items_label=0x7f0600cc;
public static final int account_settings_sent_items_summary=0x7f0600cd;
public static final int account_settings_servers=0x7f0600c5;
public static final int account_settings_show_combined_label=0x7f0600b8;
public static final int account_settings_signature_label=0x7f0600ca;
public static final int account_settings_signature_summary=0x7f0600cb;
public static final int account_settings_title_fmt=0x7f0600b1;
public static final int account_settings_vibrate_enable=0x7f0600c2;
public static final int account_settings_vibrate_summary=0x7f0600c3;
public static final int account_setup_account_type_imap_action=0x7f060079;
public static final int account_setup_account_type_instructions=0x7f060077;
public static final int account_setup_account_type_pop_action=0x7f060078;
public static final int account_setup_account_type_title=0x7f060076;
public static final int account_setup_account_type_webdav_action=0x7f06007a;
public static final int account_setup_basics_default_label=0x7f060069;
public static final int account_setup_basics_email_error_duplicate_fmt=0x7f060067;
public static final int account_setup_basics_email_error_invalid_fmt=0x7f060066;
@ -260,74 +263,78 @@ public final class R {
public static final int account_setup_check_settings_finishing_msg=0x7f06006f;
public static final int account_setup_check_settings_retr_info_msg=0x7f06006c;
public static final int account_setup_check_settings_title=0x7f06006b;
public static final int account_setup_failed_dlg_auth_message_fmt=0x7f0600a8;
public static final int account_setup_failed_dlg_auth_message_fmt=0x7f0600ad;
/** Username or password incorrect\n(ERR01 Account does not exist)
*/
public static final int account_setup_failed_dlg_certificate_message_fmt=0x7f0600a9;
public static final int account_setup_failed_dlg_certificate_message_fmt=0x7f0600ae;
/** Cannot connect to server\n(Connection timed out)
*/
public static final int account_setup_failed_dlg_edit_details_action=0x7f0600ab;
public static final int account_setup_failed_dlg_invalid_certificate_accept=0x7f0600ce;
public static final int account_setup_failed_dlg_invalid_certificate_reject=0x7f0600cf;
public static final int account_setup_failed_dlg_invalid_certificate_title=0x7f0600cd;
public static final int account_setup_failed_dlg_edit_details_action=0x7f0600b0;
public static final int account_setup_failed_dlg_invalid_certificate_accept=0x7f0600d3;
public static final int account_setup_failed_dlg_invalid_certificate_reject=0x7f0600d4;
public static final int account_setup_failed_dlg_invalid_certificate_title=0x7f0600d2;
/** Cannot safely connect to server\n(Invalid certificate)
*/
public static final int account_setup_failed_dlg_server_message_fmt=0x7f0600aa;
public static final int account_setup_failed_dlg_title=0x7f0600a7;
public static final int account_setup_failed_dlg_server_message_fmt=0x7f0600af;
public static final int account_setup_failed_dlg_title=0x7f0600ac;
public static final int account_setup_finished_toast=0x7f060075;
public static final int account_setup_incoming_delete_policy_7days_label=0x7f060088;
public static final int account_setup_incoming_delete_policy_delete_label=0x7f060089;
public static final int account_setup_incoming_delete_policy_label=0x7f060086;
public static final int account_setup_incoming_delete_policy_never_label=0x7f060087;
public static final int account_setup_incoming_imap_path_prefix_hint=0x7f06008b;
public static final int account_setup_incoming_imap_path_prefix_label=0x7f06008a;
public static final int account_setup_incoming_imap_server_label=0x7f06007e;
public static final int account_setup_incoming_password_label=0x7f06007c;
public static final int account_setup_incoming_pop_server_label=0x7f06007d;
public static final int account_setup_incoming_port_label=0x7f06007f;
public static final int account_setup_incoming_security_label=0x7f060080;
public static final int account_setup_incoming_security_none_label=0x7f060081;
public static final int account_setup_incoming_security_ssl_label=0x7f060083;
public static final int account_setup_incoming_security_ssl_optional_label=0x7f060082;
public static final int account_setup_incoming_security_tls_label=0x7f060085;
public static final int account_setup_incoming_security_tls_optional_label=0x7f060084;
public static final int account_setup_incoming_title=0x7f06007a;
public static final int account_setup_incoming_username_label=0x7f06007b;
public static final int account_setup_incoming_delete_policy_7days_label=0x7f06008a;
public static final int account_setup_incoming_delete_policy_delete_label=0x7f06008b;
public static final int account_setup_incoming_delete_policy_label=0x7f060088;
public static final int account_setup_incoming_delete_policy_never_label=0x7f060089;
public static final int account_setup_incoming_imap_path_prefix_hint=0x7f06008d;
public static final int account_setup_incoming_imap_path_prefix_label=0x7f06008c;
public static final int account_setup_incoming_imap_server_label=0x7f06007f;
public static final int account_setup_incoming_password_label=0x7f06007d;
public static final int account_setup_incoming_pop_server_label=0x7f06007e;
public static final int account_setup_incoming_port_label=0x7f060081;
public static final int account_setup_incoming_security_label=0x7f060082;
public static final int account_setup_incoming_security_none_label=0x7f060083;
public static final int account_setup_incoming_security_ssl_label=0x7f060085;
public static final int account_setup_incoming_security_ssl_optional_label=0x7f060084;
public static final int account_setup_incoming_security_tls_label=0x7f060087;
public static final int account_setup_incoming_security_tls_optional_label=0x7f060086;
public static final int account_setup_incoming_title=0x7f06007b;
public static final int account_setup_incoming_username_label=0x7f06007c;
public static final int account_setup_incoming_webdav_path_prefix_hint=0x7f06008f;
public static final int account_setup_incoming_webdav_path_prefix_label=0x7f06008e;
public static final int account_setup_incoming_webdav_server_label=0x7f060080;
public static final int account_setup_names_account_name_label=0x7f060073;
public static final int account_setup_names_instructions=0x7f060072;
public static final int account_setup_names_title=0x7f060071;
public static final int account_setup_names_user_name_label=0x7f060074;
public static final int account_setup_options_default_label=0x7f0600a5;
public static final int account_setup_options_mail_check_frequency_10min=0x7f0600a1;
public static final int account_setup_options_mail_check_frequency_15min=0x7f0600a2;
public static final int account_setup_options_mail_check_frequency_1hour=0x7f0600a4;
public static final int account_setup_options_mail_check_frequency_30min=0x7f0600a3;
public static final int account_setup_options_mail_check_frequency_5min=0x7f0600a0;
public static final int account_setup_options_mail_check_frequency_label=0x7f06009e;
public static final int account_setup_options_default_label=0x7f0600aa;
public static final int account_setup_options_mail_check_frequency_10min=0x7f0600a6;
public static final int account_setup_options_mail_check_frequency_15min=0x7f0600a7;
public static final int account_setup_options_mail_check_frequency_1hour=0x7f0600a9;
public static final int account_setup_options_mail_check_frequency_30min=0x7f0600a8;
public static final int account_setup_options_mail_check_frequency_5min=0x7f0600a5;
public static final int account_setup_options_mail_check_frequency_label=0x7f0600a3;
/** Frequency also used in account_settings_*
*/
public static final int account_setup_options_mail_check_frequency_never=0x7f06009f;
public static final int account_setup_options_notify_label=0x7f0600a6;
public static final int account_setup_options_title=0x7f06009d;
public static final int account_setup_outgoing_authentication_basic_label=0x7f060098;
public static final int account_setup_outgoing_authentication_basic_password_label=0x7f06009a;
public static final int account_setup_outgoing_authentication_basic_username_label=0x7f060099;
public static final int account_setup_outgoing_authentication_imap_before_smtp_label=0x7f06009c;
public static final int account_setup_options_mail_check_frequency_never=0x7f0600a4;
public static final int account_setup_options_notify_label=0x7f0600ab;
public static final int account_setup_options_title=0x7f0600a2;
public static final int account_setup_outgoing_authentication_basic_label=0x7f06009c;
public static final int account_setup_outgoing_authentication_basic_password_label=0x7f06009e;
public static final int account_setup_outgoing_authentication_basic_username_label=0x7f06009d;
public static final int account_setup_outgoing_authentication_imap_before_smtp_label=0x7f0600a0;
/** The authentication strings below are for a planned (hopefully) change to the above username and password options
*/
public static final int account_setup_outgoing_authentication_label=0x7f060097;
public static final int account_setup_outgoing_authentication_pop_before_smtp_label=0x7f06009b;
public static final int account_setup_outgoing_password_label=0x7f060096;
public static final int account_setup_outgoing_port_label=0x7f06008e;
public static final int account_setup_outgoing_require_login_label=0x7f060094;
public static final int account_setup_outgoing_security_label=0x7f06008f;
public static final int account_setup_outgoing_security_none_label=0x7f060090;
public static final int account_setup_outgoing_security_ssl_label=0x7f060091;
public static final int account_setup_outgoing_security_tls_label=0x7f060093;
public static final int account_setup_outgoing_security_tls_optional_label=0x7f060092;
public static final int account_setup_outgoing_smtp_server_label=0x7f06008d;
public static final int account_setup_outgoing_title=0x7f06008c;
public static final int account_setup_outgoing_username_label=0x7f060095;
public static final int account_setup_outgoing_authentication_label=0x7f06009b;
public static final int account_setup_outgoing_authentication_pop_before_smtp_label=0x7f06009f;
public static final int account_setup_outgoing_authentication_webdav_before_smtp_label=0x7f0600a1;
public static final int account_setup_outgoing_password_label=0x7f06009a;
public static final int account_setup_outgoing_port_label=0x7f060092;
public static final int account_setup_outgoing_require_login_label=0x7f060098;
public static final int account_setup_outgoing_security_label=0x7f060093;
public static final int account_setup_outgoing_security_none_label=0x7f060094;
public static final int account_setup_outgoing_security_ssl_label=0x7f060095;
public static final int account_setup_outgoing_security_tls_label=0x7f060097;
public static final int account_setup_outgoing_security_tls_optional_label=0x7f060096;
public static final int account_setup_outgoing_smtp_server_label=0x7f060091;
public static final int account_setup_outgoing_title=0x7f060090;
public static final int account_setup_outgoing_username_label=0x7f060099;
public static final int accounts_action=0x7f06001d;
public static final int accounts_context_menu_title=0x7f060029;
public static final int accounts_title=0x7f060004;
@ -413,8 +420,8 @@ public final class R {
public static final int okay_action=0x7f060008;
public static final int open_action=0x7f06001a;
public static final int preferences_action=0x7f060019;
public static final int provider_note_live=0x7f0600cc;
public static final int provider_note_yahoo=0x7f0600cb;
public static final int provider_note_live=0x7f0600d1;
public static final int provider_note_yahoo=0x7f0600d0;
public static final int read_action=0x7f06001e;
public static final int read_attachment_desc=0x7f060003;
public static final int read_attachment_label=0x7f060002;

View File

@ -42,6 +42,7 @@ public class AccountSetupAccountType extends Activity implements OnClickListener
setContentView(R.layout.account_setup_account_type);
((Button)findViewById(R.id.pop)).setOnClickListener(this);
((Button)findViewById(R.id.imap)).setOnClickListener(this);
((Button)findViewById(R.id.webdav)).setOnClickListener(this);
mAccount = (Account)getIntent().getSerializableExtra(EXTRA_ACCOUNT);
mMakeDefault = (boolean)getIntent().getBooleanExtra(EXTRA_MAKE_DEFAULT, false);
@ -77,6 +78,21 @@ public class AccountSetupAccountType extends Activity implements OnClickListener
finish();
}
private void onWebDav() {
try {
URI uri = new URI(mAccount.getStoreUri());
uri = new URI("webdav", uri.getUserInfo(), uri.getHost(), uri.getPort(), null, null, null);
mAccount.setStoreUri(uri.toString());
} catch (URISyntaxException use) {
/*
* This should not happen.
*/
throw new Error(use);
}
AccountSetupIncoming.actionIncomingSettings(this, mAccount, mMakeDefault);
finish();
}
public void onClick(View v) {
switch (v.getId()) {
case R.id.pop:
@ -85,6 +101,9 @@ public class AccountSetupAccountType extends Activity implements OnClickListener
case R.id.imap:
onImap();
break;
case R.id.webdav:
onWebDav();
break;
}
}
}

View File

@ -40,6 +40,12 @@ public class AccountSetupIncoming extends Activity implements OnClickListener {
private static final String imapSchemes[] = {
"imap", "imap+ssl", "imap+ssl+", "imap+tls", "imap+tls+"
};
private static final int webdavPorts[] = {
80, 443, 443, 443, 443
};
private static final String webdavSchemes[] = {
"webdav", "webdav+ssl", "webdav+ssl+", "webdav+tls", "webdav+tls+"
};
private int mAccountPorts[];
private String mAccountSchemes[];
@ -200,6 +206,10 @@ public class AccountSetupIncoming extends Activity implements OnClickListener {
if (uri.getPath() != null && uri.getPath().length() > 0) {
mImapPathPrefixView.setText(uri.getPath().substring(1));
}
} else if (uri.getScheme().startsWith("webdav")) {
serverLabelView.setText(R.string.account_setup_incoming_webdav_server_label);
mAccountPorts = webdavPorts;
mAccountSchemes = webdavSchemes;
} else {
throw new Error("Unknown account type: " + mAccount.getStoreUri());
}

View File

@ -41,6 +41,12 @@ public class AccountSetupOutgoing extends Activity implements OnClickListener,
private static final String smtpSchemes[] = {
"smtp", "smtp+ssl", "smtp+ssl+", "smtp+tls", "smtp+tls+"
};
private static final int webdavPorts[] = {
80, 443, 443, 443, 443
};
private static final String webdavSchemes[] = {
"webdav", "webdav+ssl", "webdav+ssl+", "webdav+tls", "webdav+tls+"
};
private EditText mUsernameView;
private EditText mPasswordView;
@ -72,6 +78,19 @@ public class AccountSetupOutgoing extends Activity implements OnClickListener,
super.onCreate(savedInstanceState);
setContentView(R.layout.account_setup_outgoing);
mAccount = (Account)getIntent().getSerializableExtra(EXTRA_ACCOUNT);
try {
if (new URI(mAccount.getStoreUri()).getScheme().startsWith("webdav")) {
mAccount.setTransportUri(mAccount.getStoreUri());
AccountSetupCheckSettings.actionCheckSettings(this, mAccount, false, true);
}
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
mUsernameView = (EditText)findViewById(R.id.account_username);
mPasswordView = (EditText)findViewById(R.id.account_password);
mServerView = (EditText)findViewById(R.id.account_server);

View File

@ -64,13 +64,14 @@ public class k9 extends Application {
* The MIME type(s) of attachments we're willing to download to SD.
*/
public static final String[] ACCEPTABLE_ATTACHMENT_DOWNLOAD_TYPES = new String[] {
"*/*",
"image/*",
};
/**
* The MIME type(s) of attachments we're not willing to download to SD.
*/
public static final String[] UNACCEPTABLE_ATTACHMENT_DOWNLOAD_TYPES = new String[] {
"image/gif",
};
/**
@ -87,7 +88,7 @@ public class k9 extends Application {
public static final int DEFAULT_VISIBLE_LIMIT = 100;
/**
* Number of additional messages to load when a user selectes "Load more messages..."
* Number of additioanl messages to load when a user selectes "Load more messages..."
*/
public static final int VISIBLE_LIMIT_INCREMENT = 100;
@ -157,13 +158,6 @@ public class k9 extends Application {
* doesn't work in Android and MimeMessage does not have access to a Context.
*/
BinaryTempFileBody.setTempDirectory(getCacheDir());
/*
* Enable background sync of messages
*/
setServicesEnabled(this);
}
}

View File

@ -8,6 +8,7 @@ import android.app.Application;
import com.fsck.k9.mail.store.ImapStore;
import com.fsck.k9.mail.store.LocalStore;
import com.fsck.k9.mail.store.Pop3Store;
import com.fsck.k9.mail.store.WebDavStore;
/**
* Store is the access point for an email message store. It's location can be
@ -54,8 +55,11 @@ public abstract class Store {
store = new Pop3Store(uri);
} else if (uri.startsWith("local")) {
store = new LocalStore(uri, application);
} else if (uri.startsWith("webdav")) {
store = new WebDavStore(uri);
}
if (store != null) {
mStores.put(uri, store);
}

View File

@ -2,6 +2,7 @@
package com.fsck.k9.mail;
import com.fsck.k9.mail.transport.SmtpTransport;
import com.fsck.k9.mail.transport.WebDavTransport;
public abstract class Transport {
protected static final int SOCKET_CONNECT_TIMEOUT = 10000;
@ -9,6 +10,8 @@ public abstract class Transport {
public synchronized static Transport getInstance(String uri) throws MessagingException {
if (uri.startsWith("smtp")) {
return new SmtpTransport(uri);
} else if (uri.startsWith("webdav")) {
return new WebDavTransport(uri);
} else {
throw new MessagingException("Unable to locate an applicable Transport for " + uri);
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,189 @@
package com.fsck.k9.mail.transport;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketAddress;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.security.GeneralSecurityException;
import java.security.SecureRandom;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.SSLException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.CookieStore;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import android.util.Config;
import android.util.Log;
import com.fsck.k9.k9;
import com.fsck.k9.PeekableInputStream;
import com.fsck.k9.codec.binary.Base64;
import com.fsck.k9.mail.Address;
import com.fsck.k9.mail.AuthenticationFailedException;
import com.fsck.k9.mail.Folder;
import com.fsck.k9.mail.Message;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.Transport;
import com.fsck.k9.mail.CertificateValidationException;
import com.fsck.k9.mail.Message.RecipientType;
import com.fsck.k9.mail.store.TrustManagerFactory;
import com.fsck.k9.mail.store.WebDavStore;
import com.fsck.k9.mail.store.WebDavStore.HttpGeneric;
import com.fsck.k9.mail.store.WebDavStore.ParsedDataSet;
import com.fsck.k9.mail.store.WebDavStore.WebDavHandler;
public class WebDavTransport extends Transport {
public static final int CONNECTION_SECURITY_NONE = 0;
public static final int CONNECTION_SECURITY_TLS_OPTIONAL = 1;
public static final int CONNECTION_SECURITY_TLS_REQUIRED = 2;
public static final int CONNECTION_SECURITY_SSL_REQUIRED = 3;
public static final int CONNECTION_SECURITY_SSL_OPTIONAL = 4;
String host;
int mPort;
private int mConnectionSecurity;
private String mUsername; /* Stores the username for authentications */
private String mPassword; /* Stores the password for authentications */
private String mUrl; /* Stores the base URL for the server */
boolean mSecure;
Socket mSocket;
PeekableInputStream mIn;
OutputStream mOut;
private WebDavStore store;
/**
* webdav://user:password@server:port CONNECTION_SECURITY_NONE
* webdav+tls://user:password@server:port CONNECTION_SECURITY_TLS_OPTIONAL
* webdav+tls+://user:password@server:port CONNECTION_SECURITY_TLS_REQUIRED
* webdav+ssl+://user:password@server:port CONNECTION_SECURITY_SSL_REQUIRED
* webdav+ssl://user:password@server:port CONNECTION_SECURITY_SSL_OPTIONAL
*
* @param _uri
*/
public WebDavTransport(String _uri) throws MessagingException {
store = new WebDavStore(_uri);
Log.d(k9.LOG_TAG, ">>> New WebDavTransport creation complete");
}
public void open() throws MessagingException {
Log.d(k9.LOG_TAG, ">>> open called on WebDavTransport ");
if (store.needAuth()) {
store.authenticate();
}
if (store.getAuthCookies() == null) {
return;
}
}
// public void sendMessage(Message message) throws MessagingException {
// Address[] from = message.getFrom();
//
// }
public void close() {
}
public String generateTempURI(String subject) {
String encodedSubject = URLEncoder.encode(subject);
return store.getUrl() + "/Exchange/" + store.getAlias() + "/drafts/" + encodedSubject + ".eml";
}
public String generateSendURI() {
return store.getUrl() + "/Exchange/" + store.getAlias() + "/##DavMailSubmissionURI##/";
}
public void sendMessage(Message message) throws MessagingException {
Log.d(k9.LOG_TAG, ">>> sendMessage called.");
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpGeneric httpmethod;
HttpResponse response;
HttpEntity responseEntity;
StringEntity bodyEntity;
int statusCode;
String subject;
ByteArrayOutputStream out;
try {
try {
subject = message.getSubject();
} catch (MessagingException e) {
Log.e(k9.LOG_TAG, "MessagingException while retrieving Subject: " + e);
subject = "";
}
try {
out = new ByteArrayOutputStream(message.getSize());
} catch (MessagingException e) {
Log.e(k9.LOG_TAG, "MessagingException while getting size of message: " + e);
out = new ByteArrayOutputStream();
}
open();
message.writeTo(
new EOLConvertingOutputStream(
new BufferedOutputStream(out, 1024)));
httpclient.setCookieStore(store.getAuthCookies());
bodyEntity = new StringEntity(out.toString(), "UTF-8");
bodyEntity.setContentType("message/rfc822");
httpmethod = store.new HttpGeneric(generateTempURI(subject));
httpmethod.setMethod("PUT");
httpmethod.setEntity(bodyEntity);
response = httpclient.execute(httpmethod);
statusCode = response.getStatusLine().getStatusCode();
if (statusCode < 200 ||
statusCode > 300) {
throw new IOException("Error sending message, status code was " + statusCode);
}
//responseEntity = response.getEntity();
//DefaultHttpClient movehttpclient = new DefaultHttpClient();
//HttpGeneric movehttpmethod;
//HttpResponse moveresponse;
//HttpEntity moveresponseEntity;
httpmethod = store.new HttpGeneric(generateTempURI(subject));
httpmethod.setMethod("MOVE");
httpmethod.setHeader("Destination", generateSendURI());
response = httpclient.execute(httpmethod);
statusCode = response.getStatusLine().getStatusCode();
if (statusCode < 200 ||
statusCode > 300) {
throw new IOException("Error sending message, status code was " + statusCode);
}
} catch (UnsupportedEncodingException uee) {
Log.e(k9.LOG_TAG, "UnsupportedEncodingException in getMessageCount() " + uee);
} catch (IOException ioe) {
Log.e(k9.LOG_TAG, "IOException in getMessageCount() " + ioe);
throw new MessagingException("Unable to send message", ioe);
}
Log.d(k9.LOG_TAG, ">>> getMessageCount finished");
}
}