class pantin::fetchmail(
	$config_template,
	$username,
	Sensitive $password,
) {
	package { 'fetchmail':
		ensure => present,
	}

	file { '/etc/fetchmailrc':
		owner => 'fetchmail',
		mode => '0600',
		content => Sensitive(template($config_template)),
	} ->
	file { '/etc/default/fetchmail':
		mode => '0644',
		content => "START_DAEMON=yes\n",
	} ->
	service { 'fetchmail':
		ensure => running,
		enable => true,
		subscribe => File['/etc/fetchmailrc'],
	}
}
