<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!-- $Id: dovecot.xml 1 2007-01-21 18:57:38Z elkner $ -->

<service_bundle type='manifest' name='LNFdovecot'>

<service name='network/dovecot' type='service' version='1'>

	<create_default_instance enabled='false'/>

	<single_instance/>

	<!-- Wait for all local filesystems to be mounted.  -->
	<dependency name='filesystem-local' type='service'
		grouping='require_all'
		restart_on='none'>
		<service_fmri value='svc:/system/filesystem/local:default'/>
	</dependency>
	<!-- Wait for network interfaces to be initialized.  -->
	<dependency name='network' type='service' grouping='require_all'
		restart_on='refresh'>
		<service_fmri value='svc:/milestone/network:default'/>
	</dependency>
	<!-- Without a nameservice no users - so wait for it -->
	<dependency name='name-services' type='service' grouping='require_all'
		restart_on='refresh'>
		<service_fmri value='svc:/milestone/name-services' />
	</dependency>
	<!-- Wait for automounting to be available, need home directories -->
	<dependency name='autofs' type='service'
		grouping='optional_all'
		restart_on='error'>
		<service_fmri value='svc:/system/filesystem/autofs:default'/>
	</dependency>

	<!-- if dovecot initializes ssl params, this may take a while -->
	<exec_method type='method' name='start'
		exec='/etc/svc/method/dovecot start'
		timeout_seconds='60'>
		<!--method_context>
			<method_credential user='root' group='root' privileges='basic,!proc_session,!proc_info,!file_link_any,net_privaddr,file_dac_read,file_dac_search,sys_resource,proc_chroot'/>
		</method_context-->
	</exec_method> 

	<exec_method type='method' name='stop'
		exec='/etc/svc/method/dovecot stop'
		timeout_seconds='60' />

	<exec_method type='method' name='refresh'
		exec='/etc/svc/method/dovecot refresh'
		timeout_seconds='60' />

	<property_group name='startd' type='framework'>
		<!-- sub-process core dumps shouldn't restart session -->
		<propval name='ignore_error' type='astring'
			value='core,signal' />
	</property_group>

	<stability value='Evolving' />

	<template>
		<common_name>
			<loctext xml:lang='C'>
				Dovecot IMAP/POP3 service
			</loctext>
		</common_name>
		<documentation>
			<doc_link name='Dovecot Wiki'
				uri='http://wiki.dovecot.org/' />
		</documentation>
	</template>
</service>

</service_bundle>
