Challenge scripts
=================

1.Overview
	The challenge scripts are used to send reports with information about
	spam and quarantine folder items and for authorizing recently quarantined
	messages by proving that you are a human.There is also possibility to manage 
	spam/quarantine by creating spam administrator for selected domains and accounts.
	
2.Configuration
	
	-via Icewarp Administration

	-considering Global antispam settings
	~ 2.1 Antispam
		~ 2.1.1 Action
			~ 2.1.1.1 Enable spam reports
						-Default setting for sending spam reports.If user has 
						default mode selected,the value of this option is used.
			~ 2.1.1.2 Enable quarantine reports 
						-Default setting for sending quarantine reports.If user has 
						default mode selected,the value of this option is used.
		~ 2.1.2 Mode
				-Default reports mode.If user has default mode selected,
				the value of this option is used.
			~ 2.1.2.1 All items
						-All items mode means that
						all account spam/quarantine will be listed in report.
			~ 2.1.2.1 New items
						-New items mode means that only recent account spam/quarantine will be listed in report.
						Recent items are those that arrived to account since the last report.

	~ 2.2 Access mode to services
		~ 2.2.1 ~ Antispam
				-You can select various access modes for antispam.If the account/domain
				does not have antispam access ,such account/domain will be skipped when
				generating spam report.
		
		~ 2.2.2 ~ Quarantine
				-You can select various access modes for quarantine.If the account/domain
				does not have quarantine access ,such account/domain will be skipped when
				generating spam report.
	
		If you select Use account options, Use domain options or Advanced mode, following options
		are considered:
		~ Domain
			~ Access
				~ Antispam
				~ Quarantine
		
		~ User
			~ Access
				~ Antispam
				~ Quarantine
	~2.3 Account settings
		~2.3.1 ~ Spam folder mode
			-If disabled, spam report is skipped for that account,if default and not set
			Antispam ~ Action ~ [x]Integrate spam folder with IMAP, account is also skipped
		~2.3.2 ~ Spam reports mode
			- Overrides global antispam mode settings ( 2.1.2 )
		~2.3.3 ~ Spam administrator
			- Here you can enable spam administrator , enter accounts/domains you want to 
			manage.Theese would be processed in challenge reports and the contains of 
			managed accounts will also be send in report email.
			
3.Running
	
	3.1 Send spam report emails:
		- You can run the script with the minimum configuration
		- When no parameters are supplied, the script is to be run for whole server,
		if you provide domain parameter, only that domain would be processed, if you
		provide account parameter, only that account would be processed.
		- challengeURL/challengelist.html[?domain={domain}][&account={account}]
	
	3.2 Do challenge action
		- challengeURL/a.html?a={action_id}&h={hash}&r={report_id}[&i={item_id}][&o={admin_id}][&t={type}][&e={account_email}][&q={quarantine_mode}][&s={spam_mode}]
		- Actions:	
			-(1|11|21)deliver
			-(2|12|22)whitelist - whitelist + deliver
			-(3|13|23)blacklist - blacklist + delete
			-(4|14|24)delete
			10 - account action
			20 - admin list action
		- Hash
			-hash of the message/report used to check validity , to avoid attacks etc.
		- Report id
			-id of the report in which the report message has been generated
		- Item id 
			-id of the item to be processed 
		- Admin id 
			- id of the administrator in table of administrators 
		- Type 
			- Single item action - is the message quarantine or spam ?
		- Email
			- Account action - email of the recipient to be processed
		- Quarantine/Spam mode
			- Settings that has been used when the report was generated
			
	3.3 Do challenge response
		- Prove that you are a human for recently qurantined message
		- challengeURL/?folder={folder}[&go={go}][&word={word}]
		- Folder
			-Id of the quarantined folder
		- Go 
			-Process form ( check captcha )
		- Word
			-Word entered in captcha form
