Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-09-2011, 09:31 AM
Starter Member
 
Posts: 1
Default Modifying to Send Email on Email Recieved

I need Zimbra to detect an incoming email and run some code. I'm new to Zimbra and am still learning how it all fits together, but from what I can tell there are a few ways to go about this.

1. Does Zimbra already run a script when an email is received? If so I could just add a few lines.
2. Does Zimbra log incoming email? If so I could check that every so often and see what new emails have come in.
3. Could create a scheduled job to query the database for new emails since last check.

Any ideas on where to go with this?

--
Some boring specifics: The people in the office don't check their work emails enough and are missing important stuff. My job is to send a notification email to their personal email address when they get new mail
Reply With Quote
  #2 (permalink)  
Old 08-09-2011, 01:17 PM
Outstanding Member
 
Posts: 717
Default

Hello,

Zimbra does not run an external script when new email comes in.

The MTA logs incoming email in /var/log/zimbra.log, and Zimbra logs when it is written to the user(s) mailboxes in /opt/zimbra/log/mailbox.log
__________________
01 Networks, LLC / Cybernetik.net
Zimbra NE and OSS Cloud Hosting
Shared Web Hosting
Consulting Services
Reply With Quote
  #3 (permalink)  
Old 08-09-2011, 05:01 PM
Project Contributor
 
Posts: 92
Default

As far as I know, you can do that by creating a Java class which implemnts com.zimbra.cs.lmtpserver.LmtpCallback interface's afterDelivery method
and adding that to com.zimbra.cs.lmtpserver.ZimbraLmtpBackend with addCallback method.
So that every time Zimbra Store receives an email with lmtp from ZimbraMTA, the afterDelivery method is called.
Actually there are two lmtpcallback implematations already included in Zimbra Source Code.
One is com.zimbra.cs.mailbox.Notification. The other is com.zimbra.cs.mailbox.QuotaWarning. (I think both Class names tell you what those are for.)
Those must be some guide for you to do implementation.

I think I wrote about this some months ago.
Maybe I better write about this on Wiki.

Anyway, I hope it will help you.
Reply With Quote
  #4 (permalink)  
Old 08-24-2011, 12:28 PM
Project Contributor
 
Posts: 92
Default

As I mentioned at the previous comment in this thread,
I have started writing wiki about the functionality you can customize in ZimbraStore.

Yutaka-Notes about Extensible Classes In ZimbraStore - Zimbra :: Wiki
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.