Author Topic: where to insert a php code for plaintext encryption prior of sending  (Read 6449 times)

Offline criscal

  • Newbie
  • *
  • Posts: 8
Hi to all citizens of this forum, right now i am doing a research on roundcube mail on how to integrate an encryption algorithm on the system to make it like a PGP mail application.  Can anybody help me on this?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
where to insert a php code for plaintext encryption prior of sending
« Reply #1 on: October 15, 2009, 01:31:57 AM »
Support for GPG/PGP encryption is planed for a latter release.

Offline criscal

  • Newbie
  • *
  • Posts: 8
where to insert a php code for plaintext encryption prior of sending
« Reply #2 on: October 15, 2009, 09:27:07 PM »
so did some people already developing it?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
where to insert a php code for plaintext encryption prior of sending
« Reply #3 on: October 16, 2009, 01:55:59 AM »
No it is only planed, see the ticket here: #1440396 (GnuPG/PGP Support) ? Roundcube Webmail

Offline criscal

  • Newbie
  • *
  • Posts: 8
where to insert a php code for plaintext encryption prior of sending
« Reply #4 on: October 16, 2009, 04:17:35 AM »
well anyway, as of now, what i need is i want to know the structure or the system flow of roundcube so that i'll be able to integrate the feature, coz right now i am working on it, by the way do you have any documentations on this?  Iif its successful i can share it with you.  Actually i find it more interesting, so that roundcube will be competent with others so to speak.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
where to insert a php code for plaintext encryption prior of sending
« Reply #5 on: October 16, 2009, 05:54:32 AM »
Documentation is still a little under developed, but you can check out Dev_Docs ? Roundcube Webmail for RoundCube's basic structure.

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,850
where to insert a php code for plaintext encryption prior of sending
« Reply #6 on: October 16, 2009, 05:56:58 AM »
I think work has already started, check out PluginRepository/Encryption ? Roundcube Webmail, if you want to help out then the best way is probably to head over to the dev mailing list.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline criscal

  • Newbie
  • *
  • Posts: 8
where to insert a php code for plaintext encryption prior of sending
« Reply #7 on: October 17, 2009, 08:37:02 PM »
thank you for the information.  But first i need to review the documentation.  I am hoping that many of us well work on this project.

Offline criscal

  • Newbie
  • *
  • Posts: 8
where to insert a php code for plaintext encryption prior of sending
« Reply #8 on: November 14, 2009, 05:30:19 AM »
i run through and analyze the code of parsing the email address.  Does anyone knows how to extract the email address of the recipient?

This is the code under sendmail.inc.
// parse email address input
function rcmail_email_input_format($mailto)
{
  $regexp = array('/[,;]\s*[\r\n]+/', '/[\r\n]+/', '/[,;]\s*$/m', '/;/', '/(\S{1})(<\S+@\S+>)/U');
  $replace = array(', ', ', ', '', ',', '\\1 \\2');

  // replace new lines and strip ending ', ', make address input more valid
  $mailto = trim(preg_replace($regexp, $replace, $mailto));

  $result = array();
  $items = rcube_explode_quoted_string(',', $mailto);

  foreach($items as $item) {
    $item = trim($item);
    // address in brackets without name (do nothing)
    if (preg_match('/^<\S+@\S+>$/', $item)) {
      $result[] = $item;
    // address without brackets and without name (add brackets)
    } else if (preg_match('/^\S+@\S+$/', $item)) {
      $result[] = '<'.$item.'>';
    // address with name (handle name)
    } else if (preg_match('/\S+@\S+>*$/', $item, $matches)) {
      $address = $matches[0];
      $name = str_replace($address, '', $item);
      $name = trim($name);
      if ($name && ($name[0] != '"' || $name[strlen($name)-1] != '"')
          && preg_match('/[\(\)\<\>\\\.\[\]@,;:"]/', $name)) {
     $name = '"'.addcslashes($name, '"').'"';
      }
      if (!preg_match('/^<\S+@\S+>$/', $address))
        $address = '<'.$address.'>';

      $result[] = $name.' '.$address;
    } else if (trim($item)) {
      // @TODO: handle errors
    }
  }

  return implode(', ', $result);
}
thnks in advance!

Offline criscal

  • Newbie
  • *
  • Posts: 8
where to insert a php code for plaintext encryption prior of sending
« Reply #9 on: December 07, 2009, 10:37:42 PM »
hi everybody, after a couple of weeks doing a PGP integration with RCmail, i successfully made RCmail a PGP capable, although the strategy is simple but RCmail is capable of sending encrypted email message to other email service providers such as yahoo, gmail, etc. and they will be able to decrypt it.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
where to insert a php code for plaintext encryption prior of sending
« Reply #10 on: December 07, 2009, 10:46:51 PM »
Good work! Will you share your code?

Offline oldschool

  • Sr. Member
  • ****
  • Posts: 406
where to insert a php code for plaintext encryption prior of sending
« Reply #11 on: December 08, 2009, 05:57:15 AM »
Yes, i´m interested, too.
Would be lovely to use PGP...


Rgds.

Offline criscal

  • Newbie
  • *
  • Posts: 8
where to insert a php code for plaintext encryption prior of sending
« Reply #12 on: December 09, 2009, 07:32:02 PM »
no problem... but as of this moment i am doing some minor enhancement of the system. And as soon as i am done that's the time that i can share it.  

By the way do you know some free online free hosting with openssl enabled? so that i can upload it so that everybody can try it?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
where to insert a php code for plaintext encryption prior of sending
« Reply #13 on: December 10, 2009, 02:49:32 AM »
Sent you a PM.