Menu: Tasks / Setup Action Tasks

Tasks Setup Action Tasks

The "Action Tasks" start "User Tasks" or scripts automatically whenever one of the predefined events happens. For example, you can start a mail transfer here whenever Hamster got a mail to send out.

Setup Action Tasks

Action

Each action event is identified by a unique name shown in the list. The most useful ones for Action Tasks are:

Startup Happens once when Hamster is started.
Shutdown Happens once when Hamster is stopped.

MailWaiting Happens right after a new mail message was placed in Mail.Out directory, i. e. there is a new mail message waiting to be sent out.
NewsWaiting Happens right after a news message was placed in News.Out directory, i. e. there is a new news message waiting to be sent out.
MsgWaiting Happens right after a mail or news message was placed in the appropriate .Out directory, i. e. there is a new message waiting to be sent out.

Note: If both types are used, MsgWaiting always happens after MailWaiting/NewsWaiting.

The following actions may be used for special purposes, but in general they require scripts to really make use of them:

NewsOut Happens right before an article to be posted is placed in News.Out directory.
NewsIn Happens right after an article was loaded from a remote server and before it is saved in a local newsgroup file.

Warning: Special care must be taken when using such a NewsIn action, as this action will be called very often and multiple times concurrently for each transfer thread. It is strongly suggested to only use it with default options Wait=1 and Lock=1 to avoid any concurrency issues. Also be prepared, that it may slow down news transfer drastically, as each message will have to go through your action script then.

NewsInLocal Happens right after an article was posted to the local NNTP server and is about to be processed now. If the article is to be sent out, this event happens before above NewsOut.
MailToNews Happens right before a mail loaded from a remote server is redirected, i. e. stored in a newsgroup.

MailOut Happens right before a mail to be sent is placed in Mail.Out directory.
MailOutFile Happens right after MailOut but still before a mail to be sent is placed in Mail.Out directory.

Note: Difference is, that MailOut works "in memory" and MailOutFile "with files".

MailInHeader Happens right after the headers of a new mail are available, either after loading them from an external POP3 server or after injected into local SMTP server..
MailInHeaderFile Happens right after MailInHeader and provides headers in a file instead.
MailIn Happens right before a mail fetched from a remote server or sent locally is placed in receiver's mailbox.
MailInFile Happens right after MailIn but still before a mail fetched from a remote server or sent locally is placed in receiver's mailbox.

Note: Difference is, that MailIn works "in memory" and MailInFile "with files".


ReportsCreated Happens right after new reports were created.

Execute

Here you can select one of your User Tasks (*.hut) or Scripts (*.hsc) that should be started whenever the assorted action happens.

See also the details at Reference: File HscActions.hst on how to use scripts with these actions.

Wait

If checked, Hamster waits until the started task has terminated before it continues.

Warning: Don't uncheck this option with scripts if you want to access a message provided by a MsgAlloc parameter, as Hamster might already have freed this message even before the first line of your script is executed!

Lock

If checked, all other actions have to wait until the current one was either started (Wait=unchecked) or has finished executing (Wait=checked).

Silent

If checked, the usual log file lines when starting tasks or scripts are omitted. Default is checked, i. e. create the log entries.

 

[www.elbiah.de Hamster Playground Documentation]