Skip to content

Commit

Permalink
Merge branch 'release/8.8.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
grishick committed Jan 25, 2018
2 parents 013d906 + 0cca44d commit 71b43f8
Show file tree
Hide file tree
Showing 161 changed files with 7,032 additions and 3,617 deletions.
4 changes: 1 addition & 3 deletions build-common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,7 @@
<fileset dir="${test.src.dir}">
<include name="${test.pattern}"/>
<exclude name="**/Abstract*Test.java"/>
<exclude name="**/cs/mailbox/ContactTest.java"/>
<exclude name="**/cs/imap/ImapHandlerTest.java"/>
<exclude name="**/cs/filter/FileIntoCopyTest.java"/>
<exclude name="**/mailbox/ContactTest.java"/>
</fileset>
</batchtest>
</junit>
Expand Down
2 changes: 1 addition & 1 deletion client/src/java/com/zimbra/client/ZDataSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public ZDataSource(DataSource data) {
}

public DataSource toJaxb() {
MailUnknownDataSource jaxbObject = new MailUnknownDataSource();
MailDataSource jaxbObject = new MailDataSource();
jaxbObject.setId(data.getId());
jaxbObject.setName(data.getName());
jaxbObject.setEnabled(data.isEnabled());
Expand Down
12 changes: 10 additions & 2 deletions client/src/java/com/zimbra/client/ZFolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public class ZFolder implements ZItem, FolderStore, Comparable<Object>, ToZJSONO
private RetentionPolicy mRetentionPolicy = new RetentionPolicy();
private boolean mActiveSyncDisabled;
private Boolean mDeletable = null;
private int mImapRECENTCutoff;
private Integer mImapRECENTCutoff = null;


@Override
Expand Down Expand Up @@ -743,6 +743,14 @@ public int getImapRECENTCutoff(boolean inWritableSession) {
} catch (ServiceException e) {
ZimbraLog.imap.warn("Error retrieving last item ID in mailbox", e);
}
if (mImapRECENTCutoff == null) {
try {
mImapRECENTCutoff = mMailbox.getImapRECENTCutoff(mId);
} catch (ServiceException e) {
ZimbraLog.mailbox.info("Problem determining IMAP RECENTCutoff for %s assuming 0", this, e);
mImapRECENTCutoff = 0;
}
}
return mImapRECENTCutoff;
}

Expand Down Expand Up @@ -998,7 +1006,7 @@ public void clearGrants() throws ServiceException {
public void rename(String newPath) throws ServiceException { mMailbox.renameFolder(mId, newPath); }

public void updateImapRECENTCutoff(int lastItemId) {
if (mImapRECENTCutoff < lastItemId) {
if ((mImapRECENTCutoff == null) || (mImapRECENTCutoff < lastItemId)) {
mImapRECENTCutoff = lastItemId;
}
}
Expand Down
7 changes: 7 additions & 0 deletions client/src/java/com/zimbra/client/ZMailbox.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@
import com.zimbra.soap.mail.message.GetFilterRulesResponse;
import com.zimbra.soap.mail.message.GetFolderRequest;
import com.zimbra.soap.mail.message.GetFolderResponse;
import com.zimbra.soap.mail.message.GetIMAPRecentCutoffRequest;
import com.zimbra.soap.mail.message.GetIMAPRecentCutoffResponse;
import com.zimbra.soap.mail.message.GetIMAPRecentRequest;
import com.zimbra.soap.mail.message.GetIMAPRecentResponse;
import com.zimbra.soap.mail.message.GetLastItemIdInMailboxRequest;
Expand Down Expand Up @@ -6506,6 +6508,11 @@ public int getImapRECENT(String folderId) throws ServiceException {
return resp.getNum();
}

public int getImapRECENTCutoff(String folderId) throws ServiceException {
GetIMAPRecentCutoffResponse resp = invokeJaxb(new GetIMAPRecentCutoffRequest(folderId));
return resp.getCutoff();
}

/** @return List of IMAP UIDs */
public List<Integer> imapCopy(int[] itemIds, MailItemType type, int folderId) throws ServiceException {
List<Integer> result = Lists.newArrayList();
Expand Down
37 changes: 34 additions & 3 deletions common/src/java/com/zimbra/common/account/ZAttrProvisioning.java
Original file line number Diff line number Diff line change
Expand Up @@ -1783,7 +1783,8 @@ public static PrefDelegatedSendSaveTarget fromString(String s) throws ServiceExc
public static enum PrefExternalSendersType {
ALL("ALL"),
ALLNOTINAB("ALLNOTINAB"),
INAB("INAB");
INAB("INAB"),
INSD("INSD");
private String mValue;
private PrefExternalSendersType(String value) { mValue = value; }
public String toString() { return mValue; }
Expand All @@ -1796,6 +1797,7 @@ public static PrefExternalSendersType fromString(String s) throws ServiceExcepti
public boolean isALL() { return this == ALL;}
public boolean isALLNOTINAB() { return this == ALLNOTINAB;}
public boolean isINAB() { return this == INAB;}
public boolean isINSD() { return this == INSD;}
}

public static enum PrefFileSharingApplication {
Expand Down Expand Up @@ -6288,6 +6290,14 @@ public static TwoFactorAuthSecretEncoding fromString(String s) throws ServiceExc
@ZAttr(id=806)
public static final String A_zimbraFeatureConfirmationPageEnabled = "zimbraFeatureConfirmationPageEnabled";

/**
* Enable contact backup feature
*
* @since ZCS 8.8.5
*/
@ZAttr(id=2131)
public static final String A_zimbraFeatureContactBackupEnabled = "zimbraFeatureContactBackupEnabled";

/**
* Sleep time between subsequent contact backups. 0 means that contact
* backup is disabled. . Must be in valid duration format:
Expand Down Expand Up @@ -7992,7 +8002,7 @@ public static TwoFactorAuthSecretEncoding fromString(String s) throws ServiceExc
/**
* Determines the load-balancing algorithm used to select an IMAP server
* from the pool of available zimbraReverseProxyUpstreamImapServers.
* Valid values are ClientIpHash, custom:{handler-algorithm} [arg1 arg2
* Valid values are AccountIdHash, custom:{handler-algorithm} [arg1 arg2
* ...]
*
* @since ZCS 8.7.6
Expand Down Expand Up @@ -12788,7 +12798,8 @@ public static TwoFactorAuthSecretEncoding fromString(String s) throws ServiceExc
* &quot;ALL&quot; minus users who are in the recipient&#039;s address
* book. &quot;INAB&quot; Users/Addresses whose domain doesn&#039;t match
* the recipient&#039;s domain or zimbraInternalSendersDomain and which
* are present in recipient&#039;s address book.
* are present in recipient&#039;s address book. &quot;INSD&quot; means
* users whose domain matches the specific domain
*
* @since ZCS 8.0.0
*/
Expand Down Expand Up @@ -13497,6 +13508,14 @@ public static TwoFactorAuthSecretEncoding fromString(String s) throws ServiceExc
@ZAttr(id=59)
public static final String A_zimbraPrefOutOfOfficeReplyEnabled = "zimbraPrefOutOfOfficeReplyEnabled";

/**
* Specific domains to which custom out of office message is to be sent
*
* @since ZCS 8.8.5
*/
@ZAttr(id=2132)
public static final String A_zimbraPrefOutOfOfficeSpecificDomains = "zimbraPrefOutOfOfficeSpecificDomains";

/**
* when user has OOO message enabled, when they login into web client,
* whether to alert the user that the OOO message is turned on and
Expand Down Expand Up @@ -14939,6 +14958,18 @@ public static TwoFactorAuthSecretEncoding fromString(String s) throws ServiceExc
@ZAttr(id=1360)
public static final String A_zimbraReverseProxySSLToUpstreamEnabled = "zimbraReverseProxySSLToUpstreamEnabled";

/**
* Configure the default server block in
* &#039;nginx.conf.web.https?.default.template&#039; to return a default
* HTTP response for all unconfigured host names. See also related
* attributes &#039;zimbraVirtualHostname&#039; and
* &#039;zimbraVirtualIPAddress&#039;.
*
* @since ZCS 8.8.6
*/
@ZAttr(id=3020)
public static final String A_zimbraReverseProxyStrictServerNameEnabled = "zimbraReverseProxyStrictServerNameEnabled";

/**
* The connect timeout is the time interval after which NGINX will
* disconnect while establishing an upstream HTTP connection. Measured in
Expand Down
9 changes: 5 additions & 4 deletions common/src/java/com/zimbra/common/localconfig/LC.java
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ static void init() {
public static final KnownKey cbpolicyd_pid_file = KnownKey.newKey("${zimbra_log_directory}/cbpolicyd.pid");
public static final KnownKey cbpolicyd_log_file = KnownKey.newKey("${zimbra_log_directory}/cbpolicyd.log");
public static final KnownKey cbpolicyd_db_file = KnownKey.newKey("${zimbra_home}/data/cbpolicyd/db/cbpolicyd.sqlitedb");
public static final KnownKey cbpolicyd_cache_file = KnownKey.newKey("${zimbra_home}/data/cache");
public static final KnownKey cbpolicyd_cache_file = KnownKey.newKey("${zimbra_home}/data/cbpolicyd/cbpolicyd.cache");
public static final KnownKey cbpolicyd_log_mail = KnownKey.newKey("main");
public static final KnownKey cbpolicyd_log_detail = KnownKey.newKey("modules");

Expand Down Expand Up @@ -605,15 +605,15 @@ static void init() {
" -Dorg.apache.jasper.compiler.disablejsr199=true" +
" -XX:+UseConcMarkSweepGC" +
" -XX:SoftRefLRUPolicyMSPerMB=1" +
" -XX:-OmitStackTraceInFastThrow" +
" -verbose:gc" +
" -XX:+PrintGCDetails" +
" -XX:+PrintGCDateStamps" +
" -XX:+PrintGCApplicationStoppedTime" +
" -XX:-OmitStackTraceInFastThrow" +
" -Xloggc:/opt/zimbra/log/gc.log" +
" -XX:-UseGCLogFileRotation" +
" -XX:+UseGCLogFileRotation" +
" -XX:NumberOfGCLogFiles=20" +
" -XX:GCLogFileSize=4096K");
" -XX:GCLogFileSize=10M");
@Supported
public static final KnownKey mailboxd_pidfile = KnownKey.newKey("${zimbra_log_directory}/mailboxd.pid");

Expand Down Expand Up @@ -936,6 +936,7 @@ static void init() {
public static final KnownKey yauth_baseuri = KnownKey.newKey("https://login.yahoo.com/WSLogin/V1");

public static final KnownKey purge_initial_sleep_ms = KnownKey.newKey(30 * Constants.MILLIS_PER_MINUTE);
public static final KnownKey contact_backup_initial_sleep_ms = KnownKey.newKey(10 * Constants.MILLIS_PER_MINUTE);

public static final KnownKey conversation_max_age_ms = KnownKey.newKey(31 * Constants.MILLIS_PER_DAY);
public static final KnownKey tombstone_max_age_ms = KnownKey.newKey(3 * Constants.MILLIS_PER_MONTH);
Expand Down
12 changes: 12 additions & 0 deletions common/src/java/com/zimbra/common/soap/MailConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ private MailConstants() {
public static final String E_RECORD_IMAP_SESSION_RESPONSE = "RecordIMAPSessionResponse";
public static final String E_GET_IMAP_RECENT_REQUEST = "GetIMAPRecentRequest";
public static final String E_GET_IMAP_RECENT_RESPONSE = "GetIMAPRecentResponse";
public static final String E_GET_IMAP_RECENT_CUTOFF_REQUEST = "GetIMAPRecentCutoffRequest";
public static final String E_GET_IMAP_RECENT_CUTOFF_RESPONSE = "GetIMAPRecentCutoffResponse";
public static final String E_IMAP_COPY_REQUEST = "IMAPCopyRequest";
public static final String E_IMAP_COPY_RESPONSE = "IMAPCopyResponse";

Expand Down Expand Up @@ -588,6 +590,8 @@ private MailConstants() {
public static final QName BEGIN_TRACKING_IMAP_RESPONSE = QName.get(E_BEGIN_TRACKING_IMAP_RESPONSE, NAMESPACE);
public static final QName GET_IMAP_RECENT_REQUEST = QName.get(E_GET_IMAP_RECENT_REQUEST, NAMESPACE);
public static final QName GET_IMAP_RECENT_RESPONSE = QName.get(E_GET_IMAP_RECENT_RESPONSE, NAMESPACE);
public static final QName GET_IMAP_RECENT_CUTOFF_REQUEST = QName.get(E_GET_IMAP_RECENT_CUTOFF_REQUEST, NAMESPACE);
public static final QName GET_IMAP_RECENT_CUTOFF_RESPONSE = QName.get(E_GET_IMAP_RECENT_CUTOFF_RESPONSE, NAMESPACE);
public static final QName RECORD_IMAP_SESSION_REQUEST = QName.get(E_RECORD_IMAP_SESSION_REQUEST, NAMESPACE);
public static final QName RECORD_IMAP_SESSION_RESPONSE = QName.get(E_RECORD_IMAP_SESSION_RESPONSE, NAMESPACE);
public static final QName IMAP_COPY_REQUEST = QName.get(E_IMAP_COPY_REQUEST, NAMESPACE);
Expand Down Expand Up @@ -782,6 +786,7 @@ private MailConstants() {
public static final String A_IMAP_NUM = "i4n";
public static final String A_IMAP_MODSEQ = "i4ms";
public static final String A_IMAP_UIDNEXT = "i4next";
public static final String A_IMAP_RECENT_CUTOFF = "cutoff";
public static final String A_TOTAL_SIZE = "total";
public static final String A_OPERATION = "op";
public static final String A_RECURSIVE = "recursive";
Expand Down Expand Up @@ -1348,4 +1353,11 @@ private MailConstants() {
public static final String A_CONTACTS_BACKUP_FILE_NAME = "contactsBackupFileName";
public static final String A_CONTACTS_RESTORE_RESOLVE = "resolve";
public static final String A_CONTACTS_BACKUP_FOLDER_NAME = "ContactsBackup";

// SearchAction API
public static final String E_SEARCH_ACTION_REQUEST = "SearchActionRequest";
public static final String E_SEARCH_ACTION_RESPONSE = "SearchActionResponse";
public static final String E_BULK_ACTION = "BulkAction";
public static final QName SEARCH_ACTION_REQUEST = QName.get(E_SEARCH_ACTION_REQUEST, NAMESPACE);
public static final QName SEARCH_ACTION_RESPONSE = QName.get(E_SEARCH_ACTION_RESPONSE, NAMESPACE);
}
6 changes: 6 additions & 0 deletions common/src/java/com/zimbra/common/util/ZimbraLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,11 @@ public final class ZimbraLog {
*/
public static final Log ephemeral = LogFactory.getLog("zimbra.ephemeral");

/**
* the "zimbra.contactbackup" logger. For Contact backup/restore-related logs.
*/
public static final Log contactbackup = LogFactory.getLog("zimbra.contactbackup");

/**
* Maps the log category name to its description.
*/
Expand Down Expand Up @@ -548,6 +553,7 @@ public static Set<String> getAccountNamesFromContext() {
descriptions.put(nginxlookup.getCategory(), "Nginx lookup operations");
descriptions.put(activity.getCategory(), "Document operations");
descriptions.put(ews.getCategory(), "EWS operations");
descriptions.put(contactbackup.getCategory(), "Contact Backup and restore");
CATEGORY_DESCRIPTIONS = Collections.unmodifiableMap(descriptions);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static ZClientException CLIENT_ERROR(String msg, Throwable cause) {
}

public static ZClientException UPLOAD_SIZE_LIMIT_EXCEEDED(String msg, Throwable cause) {
return new ZClientException(msg, UPLOAD_SIZE_LIMIT_EXCEEDED, SENDERS_FAULT, cause);
return new ZClientUploadSizeLimitExceededException(msg, cause);
}

public static ZClientException UPLOAD_FAILED(String msg, Throwable cause) {
Expand All @@ -81,6 +81,13 @@ public ZClientNoSuchItemException(int id) {
}
}

public static class ZClientUploadSizeLimitExceededException extends ZClientException {
private static final long serialVersionUID = 1728995252512138761L;
public ZClientUploadSizeLimitExceededException(String msg, Throwable cause) {
super(msg, UPLOAD_SIZE_LIMIT_EXCEEDED, SENDERS_FAULT, cause);
}
}

public static class ZClientNoSuchMsgException extends ZClientNoSuchItemException {
private static final long serialVersionUID = 7916158633910054737L;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<ImportDataRequest xmlns="urn:zimbraMail">
<cal id="61e1c69c-bbb3-4f5d-8903-14ef8bdacbcc" />
</ImportDataRequest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<ImportDataRequest xmlns="urn:zimbraMail">
<caldav id="31e1c69c-bbb3-4f5d-8903-14ef8bdacbcc" />
</ImportDataRequest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<CreateDataSourceRequest xmlns="urn:zimbraMail">
<cal name="someCalDS" l="5" isEnabled="1" host="calendar.google.com" />
</CreateDataSourceRequest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<CreateDataSourceRequest xmlns="urn:zimbraMail">
<caldav name="caldavDS" l="3" isEnabled="0" host="some.cal.dav.host" pollingInterval="1h" />
</CreateDataSourceRequest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<CreateDataSourceRequest xmlns="urn:zimbraMail">
<gal name="zimbraGAL" l="7" isEnabled="1" host="ldap.zimbra.com" pollingInterval="24h" />
</CreateDataSourceRequest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<CreateDataSourceRequest xmlns="urn:zimbraMail">
<imap name="[email protected]" host="imap.yahoo.com" l="2" isEnabled="1" clientSecret="test123" clientId="someclientid" refreshTokenUrl="https://someplace.com/token_get" refreshToken="AAbbccdd1244eeffVdNHR.l0_jzuWvPNtAt0BCCcOm8w9wq1gdB" oauthToken="LoremIpsumZZZyyY123.MaybeLorem.53445.WWW.YelpcYE1p6L1iS5vwZAg8pntEPGs2M.FcbPqY7PxBxORvoYhcbiTLlK7YcRwMB.1gprP5vxYghvqPT9KKV_EJ2vpDQr881.dzLB896UWZYI3hLrqAwiePEhFdw1XXTNP4u6gJ8J6ErPSZJInN1SMK74smQZErEpBgNfyFD2kgNPfcdxjMLh5ODjvhMufHcsb_NI5liTCOWa7k693ziHVZQkyGCJdAzxhtYeIyaCxyTsvaj3ybeXcye.qWFvwpdZbqWj8U8DqRXpjrq6wnNsK1ljGafon_uuX06wWNLh5P0GmLkaW4Yrumh9L7ir59Wm9bQ98TuHxNQDnLLqCK42P3Grb8guWGFRetPiLV2mb4ZT0fPAOeYPmaJXc2_OEWtr.KlazJt.ig6Me1HWR0vHC_MnfHUFA028wooDD9URrhTeMrvizeoePMfd3tgMEw721AbAoH58tg5VebNH_F_.wlQKYkU9rXv4v5Mzw3vsCKvW6wniJzepaY6gwKpMjlWn4CxAQNwRMPyoCDR2gRUXriulDO7vKbQ1ku_g2H.Swq2XGyr0EKjOjRAKVNGWJAh.1flPkzF0W5n7kcgJnG1H3AopZJMAypTiNQEDEyjqDCF41jgN4rKo5q9skZMbRG0D5jL0T_SoKDp6jWoXbWAmeog4Tb0eCHD0QJJGOa1BfFZkXbDB0Eet8JxxfG.0vM23oIervWHqcBPlfKJtkxiI9CCdqOniDNPfhbxkaSlOq3bQRmFOq08jaOwswlsECm4U95bEDxAtKcnVl8AnrP8qsbqxmanHdTh.dehEnjJ1gXyGpaMEBA2Yrt_QEewyWEDuR_zBKsomeDotsSp1.tyw3WCqnMx27tArDDasdNNlPPdfRVQlqe6gX45HfK0C8PAXsPnqZUA07.pFTa8ifcucsdqbh3_UpXnuPj8Mn.67GxwvujJkO8WpD3nCQpwp4Fns6NOnoNoasdgyiSCcGpCsGs2l6ZIFJyUMvIf4q6cfEiJ18lyBjRxi3rpgMAYTt5sOmikOst.gttN1gettkvWyY8-"/>
</CreateDataSourceRequest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<CreateDataSourceRequest xmlns="urn:zimbraMail">
<pop3 leaveOnServer="1" name="pop3DSForTest" l="1" isEnabled="0" host="pop.email.provider.domain" pollingInterval="24h" />
</CreateDataSourceRequest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<CreateDataSourceRequest xmlns="urn:zimbraMail">
<rss name="RssFeedDataSource" l="260" isEnabled="1" host="some.rss.dav.host" pollingInterval="30m" />
</CreateDataSourceRequest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<CreateDataSourceRequest xmlns="urn:zimbraMail">
<unknown name="[email protected]" l="257" isEnabled="1" host="yahoo.com" importClass="com.synacor.zimbra.OAuthDataImport" refreshToken="AAbbccdd1244eeffVdNHR.l0_jzuWvPNtAt0BCCcOm8w9wq1gdB" />
</CreateDataSourceRequest>
Loading

0 comments on commit 71b43f8

Please sign in to comment.