Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


ssmtp (8) Versions 0.5.0

Installs/Configures ssmtp

cookbook 'ssmtp', '~> 0.5.0', :supermarket
cookbook 'ssmtp', '~> 0.5.0'
knife supermarket install ssmtp
knife supermarket download ssmtp
Quality 50%

ssmtp Cookbook

Cookbook Version
Dependency Status
Build Status

This is a Chef cookbook for deploying ssmtp.



The following platforms and versions are tested and supported using

  • Ubuntu 14.04, 16.04
  • CentOS 6.9, 7.4

Chef dependencies

  • yum-epel


Adding the cookbook

Add ssmtp as a dependency to your wrapper cookbook.


The cookbook provides a couple attributes that help you to configure ssmtp via a role's default_attributes.

Here's an example role:

  name 'mail_server'
  description "Installs mail related applications."
  # List of recipes and roles to apply. Requires Chef 0.8, earlier versions use 'recipes()'.
  # Attributes applied if the node doesn't have it set already.
    'ssmtp' => {
      'root' => '',
      'rewrite_domain' => '',
      'mailhub_name' => ''
  # Attributes applied no matter what the node has set already.

For a full list of attributes please consult ./attributes/default.rb.


By default this cookbook will use authentication. If you are relying on connecting to your mailhub without providing credentials disable authentication all together by setting auth_enabled to false.

The cookbook provides an attribute called credential_method which defines whether authentication credentials are provided in a crypted data bag or via plain text. It defaults to the more secure crypto data bag method.

Available options are:

  • data_bag
  • plain
Creating the data bag
 $ knife data bag create --secret-file .chef/encrypted_data_bag_secret mail ssmtp
 Created data_bag[mail]
 Created data_bag_item[ssmtp]

 $ mkdir -p data_bags/mail
 $ knife data bag show mail ssmtp -F json > data_bags/mail/ssmtp.json
Viewing the data bag
 $ knife data bag show --secret-file .chef/encrypted_data_bag_secret mail ssmtp
 id:        ssmtp
 password:  foobar

 $ knife data bag show --secret-file .chef/encrypted_data_bag_secret -F json mail ssmtp
    "username": "",
    "id": "ssmtp",
    "password": "foobar"


We have written unit tests using chefspec and integration tests in serverspec executed via test-kitchen. Much of the tooling around this cookbook is exposed via guard and test kitchen, so it is highly recommended to learn more about those tools. The easiest way to get started is to install the Chef Development Kit

Running tests

The following commands will run the tests:

chef exec bundle install
chef exec rubocop
chef exec foodcritic .
chef exec rspec
chef exec kitchen test default-ubuntu-1404
chef exec kitchen test default-centos-70

The above will do ruby style (rubocop) and cookbook style (foodcritic) checks followed by rspec unit tests ensuring proper cookbook operation. Integration tests will be run next on two separate linux platforms (Ubuntu 14.04 LTS Precise 64-bit and CentOS 7.0). Please run the tests on any pull requests that you are about to submit and write tests for defects or new features to ensure backwards compatibility and a stable cookbook that we can all rely upon.

Running tests continuously with guard

This cookbook is also setup to run the checks while you work via the guard gem.

bundle install
bundle exec guard start
  • Source hosted at GitHub
  • Report issues/Questions/Feature requests on GitHub as well

Pull requests are very welcome! Make sure your patches are well tested.


Copyright © 2009-2015, Sander van Zoest
Copyright © 2012, Mike Adolphs

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

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an "AS IS" BASIS,


See the License for the specific language governing permissions and

limitations under the License.

Dependent cookbooks

yum-epel >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

ssmtp Cookbook Changelog

This file is used to list changes made in each version of the ssmtp cookbook.

v0.5.0 (2018-02-20)

  • [GH-22] Set TLS_CA_File for all platforms by default (@chewi)
  • [GH-23] Update hostname to use the fqdn ohai as source (@drenalin23)
  • [GH-12] Add Scientific Linux support (@trinitronx)

v0.4.3 (2018-02-19)

  • [GH-26] Update ruby versions used for CI, releax yum-epel cookbook version requirement (@mburns)

v0.4.2 (2016-01-27)

  • [GH-21] added TLS_CA_File configuration support for RHEL/CentOS (sjourdan)
  • update gem dependencies
  • fix new rubocop offenses

v0.4.1 (2015-04-21)

  • [GH-20] Bump dependency of yum-epel to 0.6.0
  • Added source_url and issues_url to metadata

v0.4.0 (2014-10-29)

  • [GH-17] Modernize cookbook with latest development tools
  • Removed Vagrantfile as it is recommended to use test-kitchen instead
  • [GH-16] - Update yum epel dependency to support yum > 3.0
  • [GH-15] - Moves config file permissions to attributes
  • [GH-14] - Added ssmtp.auth_enabled (default true) and a bit of cleanup
  • [GH-13] - Add auth only when node['ssmtp']['auth_username'] attribute is set.

v0.3.1 (2013-07-08)

  • packaging error for 0.3.0


  • [GH-10] - Fixed so non-root users in mail group can send mail (trinitronx)
  • [GH-9] - Added support for RHEL family distros (trinitronx)
  • [GH-8] - This should fix the test kitchen integration for this cookbook (trinitronx)
  • [GH-7] - Update Berksfile :test dependency on cookbook: sysctl (trinitronx)
  • [GH-5] - Update test-kitchen dependency in Gemfile (trinitronx)
  • [GH-3] - Added use_tls attribute and enabled its use in the ssmtp.conf template (ianneub)
  • [GH-2] - Change from using node.domain to node['domain'] incase 'domain' is not available. (ianneub)


  • [GH-1] - Major overhaul (fooforge)


  • Initial Release

Collaborator Number Metric

0.5.0 passed this metric

Contributing File Metric

0.5.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Foodcritic Metric

0.5.0 passed this metric

No Binaries Metric

0.5.0 passed this metric

Testing File Metric

0.5.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Version Tag Metric

0.5.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must include a tag that matches this cookbook version number