Initial version off mutt module.
This commit is contained in:
parent
5a76919eb2
commit
0190fc4a94
2 changed files with 48 additions and 0 deletions
41
mutt/manifests/init.pp
Normal file
41
mutt/manifests/init.pp
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
|
||||||
|
class mutt {
|
||||||
|
|
||||||
|
package { "mutt":
|
||||||
|
ensure => installed,
|
||||||
|
}
|
||||||
|
|
||||||
|
if ! $mail_server {
|
||||||
|
$mail_server = "mail.${domain}"
|
||||||
|
}
|
||||||
|
if ! $mail_domain {
|
||||||
|
$mail_domain = "${domain}"
|
||||||
|
}
|
||||||
|
|
||||||
|
case $operatingsystem {
|
||||||
|
openbsd: { $muttconfdir = "/etc/mutt/Muttrc" }
|
||||||
|
default: { $muttconfdir = "/etc" }
|
||||||
|
}
|
||||||
|
|
||||||
|
exec { "add-local-mutt-config":
|
||||||
|
command => "echo 'source ${muttconfdir}/Muttrc.local' >> ${muttconfdir}/Muttrc",
|
||||||
|
path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin",
|
||||||
|
user => root,
|
||||||
|
unless => "fgrep 'source ${muttconfdir}/Muttrc.local' ${muttconfdir}/Muttrc",
|
||||||
|
require => Package["mutt"],
|
||||||
|
}
|
||||||
|
|
||||||
|
file { "Muttrc.local":
|
||||||
|
name => "${muttconfdir}/Muttrc.local",
|
||||||
|
ensure => present,
|
||||||
|
content => template("mutt/Muttrc.local.erb"),
|
||||||
|
mode => 0644,
|
||||||
|
owner => root,
|
||||||
|
group => $operatingsystem ? {
|
||||||
|
openbsd => wheel,
|
||||||
|
default => root,
|
||||||
|
},
|
||||||
|
require => Exec["add-local-mutt-config"],
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
7
mutt/templates/Muttrc.local.erb
Normal file
7
mutt/templates/Muttrc.local.erb
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
|
||||||
|
set use_8bitmime
|
||||||
|
|
||||||
|
set hostname=<%= mail_domain %>
|
||||||
|
|
||||||
|
set spoolfile=imaps://${USER}@<%= mail_server %>/INBOX
|
||||||
|
set folder=imaps://${USER}@<%= mail_server %>
|
Loading…
Add table
Add a link
Reference in a new issue