Skip to content

alappe/cookbook-opensmtpd

Repository files navigation

OpenSMTPD Cookbook

Install and configure OpenSMTPD, the »FREE implementation of the server-side SMTP protocol as defined by RFC 5321, with some additional standard extensions. It allows ordinary machines to exchange e-mails with other systems speaking the SMTP protocol.«

Platform

The following platform families are supported:

  • Debian
  • Ubuntu

Requirements

recipes

  • git - opensmtpd needs git to fetch the source code.

Attributes

opensmtpd::default

Key Type Description Default
['opensmtpd']['git_url'] String repository to build from git://github.com/poolpOrg/OpenSMTPD.git
['opensmtpd']['git_rev'] String Branch or sha to fetch. Defaults to portable for Linux/OS X portable
['opensmtpd']['src_dir'] String Where to store the source and build it /usr/local/src/opensmtpd
['opensmtpd']['prefix'] String `--prefix=` to pass to the configure script /usr/local
['opensmtpd']['config_dir'] String `--sysconfdir=` to pass to the configure script /etc
['opensmtpd']['privsep']['empty_dir'] String Empty directory as home for privsep users (will be created) /var/empty
['opensmtpd']['privsep']['user_shell'] String Shell for privsep users /usr/sbin/nologin
['opensmtpd'['smtpd.conf']['macros'] Hash Key/Value pairs to write into configuration, e.g. `{ 'lan_addr' => '192.168.0.1' }` {}
['opensmtpd'['smtpd.conf']['listen'] Array Array of listen statements to write into configuration [ 'on localhost' ]
['opensmtpd'['smtpd.conf']['accept'] Array Array of accept statements to write into configuration [ 'for local alias deliver to mbox' ]
['opensmtpd'['smtpd.conf']['reject'] Array Array of reject statements to write into configuration [ ]
['opensmtpd'['smtpd.conf']['bounce-warn'] String Specify the delays for which temporary failure reports must be generated when messages are stuck in the queue 4h
['opensmtpd'['smtpd.conf']['expire'] String Specify how long a message can stay in the queue 4d
['opensmtpd'['smtpd.conf']['max-message-size'] String Specify a maximum message size of n bytes. OpenSMTPD uses 35MB if set to `nil` nil
['opensmtpd'['smtpd.conf']['tables'] Hash Hash of table statements that specify the path and type of the file as well as the content. If the type is `db`, the recipe also runs `makemap` on them after updating the content. The first key of this hash also serves as the identifier and can be referenced in e.g. `accept` statements like `accept for local alias deliver to mbox` { 'aliases' => { 'path' => '/etc/aliases', 'type' => 'db', 'content' => { 'postmaster' => 'root' } } }

For all the configuration you can do, please read the manual.

Usage

opensmtpd::default

Just include opensmtpd in your node's run_list:

{
  "name":"my_node",
  "run_list": [
    "recipe[opensmtpd]"
  ]
}

Obviously OpenSMTPD may conflict with an installation of another mta, so please remove them before. Also, the defalut configuration above will override your /etc/aliases if you have one, so override ['opensmtpd']['smtpd.conf']['tables'] with { } (or any real needed data) to avoid this.

Contributing

  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write you change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request using Github

Authors

  • Andreas Lappe

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Chef cookbook to install and configure OpenSMTPD.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages