Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: toetag on November 09, 2009, 10:04:06 PM

Title: ASSP Toolbar Plugin
Post by: toetag on November 09, 2009, 10:04:06 PM
I'm trying to work on an ASSP Toolbar plugin that replicates the ASSP toolbar for Outlook.

ASSP provides an email interface for reporting spam, not spam, add whitelist and add blacklist.   The ASSP toolbar for outlook provides configurable buttons, so that you can select email(s), then press the button and have them automatically forwarded to the preset ASSP interface email addresses.

I've never worked with PHP but i've been reverse engineering several of the available plugins and have been able to add a button, place it in the interface and configure events and hooks.

the point i'm stuck at now is having the button actually send an email.  I've been looking at all the documentation (RoundCube Classes (http://roundcube.net/doc/phpdoc/)) and the wiki and for the live of me, i can't figure out what i need to do.

  write_log('errors', 'Report Spam button was pushed');
   $sent = $rcmail::smtp_mail('','','','This is a test',$smtp_response, $smtp_errors);

[09-Nov-2009 21:59:05] PHP Fatal error:  Class name must be a valid object or a string in C:\data\wwwroot\webmailtest\plugins\assp_reporting\assp_reporting.php on line 46

/btw, i should say that i'm a hardware geek by trade and a software hack by hobby. delphi, vb6, vb.net, c#.
Title: ASSP Toolbar Plugin
Post by: rosali on November 10, 2009, 01:00:42 AM
You could use my 'sendmessage' plugin bundled with myroundcube plugins (link see signature).
Title: ASSP Toolbar Plugin
Post by: SKaero on November 10, 2009, 05:19:13 AM
The first error I see is $rcmail should be rcmail like:
$sent = rcmail::smtp_mail('','','','T his is a test',$smtp_response, $smtp_errors);
Title: ASSP Toolbar Plugin
Post by: JohnDoh on November 10, 2009, 05:49:37 AM
if you take a look at the email_learn driver in the markasjunk2 plugin repo (drivers/email_learn.php at master from JohnDoh's RoundCube-Plugin-Mark-as-Junk-2 - GitHub (http://github.com/JohnDoh/RoundCube-Plugin-Mark-as-Junk-2/blob/master/drivers/email_learn.php)) there is code there which sends emails and also emails with attachments, may be that will help.
Title: ASSP Toolbar Plugin
Post by: toetag on November 10, 2009, 10:42:04 AM
Rosali, I saw your plugin but it was my intention to try and keep my plugin independent of others (i may change my opinion but i think I can tackle this). Especially since their is a handy "smtp_mail" method in the documentation i found.

skaero, Thank you.  syntax is going to be a learning curve.  I tend to reverse engineer with sweat and muscle.

JohnDoh, I'll give it another look over.  when i first looked at it i thought it was file system based, not sending an email.
Title: ASSP Toolbar Plugin
Post by: Jason_Bassford on November 12, 2009, 10:09:54 AM
This is interesting, because (as far as I know) ASSP requires that the spam message be actually bounced / redirected - not just replied to or forwarded.  This is a function that ASSP doesn't currently have - I've actually been looking for it specifically for being able to redirect to ASSP for spam reporting.  (This is one reason I've had to keep my installation of SquirrelMail intact - and I only use it for spam reporting.)

I'm guessing that if/when this is implemented, it would lead the way to having a redirect plugin also.
Title: ASSP Toolbar Plugin
Post by: toetag on November 12, 2009, 10:19:58 AM
Actually, you might have just made it EASIER.  I never even bothered to see HOW the ASSP toolbar works.  It does forward the email as an attachment.

As luck would have it....guess what there already is.... a forward as attachment plugin by rosali.  Plugin_Repository ? Roundcube Webmail (http://trac.roundcube.net/wiki/Plugin_Repository)

Rosali, can i try to modify that for my needs?
Title: ASSP Toolbar Plugin
Post by: rosali on November 12, 2009, 12:28:43 PM
Well, it would be easy to inject a "learn account" around here:


      $_SESSION['compose']['param']['subject'] = "Fwd: " . substr($att_subject,0,strlen($att_subject)-2);
      $rcmail->output->redirect(array('_action' => 'compose', '_id' => $_SESSION['compose']['id']));
      exit;


... but I'm not sure at the moment how to trigger and automated "send" command here.
Title: ASSP Toolbar Plugin
Post by: toetag on November 12, 2009, 12:40:05 PM
found another issue to resolve.

ASSP - port 25
hMail - imap
roundcube sends through imap

hmail configured to host "testdomain.com"
roundcube: forward email to "[email protected]"

hMail would get this email through imap. hMail knows that domain is locally hosted, ASSP would never see the report.

I might have to use your "sendmail" plugin as you first suggested.
Title: ASSP Toolbar Plugin
Post by: toetag on November 12, 2009, 01:18:54 PM
Sweet, i can fake out hMail.

hosts file:
127.0.0.1 bogusdomain.com


Configured assp to relay for the bogus domain. Sent an email through hMail IMAP, watched the logs, saw hMail accept it, watched it send it, then saw the connection go to ASSP:

hMail log:
264 "2009-11-12 13:10:54.859" "127.0.0.1" "SENT: RCPT TO:"

ASSP log:
Nov-12-09 13:11:04 49464-09597 127.0.0.1 email: combined spam &
whitelist report
Title: Situation
Post by: gwoc on November 26, 2009, 07:02:35 AM
So how's the situation with this? Did you actually get it working? Will you be sharing the plugin at some point?

I'm quite interested in this.
Title: ASSP Toolbar Plugin
Post by: toetag on November 26, 2009, 11:18:21 PM
It's a bit slow right now. I started off fast and made a bit of progress.  I'm trying to find time to work on this but my job has gotten in the way for the moment.

so far, i've been able to modify rosali's plugin "forward as attachment" and have roundcube configure a message for forwarding with the original as an attachment and prefill in the TO: field of the form.  I haven't perfected the "automatic sending" as of yet.

I've been looking at JohnDoh's plugin "mark as spam", i believe between the two of them, i can get the crucial "auto send" piece working correctly.

Once I have something that does the main requirements, i'll post it for testing.
Title: ASSP Toolbar Plugin
Post by: rosali on November 27, 2009, 01:02:59 AM
Check your PM's. I've sent you an instruction how to do the "automatic sending" a while ago.
Title: ASSP Toolbar Plugin
Post by: gwoc on January 26, 2010, 11:42:07 AM
Any updates?
Title: ASSP Toolbar Plugin Update
Post by: toetag on January 26, 2010, 11:48:39 AM
Should have posted this weeks ago.

The update is that JohnDoh's "mark_as_spam2" plugin has all the features for reporting spam and ham and works with ASSP.

He's modified his original plugin to incorporate the "foward as attachment" function needed by ASSP.

You can now configure his plugin to "sendmail" on reporting and configure the email addresses ASSP will listen for reporting.
Title: ASSP Toolbar Plugin
Post by: gwoc on January 28, 2010, 01:13:42 AM
Thanks! :)
Title: Re: ASSP Toolbar Plugin
Post by: xpafiolis on August 27, 2013, 04:18:36 AM
Is it possible to get your markasjunk2 config settings to get ASSP to work?

i cant seem to get assp to recognize the emails!

any help would be great.