Author Topic: ASSP Toolbar Plugin  (Read 13334 times)

Offline toetag

  • Jr. Member
  • **
  • Posts: 65
ASSP Toolbar Plugin
« 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) 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#.
<[ a desert to an irishman is an empty glass. ]>

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
ASSP Toolbar Plugin
« Reply #1 on: November 10, 2009, 01:00:42 AM »
You could use my 'sendmessage' plugin bundled with myroundcube plugins (link see signature).
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
ASSP Toolbar Plugin
« Reply #2 on: November 10, 2009, 05:19:13 AM »
The first error I see is $rcmail should be rcmail like:
$sent rcmail::smtp_mail('<emailTO>','<emailFrom>','','T his is a test',$smtp_response$smtp_errors);

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,850
ASSP Toolbar Plugin
« Reply #3 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) there is code there which sends emails and also emails with attachments, may be that will help.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦

Offline toetag

  • Jr. Member
  • **
  • Posts: 65
ASSP Toolbar Plugin
« Reply #4 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.
<[ a desert to an irishman is an empty glass. ]>

Offline Jason_Bassford

  • Jr. Member
  • **
  • Posts: 13
ASSP Toolbar Plugin
« Reply #5 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.

Offline toetag

  • Jr. Member
  • **
  • Posts: 65
ASSP Toolbar Plugin
« Reply #6 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

Rosali, can i try to modify that for my needs?
<[ a desert to an irishman is an empty glass. ]>

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
ASSP Toolbar Plugin
« Reply #7 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.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline toetag

  • Jr. Member
  • **
  • Posts: 65
ASSP Toolbar Plugin
« Reply #8 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 "spam@testdomain.com"

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.
<[ a desert to an irishman is an empty glass. ]>

Offline toetag

  • Jr. Member
  • **
  • Posts: 65
ASSP Toolbar Plugin
« Reply #9 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
<[ a desert to an irishman is an empty glass. ]>

Offline gwoc

  • Newbie
  • *
  • Posts: 5
Situation
« Reply #10 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.

Offline toetag

  • Jr. Member
  • **
  • Posts: 65
ASSP Toolbar Plugin
« Reply #11 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.
<[ a desert to an irishman is an empty glass. ]>

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
ASSP Toolbar Plugin
« Reply #12 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.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline gwoc

  • Newbie
  • *
  • Posts: 5
ASSP Toolbar Plugin
« Reply #13 on: January 26, 2010, 11:42:07 AM »
Any updates?

Offline toetag

  • Jr. Member
  • **
  • Posts: 65
ASSP Toolbar Plugin Update
« Reply #14 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.
<[ a desert to an irishman is an empty glass. ]>