Roundcube Community Forum

 

Compare email to database records

Started by hirkadia, April 12, 2013, 02:16:20 AM

Previous topic - Next topic

hirkadia

Hello,

Did anybody did some customization on the way the emails are sent because i want to compare the destination email to a list of emails in a database, the actual comparison will be done by another application and return something like "1" if the address is not in the database or an array in case of error via URL.

Can anybody point me in a direction because with trial and error is kind of hard. Thank you

SKaero

I'm not sure I fully understand what your trying to do but you should be able to get the information you need with the plugin api: http://trac.marketingxp.com/wiki/Doc_Plugins

hirkadia

Hello,

Thank you very much for your quick reply. i will try to explain in a more structured manner. I have 2 applications. the first is the roundecube installation and the second is the application that will handle the email comparison. Below is the process i would like to take place.
- before sending an email roundcube will call via URL(or some method) the application which compares to a list of emails
- the application will compare the received email to a database with email addresses and return an answer (array or some kind of response to let roundcube know if to proceed with the sending of the email)
- roundecube will receive the answer from the application which compares email addresses and based on answer it will send or no the email

My thought process in PHP:

$response = //some way to call an url which returns and answer

  if($response && !is_array($response)) {
   //procede to send
  } else {
   //cancell the mail sending and return error message
   return $response['error'];
  }

SKaero

You should be easily able to do that using the RoundCube plugin API using the message_outgoing_headers http://trac.marketingxp.com/wiki/Plugin_Hooks#message_outgoing_headers hook.