Presentation is loading. Please wait.

Presentation is loading. Please wait.

Email-to-Blog How It Works. This Is The «Email-to-blog» System Architecture.

Similar presentations


Presentation on theme: "Email-to-Blog How It Works. This Is The «Email-to-blog» System Architecture."— Presentation transcript:

1 Email-to-Blog How It Works

2 This Is The «Email-to-blog» System Architecture

3 Let’s Consider How It Works

4 1. How the Blog User posts a message to Blog Blog User composes an email message and sends it to a special email address, for instance to Each blog has its own pre-defined email address but all the blog messages are forwarded to the same physical mailbox.

5 1. How the Blog User posts a message to Blog    From: To: Subject: My first blog …

6 1. How the Blog User posts a message to Blog  MailboxWatcher is a Java class that continuously (every 30 sec) checks the mailbox for new messages via POP3 protocol. So, there is a new message in mailbox and MailboxWatcher will detect it soon and start to process it.

7 1. How the Blog User posts a message to Blog 

8  So, MailboxWatcher has dowloaded the message. Now it has to perform a series of checks.

9 1. How the Blog User posts a message to Blog  1) Is the recipient email address ("To:" or "Cc:" header of the message) associated with a blog? MailboxWatcher uses BlogBean.getBlogIdByEmail(email) method in order to check this condition. If the method has returned -1, the email address is not associated with a blog. In this case the message is being skipped.

10 1. How the Blog User posts a message to Blog  BlogBean.getBlogIdByEmail(email) performs a database query: SELECT ID FROM BLOGS WHERE LOWER(EMAIL)=‘comments@… Blog ID=1 And finds out that the associated blog ID = 1 So, the returned value is 1.

11 1. How the Blog User posts a message to Blog  2) Is the sender allowed to post messages to the specific blog (Blog ID = 1)? MailboxWatcher performs 3 kinds of tests in order to check this condition.

12 1. How the Blog User posts a message to Blog  2.1. Is the exact sender’s email address ("From:" header of the message) listed in the "authorized users" table for this Blog?

13 1. How the Blog User posts a message to Blog  AuthorBean.getAuthorByEmail(email) performs a database query: SELECT ID,NAME FROM AUTHORS WHERE LOWER(EMAIL)=‘user@host... And finds out that the sender is in the database. Now it’s time to check if the sender is allowed to post messages to the blog. MailboxWatcher calls blog.isAuthorAllowed(sender) method to check this condition. Allowed

14 1. How the Blog User posts a message to Blog  2.2. If the exact sender’s email address is NOT listed in the "authorized users" table for this Blog, then MailboxWatcher will try to find so-called domain-wide user (a email address like "@host.com") in the table. The existence of the domain-wide user allows to post messages from any email address that belongs to the appropriate domain.

15 1. How the Blog User posts a message to Blog  2.3. If the domain-wide email address is NOT listed in the "authorized users" table for this Blog, then MailboxWatcher will try to find so-called PUBLIC user in the table for the blog. The existence of PUBLIC user allows to post messages from any email address.

16 1. How the Blog User posts a message to Blog  If the sender is allowed (according to at least one of the 3 tests) to post messages, MailboxWatcher calls MessageBean.addMessage() method to store the message in database.


Download ppt "Email-to-Blog How It Works. This Is The «Email-to-blog» System Architecture."

Similar presentations


Ads by Google