Manually run a rule

Use this forum if you want to suggest a new feature to hMailServer. Before posting, please search the forum to confirm that it has not already been suggested.
Post Reply

Would you find a manual run option for account rules useful?

Yes
4
57%
No
3
43%
 
Total votes: 7

psychowood
New user
New user
Posts: 15
Joined: 2009-08-18 19:56

Manually run a rule

Post by psychowood » 2009-08-18 20:24

Hi,
I think a 'Run' button in the 'Rules' tab in the Domain Accounts section would be useful.

I'd find it useful both for rules testing purposes and for when importing many mails from external accounts, especially if you forget to setup the rules before the first download :)

If I haven't missed something from the documentation, it isn't possible to issue a run command neither via scripting nor via COM...

User avatar
mattg
Moderator
Moderator
Posts: 20133
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Manually run a rule

Post by mattg » 2009-08-19 02:46

What sort of rule do you want to run?

Account and domain rules are effected when there is an incoming / outgoing message. They are not effected on existing messages.

Existing messages can be modified with a script, and can be run at specific intervals using a windows scheduled task, or just once.
Scripts can also be used to effect new messages by modifying the eventhandlers.vbs

Exactly what are you trying to achieve?
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

psychowood
New user
New user
Posts: 15
Joined: 2009-08-18 19:56

Re: Manually run a rule

Post by psychowood » 2009-08-19 13:33

Most of my rules are used to move incoming mails in different imap folders, not to modify messages.

User avatar
mattg
Moderator
Moderator
Posts: 20133
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Manually run a rule

Post by mattg » 2009-08-19 16:01

Again, rules only run for 'new' messages, not messages that already exist.

Ie you can't run a rule to check messages already in your inbox and move to various folders. The rule will however fire for each new message received (or sent for global rules), and then move the message directly to the suitable folder.

For messages that already exist, try using rules in your mail client.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

psychowood
New user
New user
Posts: 15
Joined: 2009-08-18 19:56

Re: Manually run a rule

Post by psychowood » 2009-08-19 16:27

mattg wrote:Again, rules only run for 'new' messages, not messages that already exist.
I understood, that's why I asked if it were possible to force that behaviour (ie, flag the messages like 'new' and reprocess for the selected rule).

I didn't know how the messages were processed, tho.
For messages that already exist, try using rules in your mail client.
That's what I'd have liked to avoid, since I migrated every rule in the server :)

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Manually run a rule

Post by ^DooM^ » 2009-08-19 17:23

It's not an easy thing to do although would certainly be possible. When a message comes in hMail has the message there to do with as the rules ask. What you are asking for would be something quite different. hMail would have to locate the emails in question (This would mean scanning every single email and seeing id the rule matches at which point running the rule and continuing onto the next email which would seriously slow hMail down on large folders). This to me would have a negative impact on hMail in my opinion.
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

User avatar
mattg
Moderator
Moderator
Posts: 20133
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Manually run a rule

Post by mattg » 2009-08-20 01:53

mattg wrote:Existing messages can be modified with a script
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

rstarkov
New user
New user
Posts: 26
Joined: 2013-12-30 15:51

Re: Manually run a rule

Post by rstarkov » 2014-01-09 18:44

Would definitely be useful. I have lots of rules for moving various messages into folders. Once I decide a new rule is needed, I add it and new messages are processed accordingly, however the existing ones are not.

For example, suppose I subscribe to a useful notification (e.g. wiki edit), and after receiving 10 of them overnight decide that I want them in a subfolder. I write a rule, but I can't use it to move those 10 I haven't yet processed to the subfolder. This is a pity.

Yes, you can write a script to process existing messages, but writing every rule twice (once as a rule, then once again as a script) is annoying. The best solution today is to either give up on existing messages, or to write all rules as scripts.

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Manually run a rule

Post by Bill48105 » 2014-01-09 20:58

This request only really makes sense for a per-user rule as global rule would have no way to know what to apply it to. As already noted a few times since rules get applied as emails arrive or are delivered it wouldn't exactly be trivial to make this change. And as noted it makes MUCH more sense to run a script on existing messages.
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

User avatar
mattg
Moderator
Moderator
Posts: 20133
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Manually run a rule

Post by mattg » 2014-01-10 01:03

rstarkov wrote:The best solution today is to either give up on existing messages, or to write all rules as scripts.
Seriously, how hard is it to drag and drop 10 messages at once from within your mail client.

Sometimes I'll get hundreds, before I create a rule. Moving hundreds or even thousands of messages with a single drag and drop is trivial I reckon.

(I recently moved > 10 000 messages with a single drag and drop, when I re-added an account to a mail client as IMAP rather than POP3. All messages had been received by POP3 and were on the client machine and not on the new server. I simply dragged complete folders and all messages from the local mail store to the IMAP folders within the mail client. Left it running overnight - but that is no big deal)

ALSO, Outlook rules can be enabled for existing messages, you could also try using rules client side. What mail client do you use?
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Post Reply