Example usage for com.liferay.portal.kernel.util PropsKeys POP_SERVER_SUBDOMAIN

List of usage examples for com.liferay.portal.kernel.util PropsKeys POP_SERVER_SUBDOMAIN

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util PropsKeys POP_SERVER_SUBDOMAIN.

Prototype

String POP_SERVER_SUBDOMAIN

To view the source code for com.liferay.portal.kernel.util PropsKeys POP_SERVER_SUBDOMAIN.

Click Source Link

Usage

From source file:com.cd.learning.hook.MBUtil.java

License:Open Source License

public static String getReplyToAddress(long categoryId, long messageId, String mx,
        String defaultMailingListAddress) {

    if (PropsUtil.get(PropsKeys.POP_SERVER_SUBDOMAIN).length() <= 0) {
        return defaultMailingListAddress;
    }// w w  w .  ja  v  a  2  s  .c om

    StringBundler sb = new StringBundler(8);

    sb.append(MESSAGE_POP_PORTLET_PREFIX);
    sb.append(categoryId);
    sb.append(StringPool.PERIOD);
    sb.append(messageId);
    sb.append(StringPool.AT);
    sb.append(PropsUtil.get(PropsKeys.POP_SERVER_SUBDOMAIN));
    sb.append(StringPool.PERIOD);
    sb.append(mx);

    return sb.toString();
}

From source file:com.cd.learning.hook.MBUtil.java

License:Open Source License

public static boolean hasMailIdHeader(Message message) throws Exception {
    String[] messageIds = message.getHeader("Message-ID");

    if (messageIds == null) {
        return false;
    }// ww w  .  j  a v  a  2 s .  co m

    for (String messageId : messageIds) {
        if (Validator.isNotNull(PropsUtil.get(PropsKeys.POP_SERVER_SUBDOMAIN))
                && messageId.contains(PropsUtil.get(PropsKeys.POP_SERVER_SUBDOMAIN))) {

            return true;
        }
    }

    return false;
}

From source file:org.vaadin.tori.service.LiferayToriMailService.java

License:Apache License

private static String getMailId(final long companyId, final long categoryId, final long messageId)
        throws PortalException, SystemException {

    Company company = CompanyLocalServiceUtil.getCompany(companyId);
    String mx = company.getMx();//from  ww  w  .  j a  v  a2 s  .c o  m
    StringBundler sb = new StringBundler(10);

    sb.append(StringPool.LESS_THAN);
    sb.append(POP_PORTLET_PREFIX);
    sb.append(categoryId);
    sb.append(StringPool.PERIOD);
    sb.append(messageId);
    sb.append(StringPool.AT);

    String sd = PropsUtil.get(PropsKeys.POP_SERVER_SUBDOMAIN);
    if (sd != null && !"null".equals(sd.toLowerCase())) {
        sb.append(sd);
        sb.append(StringPool.PERIOD);
    }

    sb.append(mx);
    sb.append(StringPool.GREATER_THAN);

    return sb.toString();
}