class mail::hidden { # Make sure that the tor daemon is included include tor::daemon # It's important to use a subdir from the tor datadir # to ease backup/restore procedures as we don't mix # hidden service data with other tor files. if !defined(File["${tor::daemon::data_dir}/hidden"]) { file { "${tor::daemon::data_dir}/hidden": ensure => directory, owner => 'debian-tor', group => 'debian-tor', mode => 0700, } } tor::daemon::hidden_service { 'mail': ports => [ '80 127.0.0.1:80', '25 127.0.0.1:25', '993 127.0.0.1:993' ], data_dir => "${tor::daemon::data_dir}/hidden", require => File["${tor::daemon::data_dir}/hidden"], } }