/[drupal]/contributions/modules/mimemail/includes/mimemail.incoming.inc
ViewVC logotype

Diff of /contributions/modules/mimemail/includes/mimemail.incoming.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.1, Sun Feb 22 20:55:46 2009 UTC revision 1.1.2.2, Tue Apr 14 23:09:00 2009 UTC
# Line 0  Line 1 
1    <?php /* $Id: mimemail.incoming.inc,v 1.1 2009/02/22 20:55:46 vauxia Exp $ */
2    
3    /**
4     * @file
5     * Functions that handle inbound messages to mimemail.
6     */
7    
8    /**
9     * Receive messages POSTed from an external source.
10     *
11     * This function enables messages to be sent via POST or some other RFC822
12     * source input (e.g. directly from a mail server).
13     *
14     * @return
15     *   The POSTed message.
16     */
17    function mimemail_post() {
18      $message = $_POST['message'];
19      $token   = $_POST['token'];
20      $hash    = md5(variable_get('mimemail_key', '**') . $message );
21    
22      if ($hash != $token) {
23        watchdog('access denied', 'Authentication error for POST e-mail', WATCHDOG_WARNING);
24        return drupal_access_denied();
25      }
26      return mimemail_incoming($message);
27    }
28    
29    /**
30     * Parses an externally received message.
31     *
32     * @param $message
33     *   The message to parse.
34     */
35    function mimemail_incoming($message) {
36      require_once dirname(__FILE__) .'/mimemail.inc';
37      $mail = mimemail_parse($message);
38    
39      foreach (module_implements('mimemail_incoming_alter') as $module) {
40        call_user_func_array($module .'_mimemail_incoming_alter', $mail);
41      }
42    
43      module_invoke_all('mimemail_incoming', $mail);
44    }

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.1.2.2

  ViewVC Help
Powered by ViewVC 1.1.2