Subversion Repositories SmartDukaan

Rev

Rev 3368 | Rev 3373 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3368 Rev 3369
Line 35... Line 35...
35
 * @author mandeep
35
 * @author mandeep
36
 * 
36
 * 
37
 */
37
 */
38
public class CRMEmailProcessor {
38
public class CRMEmailProcessor {
39
    private static final int DESCRIPTION_MAX_WIDTH = 1900;
39
    private static final int DESCRIPTION_MAX_WIDTH = 1900;
-
 
40
    private static final String MAILOR_DAEMON_EMAIL_ID = "mailer-daemon@googlemail.com";
40
    private static final Log log                   = LogFactory
41
    private static final Log log                   = LogFactory
41
                                                           .getLog(CRMEmailProcessor.class);
42
                                                           .getLog(CRMEmailProcessor.class);
42
    private Client           client;
43
    private Client           client;
43
 
44
 
44
    public CRMEmailProcessor() {
45
    public CRMEmailProcessor() {
Line 49... Line 50...
49
        }
50
        }
50
    }
51
    }
51
 
52
 
52
    public void processEmail(Message message) throws MessagingException,
53
    public void processEmail(Message message) throws MessagingException,
53
            IOException, TException, UserContextException {
54
            IOException, TException, UserContextException {
-
 
55
        // Ignoring mails from Mailor daemon
-
 
56
        if (MAILOR_DAEMON_EMAIL_ID.equals(parseEmailId(message.getFrom()[0].toString()))) {
-
 
57
            return;
-
 
58
        }
-
 
59
 
54
        Long ticketId = parseTicketId(message);
60
        Long ticketId = parseTicketId(message);
55
 
61
 
56
        if (ticketId != null) {
62
        if (ticketId != null) {
57
            log.info("Response for Ticket: " + ticketId + ": " + message);
63
            log.info("Response for Ticket: " + ticketId + ": " + message);
58
            updateTicket(ticketId, message);
64
            updateTicket(ticketId, message);