Roundcube Community Forum

 

Using markasjunk2, how to get the sender address?

Started by twisterbr, February 06, 2013, 08:35:20 AM

Previous topic - Next topic

twisterbr

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!

twisterbr

                        $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'?

oldschool

I don't get it.
For me the maj2 only make sense in conjunction with spamassassin...


Rgds.

JohnDoh

Quote                        $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...

twisterbr

Quote from: JohnDoh on February 07, 2013, 10:26:39 AM
Quote                        $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.

Max Barr

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