Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Move remote relay smtp into init.php #1

Closed
wants to merge 2 commits into from

2 participants

@chmac

Move the smtp part of the remoterelay configuration into init.pp so that it can be easily overwritten.

For example, in my config I wanted to use --port --user and --password.

@chmac chmac Move remoterelay smtp to init.pp.
Move the smtp part of the remoterelay configuration into init.pp so that it can be easily overwritten.
122e3f1
manifests/init.pp
@@ -3,7 +3,7 @@
$absentpackages = $nullmailer::params::absentpackages,
$service = $nullmailer::params::service,
$manage_etc_mailname = $nullmailer::params::manage_etc_mailname,
- $adminaddr = "root@$::domain",
+ $adminaddr = "root@$::domain smtp",
@akumria Owner
akumria added a note

I don't understand why you added smtp into the adminaddr, that will only go into /etc/nullmailer/adminaddr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@akumria akumria commented on the diff
manifests/config.pp
@@ -11,7 +11,7 @@
}
file { '/etc/nullmailer/remotes':
- content => "$nullmailer::remoterelay smtp\n",
+ content => "$nullmailer::remoterelay\n",
@akumria Owner
akumria added a note

Would it work to have:

content => "$nullmailer::remoterelay $nullmailer::remoteproto $nullmailer::remoterelayopts"

With remoteproto defaulting to 'smtp' and the remoterelayopts defaulted to an empty string.

(It appears newer versions can also handle 'smtps' too)

Then you could do:
class {'nullmailer':
remoterelayopts => '--port=2525 --auth-login --user=superman --pass=alwayswins',
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@chmac

Apologies, my bad, I put the ' smtp' into adminaddr instead of remoterelay. Fixed now.

Aha, is smtps the format for SMTP over SSL? I struggled to find the command line arguments and eventually figured because the nullmailer package in Ubuntu doesn't depend on any SSL packages, it was probably built without the --enable-tls build flag so probably doesn't support TLS / SSL.

Your suggestion would certainly work I think, although it's maybe getting more complicated than is necessary. The three pieces end up on the same line in the conf file, so I'd be tempted to leave it as a single argument, but it's your call as it's your code. :-)

I'd be interested to be able to add an array of lines and have them all inserted, although it would be perfectly possible to simply add a \n to remoterelay.

@akumria akumria closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 23, 2012
  1. @chmac

    Move remoterelay smtp to init.pp.

    chmac authored
    Move the smtp part of the remoterelay configuration into init.pp so that it can be easily overwritten.
  2. @chmac
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +1 −1  manifests/config.pp
  2. +1 −1  manifests/init.pp
View
2  manifests/config.pp
@@ -11,7 +11,7 @@
}
file { '/etc/nullmailer/remotes':
- content => "$nullmailer::remoterelay smtp\n",
+ content => "$nullmailer::remoterelay\n",
@akumria Owner
akumria added a note

Would it work to have:

content => "$nullmailer::remoterelay $nullmailer::remoteproto $nullmailer::remoterelayopts"

With remoteproto defaulting to 'smtp' and the remoterelayopts defaulted to an empty string.

(It appears newer versions can also handle 'smtps' too)

Then you could do:
class {'nullmailer':
remoterelayopts => '--port=2525 --auth-login --user=superman --pass=alwayswins',
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
require => Class['nullmailer::package'],
notify => Class['nullmailer::service'],
}
View
2  manifests/init.pp
@@ -4,7 +4,7 @@
$service = $nullmailer::params::service,
$manage_etc_mailname = $nullmailer::params::manage_etc_mailname,
$adminaddr = "root@$::domain",
- $remoterelay = "smtp.$::domain"
+ $remoterelay = "smtp.$::domain smtp"
) inherits nullmailer::params {
Something went wrong with that request. Please try again.