Author Topic: Using markasjunk2, how to get the sender address?  (Read 6049 times)

Offline twisterbr

  • Jr. Member
  • **
  • Posts: 26
Using markasjunk2, how to get the sender address?
« on: February 06, 2013, 08:35:20 AM »
How can I get the sender's address from a message? Is there any variable in roundcube that retrieves this information?
I need to use the sender on a driver that I'm developing for markasjunk2 plugin. What I need is, when the user click on 'mark as junk' I need to get the selected message's sender to write in a database.

Thank you!

Offline twisterbr

  • Jr. Member
  • **
  • Posts: 26
Re: Using markasjunk2, how to get the sender address?
« Reply #1 on: February 06, 2013, 08:42:52 AM »
Code: [Select]
                        $message = new rcube_message($uid);
                        $email = $message->sender['mailto'];

Is this the right code to get the sender of a message? Or there is another code 'trustable'?

Offline oldschool

  • Sr. Member
  • ****
  • Posts: 406
Re: Using markasjunk2, how to get the sender address?
« Reply #2 on: February 06, 2013, 02:45:25 PM »
I don't get it.
For me the maj2 only make sense in conjunction with spamassassin...


Rgds.

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Re: Using markasjunk2, how to get the sender address?
« Reply #3 on: February 07, 2013, 10:26:39 AM »
Quote
Code: [Select]
                        $message = new rcube_message($uid);
                        $email = $message->sender['mailto'];

Is this the right code to get the sender of a message? Or there is another code 'trustable'?

that is the code used in one of the other drivers and as far as i know it works fine.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦

Offline twisterbr

  • Jr. Member
  • **
  • Posts: 26
Re: Using markasjunk2, how to get the sender address?
« Reply #4 on: February 19, 2013, 03:33:08 PM »
Quote
Code: [Select]
                        $message = new rcube_message($uid);
                        $email = $message->sender['mailto'];

Is this the right code to get the sender of a message? Or there is another code 'trustable'?

that is the code used in one of the other drivers and as far as i know it works fine.

Yes, it worked. I can get the sender of the message marked as(spam/not spam) using this code.

Offline Max Barr

  • Newbie
  • *
  • Posts: 3
Re: Using markasjunk2, how to get the sender address?
« Reply #5 on: June 09, 2015, 03:41:42 AM »
Hi !
If you want to get the sender's email to make a blacklist, look at my drivers for  markasjunk2 plugin :

https://github.com/MaximeBarrast/filter_learn

It adds filter blocking the sender's email address each time you hit the "SPAM" button ;-)
It's client side. No need to change the server parameters !

Bye