add Javascript filter actions (not criteria)

NEW
Unassigned

Status

MailNews Core
Backend
--
enhancement
19 years ago
a year ago

People

(Reporter: (not reading, please use seth@sspitzer.org instead), Unassigned)

Tracking

(Depends on: 1 bug)

Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [action to call a javascript code], URL)

Attachments

(1 attachment)

allow javascript in the filter actions.
Summary: Javascript filters → [HELP WANTED] Javascript filters
Whiteboard: HELP WANTED
Target Milestone: M15
marking m15.

Comment 2

19 years ago
Bulk-resolving requests for enhancement as "later" to get them off the Seamonkey
bug tracking radar. Even though these bugs are not "open" in bugzilla, we
welcome fixes and improvements in these areas at any time. Mail/news RFEs
continue to be tracked on http://www.mozilla.org/mailnews/jobs.html

Comment 3

19 years ago
Reopen mail/news HELP WANTED bugs and reassign to nobody@mozilla.org
adding toshok to the cc list.
see http://devedge/docs/manuals/communicator/jsguide4/mail.htm for details.

unlike 4.x, in 5.0 the rules file is the same across all platforms:  rules.dat

Comment 6

18 years ago
Could somebody fix that link? It's invalid.

Comment 8

18 years ago
Found it. You didn't put ".netscape.com" so I futzed around with devedge.com,
.org, .net etc. I'm not entirely hip on all the Netscape lingo yet.

Updated

18 years ago
Keywords: helpwanted

Updated

18 years ago
Summary: [HELP WANTED] Javascript filters → Javascript filters
Whiteboard: HELP WANTED
Target Milestone: M15

Updated

17 years ago
Blocks: 66425

Comment 10

16 years ago
JavaScript (with regular expressions) would be able to do amazing and powerful
things as a message filter. Simply pass an email message object to a function in
the script, with read-only members such as .Sender(), .From(), .CC(), .Subject(),
perhaps even .Source(), and then decide an action based on its return value.

Given all of the JavaScript-based cross-platform development going on anyway in
this project, JS filters would seem at least within the realm of possibility.

Comment 12

16 years ago
Is this bug 4xp?
Was that functionality present in Netscape Messenger 4?
Yes, the doc link in comment #11 refers to documentation for a feature that
shipped in 4.x.

/be
Keywords: 4xp

Comment 14

15 years ago
Bug 59341 is a dup of this one.  Transfering deps.  And check Bug 59341 comment
#9 for more dups of this bug.
Depends on: 13145, 59335, 59369

Updated

15 years ago
QA Contact: lchiang → nobody

Comment 15

14 years ago
Actually nsMsgFilter contains code to attach a script to filter action, and it
also saves it back (type="2" filters, I guess); but I don't understand where
that code is actually called upon message receiving not where the actual
filtering is done.
I suppose that file only contains "residual" type-2 message filers from
Netscape4 code?

Comment 16

14 years ago
Created attachment 151438 [details] [diff] [review]
Fix News filtertype definition

Seems like there's been a long-standing typo here. Does nobody use News
filters?

Comment 17

14 years ago
This was as far as I wanted a mail filter.. Very useful but never worked.
Even more useful now with bounced virus in the thousands hitting my intray...
Product: MailNews → Core

Comment 18

13 years ago
*** Bug 59341 has been marked as a duplicate of this bug. ***
Updating summary. Adding status whiteboard.

We should discuss what access the script should have. Perhaps a security setting
on the level of access such a script could have, such as filesystem (useful for
writing emails to a log file) or chrome, or simply mailboxes.
Summary: Javascript filters → Javascript filter actions (not criteria)
Whiteboard: [action to call a javascript code]

Comment 20

12 years ago
*** Bug 330785 has been marked as a duplicate of this bug. ***
QA Contact: nobody → backend
Attachment #151438 - Flags: superreview?

Comment 21

12 years ago
Comment on attachment 151438 [details] [diff] [review]
Fix News filtertype definition

there's no code to apply javascript filters so I don't think this change by itself will do anything.
Attachment #151438 - Flags: superreview?(mscott)
Attachment #151438 - Flags: superreview?
Attachment #151438 - Flags: review?(mscott)
Attachment #151438 - Flags: review?

Comment 22

12 years ago
Comment on attachment 151438 [details] [diff] [review]
Fix News filtertype definition

I'm not sure why would want this code, it doesn't give us JS filter actions anyway.
Attachment #151438 - Flags: superreview?(mscott)
Attachment #151438 - Flags: superreview-
Attachment #151438 - Flags: review?(mscott)
Attachment #151438 - Flags: review-

Comment 23

11 years ago
I can imagine having a filter action "Execute Skript", with a editable combobox for its values. You could either enter the code for a function in the textbox or choose from a list of registered functions (passed in from the frontend by registering respective callback functions). The function would be called with relevant data, like msgHdr or message body.

Or what is this bug about?

Comment 24

11 years ago
I'm not sure of everyone else, but my interest is in filtering things that are "obvious" to me as a developer, but beyond the scope of simple =/!=/like filters.

E.g. If I could run a RegEx (via JavaScript) on the subject line of an email... whereby if it started or ended with 4+ digits, then I would like to, because for me, this is a sure fire indicator of Spam.

Likewise, the same ability on the body of the email, or the to: or the cc: list would be desired.

I would be ecstatic with a filter type called 'script',... that would pass a single param to a function that you (the end user) supply, that simply returns true/false;  if true, the msg meets the filter criteria... if false, it doesn't...

So, for example:

/*
object msg
          .headers
          .body
*/
function mySpamFilter(msg){
  if(msg.headers.Subject.length >= 50){
    //likely spam...
    return true;
  } else if(msg.headers.Subject.indexOf(' wrote') != -1){
    //spam-a-palooza
    return true;
  } else {
    //AFAIK, ATM, not spam
    return false;
  }
}

It may seem strange... but the idea is very cool, for those of us that would have a good idea as to what to do with it.

Comment 26

11 years ago
> I would be ecstatic with a filter type called 'script',... that would pass a
> single param to a function that you (the end user) supply, that simply returns
> true/false;  if true, the msg meets the filter criteria... if false, it
> doesn't...

This is exactly what this bug is *not* about. ;-)
You're talking about <https://bugzilla.mozilla.org/show_bug.cgi?id=58407#c8>

Comment 27

11 years ago
@Karsten:  I apologize then, I found this Bug#, when searching for the ability that was available in Netscape Comm. Mail 4.x.

And since 58407 is marked "verified invalid", I suppose this is still the place to be. ;-)

Comment 28

11 years ago
perhaps this could be complimentary to bug 19442
(Assignee)

Updated

10 years ago
Product: Core → MailNews Core

Comment 29

8 years ago
Wayne suggested that a comment here might be appropriate for watchers:

In TB 3.0 / SM 2.0 a new feature was added to allow arbitrary custom filter actions to be added by extensions. In my extension FiltaQuilla, one of the added filter actions is an arbitrary javascript filter action (javascript search is also available there).

That does not directly affect the status of this bug, which remains a request to add this function in core. However, given its availability in an extension, and its fairly rare use there, the functionality of this bug is not likely to be added to core.

Updated

8 years ago
Severity: normal → enhancement
Priority: P3 → --
Summary: Javascript filter actions (not criteria) → add Javascript filter actions (not criteria)

Comment 30

8 years ago
If someone has a patch and wants help with it then helpwanted is appropriate. That's not currently true afaict.  Nix "helpwanted".
Keywords: helpwanted
You need to log in before you can comment on or make changes to this bug.