views:

59

answers:

1

Hi,

I have a php-based CRM system, which, amont many other functions, sends email messages to our customers.

A few employees need to view those emails when client calls and asks about some data. Those employees have access to common IMAP mailbox (let it be [email protected]).

What I want to do is:

  1. Send email to a customer from address [email protected]. DONE, with Zend_Framwork Zend_Mail, with mail() function as transport, but I am willing to change transport to smtp, and rewrite or modify it.
  2. Get full message source of email just sent (would be best if it already had message-id header added).

    This is the part I need help with.

  3. Open SMTP session to our example.com mailserver and store the source to [email protected] mailbox. I know how to do this. I just need to send 3 commands: MAIL FROM: <...>; RCPT To:...; DATA I checked this with telnet and its woking great. I can deliver an exact copy of message to the mailbox and if a reply cames back, it is properly attached to the injected message. Just need to replicate this in php, but that is not a problem.

The problem lays in 2) Does anybody have an idea how to get the exact source of sent message, or how to generate closest possible copy of that source?

UPDATE:

BCC: will not do the work, as I have to modify the message by replacing some things like passwords with stars in the source.

Also, no serverside filters possible, as serveradmin refuses to implement them.

+1  A: 

Why not just add a BCC to that address when sending the message? Unless I'm missing something in your requirements - that should work.

While not available right now, storing messages is on the Zend_Mail todo list, but again, I'm not sure how that would be any different from a BCC.

Tim Lytle
I would agree, unless he has more requirements.
sfossen
Thanks. It seems that I have just one possibility left. I ask serveradmin to create additional account and post BCC to it, then in Cron I'll check the mail, get the full source, modify it and send to the archive at [email protected] this will require least modifications on the send side, and I can do whatever I need when I fetch mail from the additional mailbox.
SWilk