List:Eventum General Discussion« Previous MessageNext Message »
From:Jason Etheridge Date:April 16 2004 12:05am
Subject:Re: auto-associate incoming email with issue
View as plain text  
> Not at all, emails sent to issue+1@stripped should work as well. 
> However,
> to make that work you need to setup something in your postfix 
> configuration
> to make it pass the full email message to a PHP script that will take 
> care
> of the routing. The script is path-to-eventum/misc/route_email.php, 
> and if
> you want to use the note routing interface, the script will be
> path-to-eventum/misc/route_note.php.

Ah, I noticed that script but couldn't find anything invoking it so 
gave up on it. :)

Doesn't help that I can't find a command line PHP interpreter for 
Debian Linux. :/  Oh here it is, packaged as php4-cgi.  How come with 
any support forum as soon as you verbalize a problem it almost solves 
itself? :D

> The full email message should be passed as standard input to these 
> scripts.
> In my setup, this would be a fair example:
>
> $ cat example_email.txt | php -q path-to-eventum/misc/route_email.php 1

Hrmm.

	eventum@penguin:~$ cat /var/spool/mail/eventum  | php4 -q 
/var/www/penguin.georgialibraries.org/eventum/misc/route_emails.php 1
	Error: The routed email had no associated Eventum issue ID or had an 
invalid recipient address.

	eventum@penguin:~$ cat /var/spool/mail/eventum
	From jasone@stripped  Thu Apr 15 19:21:27 2004
	Return-Path: <jasone@stripped>
	Delivered-To: issue+1@stripped
	Received: by penguin (Postfix, from userid 1002)
	        id C1A24D347D; Thu, 15 Apr 2004 19:21:27 -0400 (EDT)
	Received: from [192.168.0.2] (unknown [66.168.184.244])
	        by penguin (Postfix) with ESMTP id 38DE8D347A
	        for <issue+1@stripped>; Thu, 15 Apr 2004 19:21:27 -0400 
(EDT)
	Mime-Version: 1.0 (Apple Message framework v613)
	Content-Transfer-Encoding: 7bit
	Message-Id: <9BEF6996-8F33-11D8-BA38-0003938AF64A@stripped>
	Content-Type: text/plain; charset=US-ASCII; format=flowed
	To: "Admin User" <issue+1@stripped>
	From: Jason Etheridge <jasone@stripped>
	Subject: testing
	Date: Thu, 15 Apr 2004 19:21:22 -0400
	X-Mailer: Apple Mail (2.613)
	X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on
	        penguin.georgialibraries.org
	X-Spam-Status: No, hits=-99.8 required=2.5 tests=AWL,USER_IN_WHITELIST
	        autolearn=ham version=2.63
	X-Spam-Level:
	
	ooga booga

If I can lick that, I should be able to put that command in a .forward 
file like so:

	"| php4 -q 
/var/www/penguin.georgialibraries.org/eventum/misc/route_emails.php 1"

And then in postfix I need something like this:

	allow_mail_to_commands = alias,forward

That works.  Well, the mail bounced at least. :D

I see this in route_emails.php:

	$associated_user = 'admin@stripped'; // SETUP: this needs to be 
configured properly

That doesn't seem to be the problem though.

I wonder if the + in issue+ is being treated as a regexp operator...  I 
don't know PHP yet.

I changed:

	@preg_match("/$prefix(\d*)@$mail_domain/i", $structure->headers['to'], 
$matches);

to

	@preg_match("/issue\+(\d*)@$mail_domain/i", $structure->headers['to'], 
$matches);

and the command didn't give an error, but I can't tell where the email 
went if anywhere.  So maybe that's not it, and it has something to do 
with the sender and user accounts?

> There are two different features here, the first one is the email 
> routing
> interface which requires the configuration of an external MTA to pass 
> the
> emails sent to issue+1@stripped to route_email.php and the second 
> feature
> which is the Email Integration. In this feature, you can setup multiple
> external email accounts that will be available for Eventum to poll and
> download emails from.

I seem real close to getting the first feature working.  But why isn't 
the Email Integration making use of route_email.php?

> Please let us know if you need more information.

Thanks a bunch.  This is a very nice looking piece of software and I 
appreciate the effort you've put into it.  It seems like it could work 
for us so much better than anything else out there, which is why I'm 
still at it.

-- Jason

Thread
FW: auto-associate incoming email with issueJoao Prado Maia15 Apr
  • RE: auto-associate incoming email with issueJoao Prado Maia16 Apr
    • Re: auto-associate incoming email with issueJason Etheridge16 Apr
      • RE: auto-associate incoming email with issueJoao Prado Maia16 Apr
        • Re: auto-associate incoming email with issueJason Etheridge16 Apr
          • RE: auto-associate incoming email with issueJoao Prado Maia16 Apr
            • Re: auto-associate incoming email with issueJason Etheridge19 Apr
              • RE: auto-associate incoming email with issueJoao Prado Maia7 May
                • Re: auto-associate incoming email with issueJason Etheridge8 May
                  • RE: auto-associate incoming email with issueJoao Prado Maia10 May
                    • Re: auto-associate incoming email with issueJason Etheridge11 May
                      • RE: auto-associate incoming email with issueJoao Prado Maia11 May