PDA

View Full Version : Simulate 'compose'


connexeon
12-29-2007, 12:55 PM
We have some automated e-mails that we sent out.
I want to put them in Cerberus as if they were written through 'compose'.

I put messages like this in the Cerberus mailbox, but it seems they are just ignored;

Return-path: <void--at--connexeon.com>
Authentication-Results: be1.mx.connexeon.net
from=void--at--connexeon.com
Received: from be3.mx.connexeon.net by be1.mx.connexeon.net
(MDaemon.PRO.v8.0.4.R)
with ESMTP id md50001474061.msg
for <cerberus--at--mdaemon.connexeon.com>; Sat, 29 Dec 2007 13:44:52 +0100
Received: from blacknight ([10.0.50.122]) by be3.mx.connexeon.net with Microsoft SMTPSVC(6.0.3790.1830);
Sat, 29 Dec 2007 13:44:47 +0100
MIME-Version: 1.0
From: "Connexeon Finance & Administration (no reply)" <void--at--connexeon.com>
To: hannes--at--connexeon.com
Reply-To: "Connexeon Finance & Administration" <fa--at--connexeon.com>
Date: 29 Dec 2007 13:44:59 +0100
Subject: test
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Message-ID: <CXOS4wY6YHkidcDjoYA00000580--at--be3.mx.connexeon.net>
X-OriginalArrivalTime: 29 Dec 2007 12:44:47.0984 (UTC) FILETIME=[98982F00:01C84A18]
X-Spam-Processed: be1.mx.connexeon.net, Sat, 29 Dec 2007 13:44:52 +0100
(not processed: message from trusted or authenticated source)
X-MDRcpt-To: cerberus--at--mdaemon.connexeon.com
X-Rcpt-To: cerberus--at--mdaemon.connexeon.com
X-Return-Path: void--at--connexeon.com
X-MDaemon-Deliver-To: cerberus--at--mdaemon.connexeon.com

test


Cron output looks like this;
Downloading message 1 (91 ms)
Total Runtime: 96.893072128296 ms
Time Limit: unlimited secs
Memory Limit: 64M

Reading 1198932553.0596.msg...
Decoding... decoded! (2 ms)
Parsing... parsed! (1 ms) (Ticket ID: )

fa--at--connexeon.com is a helpdesk address
hannes--at--connexeon.com is not an address of a worker
i bcc this message to cerberus--at--mdaemon.connexeon.com, which is the cerberus mailbox (but not an address in cerberus, there are aliases defined for this on the mailbox)
void--at--connexeon.com is non existing, neither in cerberus

Hope I'm clear ;)

jstanden
01-01-2008, 06:46 AM
Do you have the Config->Mail->Routing option set to '--bounce--' unrouteable mail?

If you run these messages through the parser they'll be looking for a destination (group/bucket). As long as you aren't bouncing them they should import into your default group (e.g., Dispatch).

connexeon
01-02-2008, 09:50 AM
Do you have the Config->Mail->Routing option set to '--bounce--' unrouteable mail?

If you run these messages through the parser they'll be looking for a destination (group/bucket). As long as you aren't bouncing them they should import into your default group (e.g., Dispatch).

We have a Dispatch group for unrouted mail set.
It seems it discards mail with a from or reply-to address of a known helpdesk address.
Is that possible?

jstanden
01-02-2008, 10:14 AM
Ah, yeah that's by design as of the new "auto TO/CC requesters" option. The parser won't accept mail from itself to prevent mail loops.

Since the parser is specialized for incoming mail it's going to have a couple small hurdles when importing outgoing mail from the /storage/mail/ directory.

We should be able to accommodate this pretty easily, I just need to think for a little bit on the best way to go about it. We could possibly create a /storage/mail/import directory next to the /storage/mail/new directory that would behave slightly different. That would actually be a big help with the migrations as well (it would remove a lot of crappy import logic from the parser which isn't needed 99% of the time).

http://www.wgmdev.com/jira/browse/CHD-427

connexeon
01-02-2008, 10:42 AM
We should be able to accommodate this pretty easily, I just need to think for a little bit on the best way to go about it. We could possibly create a /storage/mail/import directory next to the /storage/mail/new directory that would behave slightly different.

Maybe yes, but that would complicate the way we deliver the mail to Cerberus.
Now I could just adjust our applications to send mail using a certain from address and bcc it to the helpdesk. The way you suggest we need to get the .msg file to the right directory (rather than just send an e-mail).

I wouldn't mind having a different from address, but since we would like to get replies to the helpdesk, the reply-to address should at least be a helpdesk address (that's actually how we do this now, to prevent undeliverables etc but we don't have the outgoing message in Cerberus).

jstanden
01-03-2008, 07:16 AM
Yeah, this shouldn't be too difficult -- the parser scheduled task just wasn't designed to archive outgoing mail that it encounters in a mailbox.

It just recently started ignoring mail sent to itself by itself. This was implemented when we added the requested feature for TO/CC addresses to also be added as requesters. Since Cerb4 routing is so flexible (default routing), we can't easily identify another TO/CC recipient as a helpdesk address. Anything can be an acceptable incoming address.

If we didn't ignore mail we sent to ourselves, then we may end up adding ourselves as a requester on a ticket. That would create a bit of a mess. ;)

If you wanted to bypass this functionality and import the mail anyway, you can edit /cerb4/api/app/Parser.php around line 180:

Change:

// Is this from the helpdesk to itself? If so, bail out
if(isset($helpdesk_senders[$fromAddressInst->email])) {
return NULL; // [TODO] Log
}


To:

// Is this from the helpdesk to itself? If so, bail out
if(isset($helpdesk_senders[$fromAddressInst->email])) {
//return NULL; // [TODO] Log
}


That will allow the parser to receive mail from itself. By default, the TO/CC requester stuff is disabled in Config->Mail->Incoming, so it shouldn't be a big deal.