Roundcube Community Forum

Release Support => Release Discussion => Topic started by: twisterbr on February 06, 2013, 08:35:20 AM

Title: Using markasjunk2, how to get the sender address?
Post by: twisterbr 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!
Title: Re: Using markasjunk2, how to get the sender address?
Post by: twisterbr 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'?
Title: Re: Using markasjunk2, how to get the sender address?
Post by: oldschool 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.
Title: Re: Using markasjunk2, how to get the sender address?
Post by: JohnDoh 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.
Title: Re: Using markasjunk2, how to get the sender address?
Post by: twisterbr 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.
Title: Re: Using markasjunk2, how to get the sender address?
Post by: Max Barr 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
 (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