{"_id":"54fda39021538c21006c49b2","user":"545e246f7ca5470800b3a1b1","__v":0,"githubsync":"","version":{"_id":"54fda38e21538c21006c49a6","__v":3,"forked_from":"54eb4535615ffc19003059f0","project":"545e249c7ca5470800b3a1b2","createdAt":"2015-03-09T13:43:42.927Z","releaseDate":"2015-03-09T13:43:42.927Z","categories":["54fda38f21538c21006c49a7","54fda38f21538c21006c49a8","54fda38f21538c21006c49a9","54fda38f21538c21006c49aa","54fda38f21538c21006c49ab","54fda3d347f93619001d2ae2","54fea8975c4ab10d00ef4279"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"0.5.0","version":"0.5.0"},"category":{"_id":"54fda38f21538c21006c49ab","__v":0,"version":"54fda38e21538c21006c49a6","project":"545e249c7ca5470800b3a1b2","pages":[],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-12-30T12:56:41.564Z","from_sync":false,"order":3,"slug":"notifiers","title":"Notifiers"},"project":"545e249c7ca5470800b3a1b2","metadata":{"title":"","description":"","image":[]},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-12-30T12:57:23.396Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"never","params":[],"url":""},"isReference":false,"order":0,"body":"The email notifier allows you to receive a report on success or failure of each of your backup jobs. It uses the [Mail](https://github.com/mikel/mail) library thus supports several delivery methods (namely SMTP, sendmail and exim) to deliver the backup reports.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Common options\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Option\",\n    \"h-1\": \"Description\",\n    \"0-2\": \"Required: yes\",\n    \"0-0\": \"`from`\",\n    \"0-1\": \"The sender's email address\",\n    \"1-0\": \"`to`\",\n    \"1-1\": \"The recipient's email address\",\n    \"1-2\": \"Required: yes\",\n    \"2-0\": \"`using`\",\n    \"2-1\": \"The delivery method, see below\",\n    \"2-2\": \"Required: yes\",\n    \"3-0\": \"`with`\",\n    \"3-1\": \"The delivery settings, see below\",\n    \"3-2\": \"Required: no\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]\nYou'll likely want to [Specify default values](doc:specify-default-values) globally for email notifications.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"SMTP\"\n}\n[/block]\nSending through a local STMP server does not require any specific setup. You only have to provide the sender's and recipient's addresses.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"job \\\"my-project\\\" do\\n  ...\\n  notify via: 'email',\\n  \\tfrom: \\\"sender:::at:::example.com\\\",\\n  \\tto: \\\"me@example.com\\\",\\n  \\tusing: \\\"smtp\\\"\\nend\",\n      \"language\": \"ruby\",\n      \"name\": \"Sheepfile\"\n    }\n  ]\n}\n[/block]\n## SMTP delivery settings\n\nSMTP settings can be specified by providing to the `with` option an hash of settings:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"job \\\"my-project\\\" do\\n  ...\\n  notify via: 'email',\\n  \\tfrom: \\\"sender@example.com\\\",\\n  \\tto: \\\"me@example.com\\\",\\n  \\tusing: \\\"smtp\\\",\\n  \\twith: {\\n      address: \\\"smtp.example.com\\\",\\n      user_name: \\\"user\\\",\\n      password: \\\"secret\\\"\\n    }\\nend\",\n      \"language\": \"ruby\",\n      \"name\": \"Sheepfile\"\n    }\n  ]\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Setting\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"\",\n    \"0-0\": \"`address`\",\n    \"0-1\": \"The hostname or IP address of the SMTP server\",\n    \"0-2\": \"Defaults to: `localhost`\",\n    \"1-0\": \"`port`\",\n    \"1-1\": \"The port number the SMTP server listens to.\",\n    \"1-2\": \"Defaults to: `25`\",\n    \"2-0\": \"`domain`\",\n    \"2-2\": \"Defaults to: `localhost.localdomain`\",\n    \"2-1\": \"The _HELO_ domain (the host to send the message from).\",\n    \"3-0\": \"`user_name`\",\n    \"3-1\": \"The username to use for authentication\",\n    \"4-0\": \"`password`\",\n    \"4-1\": \"The password to use for authentication\",\n    \"5-0\": \"`authentication`\",\n    \"5-1\": \"The authentication method\",\n    \"5-2\": \"One of: `plain`, `login` or `cram_md5`\",\n    \"6-0\": \"`enable_starttls_auto`\",\n    \"6-1\": \"Indicates whether the notifier should create an initial connection to the SMTP server, then upgrade it to enable encryption\",\n    \"6-2\": \"Defaults to: `true`\",\n    \"7-0\": \"`ssl`\",\n    \"7-1\": \"Indicates whether the notifier should directly try to connect using an `SSL` connection\",\n    \"8-0\": \"`tls`\",\n    \"7-2\": \"Defaults to: `false`\",\n    \"8-1\": \"Indicates whether the notifier should directly try to connect using a `TLS` connection\",\n    \"8-2\": \"Defaults to: `false`\"\n  },\n  \"cols\": 3,\n  \"rows\": 9\n}\n[/block]\n\n## Common configurations\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"job \\\"my-project\\\" do\\n  ...\\n  notify via: \\\"email\\\",\\n    from: \\\"sender@example.com\\\",\\n    to: \\\"me@example.com\\\",\\n    using: \\\"smtp\\\", with: {\\n      address: \\\"smtp.gmail.com\\\",\\n      domain: \\\"your.hostname.com\\\",\\n      port: 587,\\n      user_name: \\\"gmail-username\\\",\\n      password: \\\"gmail-password\\\",\\n      authentication: \\\"plain\\\",\\n      enable_starttls_auto: true\\n    }\\nend\",\n      \"language\": \"ruby\",\n      \"name\": \"Gmail\"\n    },\n    {\n      \"code\": \"project \\\"my-project\\\" do\\n  ...\\n  notify via: \\\"email\\\",\\n    from: \\\"sender@example.com\\\",\\n    to: \\\"me@example.com\\\",\\n    using: \\\"smtp\\\", with: {\\n      address: \\\"smtp.sendgrid.net\\\",\\n      domain: \\\"your.hostname.com\\\",\\n      port: 25, # 587 and 2525 also supported with STARTTLS\\n      user_name: \\\"sendgrid-username\\\",\\n      password: \\\"sendgrid-password\\\",\\n      authentication: \\\"plain\\\",\\n      enable_starttls_auto: true\\n    }\\nend\",\n      \"language\": \"ruby\",\n      \"name\": \"Sendgrid\"\n    },\n    {\n      \"code\": \"project \\\"my-project\\\" do\\n  ...\\n  notify via: \\\"email\\\",\\n    from: \\\"sender@example.com\\\",\\n    to: \\\"me@example.com\\\",\\n    using: \\\"smtp\\\", with: {\\n      address: \\\"smtp.mandrillapp.com\\\",\\n      domain: \\\"your.hostname.com\\\",\\n      port: 25, # 587 and 2525 also supported with STARTTLS\\n      user_name: \\\"mandrill-username\\\",\\n      password: \\\"mandrill-password\\\",\\n      authentication: \\\"login\\\",\\n      enable_starttls_auto: true\\n    }\\nend\",\n      \"language\": \"ruby\",\n      \"name\": \"Mandrill\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Sendmail\"\n}\n[/block]\nThis delivery method requires the `sendmail` binary to be present. It usually resides in `/usr/sbin/sendmail` and is provided by the Sendmail or Postfix packages. A lightweight alternative is SSMTP which redirects calls to `sendmail` to an external SMTP server.\n\n_The notifier assumes the Sendmail program is properly configured._\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Option\",\n    \"h-1\": \"Description\",\n    \"0-2\": \"Required: no\",\n    \"0-0\": \"`location`\",\n    \"0-1\": \"The absolute path to the `sendmail` program\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"project \\\"my-project\\\" do\\n  ...\\n  notify via: \\\"email\\\",\\n    from: \\\"sender@example.com\\\",\\n    to: \\\"me@example.com\\\",\\n  \\tusing: \\\"sendmail\\\", with: {\\n      # Optional, the default location usually does the job\\n      location: \\\"/path/to/sendmail\\\"\\n    }\\nend\",\n      \"language\": \"ruby\",\n      \"name\": \"Sendmail\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Exim\"\n}\n[/block]\nThis delivery method requires the `exim` binary to be present. It usually resides in `/usr/sbin/exim` and is provided by the Exim4 package.\n\n_The notifier assumes the Exim program is properly configured._\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Option\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`location`\",\n    \"0-1\": \"The absolute path to the `exim` program\",\n    \"0-2\": \"Required: no\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"project \\\"my-project\\\" do\\n  ...\\n  notify via: \\\"email\\\",\\n    from: \\\"sender@example.com\\\",\\n    to: \\\"me@example.com\\\",\\n    using: \\\"exim\\\", with: {\\n      # Optional, the default location usually does the job\\n      location: \\\"/path/to/exim\\\"\\n    }\\nend\",\n      \"language\": \"ruby\",\n      \"name\": \"Exim\"\n    }\n  ]\n}\n[/block]","excerpt":"Send backup reports as email","slug":"email","type":"basic","title":"Email"}

Email

Send backup reports as email

The email notifier allows you to receive a report on success or failure of each of your backup jobs. It uses the [Mail](https://github.com/mikel/mail) library thus supports several delivery methods (namely SMTP, sendmail and exim) to deliver the backup reports. [block:api-header] { "type": "basic", "title": "Common options" } [/block] [block:parameters] { "data": { "h-0": "Option", "h-1": "Description", "0-2": "Required: yes", "0-0": "`from`", "0-1": "The sender's email address", "1-0": "`to`", "1-1": "The recipient's email address", "1-2": "Required: yes", "2-0": "`using`", "2-1": "The delivery method, see below", "2-2": "Required: yes", "3-0": "`with`", "3-1": "The delivery settings, see below", "3-2": "Required: no" }, "cols": 3, "rows": 4 } [/block] You'll likely want to [Specify default values](doc:specify-default-values) globally for email notifications. [block:api-header] { "type": "basic", "title": "SMTP" } [/block] Sending through a local STMP server does not require any specific setup. You only have to provide the sender's and recipient's addresses. [block:code] { "codes": [ { "code": "job \"my-project\" do\n ...\n notify via: 'email',\n \tfrom: \"sender@example.com\",\n \tto: \"me@example.com\",\n \tusing: \"smtp\"\nend", "language": "ruby", "name": "Sheepfile" } ] } [/block] ## SMTP delivery settings SMTP settings can be specified by providing to the `with` option an hash of settings: [block:code] { "codes": [ { "code": "job \"my-project\" do\n ...\n notify via: 'email',\n \tfrom: \"sender@example.com\",\n \tto: \"me@example.com\",\n \tusing: \"smtp\",\n \twith: {\n address: \"smtp.example.com\",\n user_name: \"user\",\n password: \"secret\"\n }\nend", "language": "ruby", "name": "Sheepfile" } ] } [/block] [block:parameters] { "data": { "h-0": "Setting", "h-1": "Description", "h-2": "", "0-0": "`address`", "0-1": "The hostname or IP address of the SMTP server", "0-2": "Defaults to: `localhost`", "1-0": "`port`", "1-1": "The port number the SMTP server listens to.", "1-2": "Defaults to: `25`", "2-0": "`domain`", "2-2": "Defaults to: `localhost.localdomain`", "2-1": "The _HELO_ domain (the host to send the message from).", "3-0": "`user_name`", "3-1": "The username to use for authentication", "4-0": "`password`", "4-1": "The password to use for authentication", "5-0": "`authentication`", "5-1": "The authentication method", "5-2": "One of: `plain`, `login` or `cram_md5`", "6-0": "`enable_starttls_auto`", "6-1": "Indicates whether the notifier should create an initial connection to the SMTP server, then upgrade it to enable encryption", "6-2": "Defaults to: `true`", "7-0": "`ssl`", "7-1": "Indicates whether the notifier should directly try to connect using an `SSL` connection", "8-0": "`tls`", "7-2": "Defaults to: `false`", "8-1": "Indicates whether the notifier should directly try to connect using a `TLS` connection", "8-2": "Defaults to: `false`" }, "cols": 3, "rows": 9 } [/block] ## Common configurations [block:code] { "codes": [ { "code": "job \"my-project\" do\n ...\n notify via: \"email\",\n from: \"sender@example.com\",\n to: \"me@example.com\",\n using: \"smtp\", with: {\n address: \"smtp.gmail.com\",\n domain: \"your.hostname.com\",\n port: 587,\n user_name: \"gmail-username\",\n password: \"gmail-password\",\n authentication: \"plain\",\n enable_starttls_auto: true\n }\nend", "language": "ruby", "name": "Gmail" }, { "code": "project \"my-project\" do\n ...\n notify via: \"email\",\n from: \"sender@example.com\",\n to: \"me@example.com\",\n using: \"smtp\", with: {\n address: \"smtp.sendgrid.net\",\n domain: \"your.hostname.com\",\n port: 25, # 587 and 2525 also supported with STARTTLS\n user_name: \"sendgrid-username\",\n password: \"sendgrid-password\",\n authentication: \"plain\",\n enable_starttls_auto: true\n }\nend", "language": "ruby", "name": "Sendgrid" }, { "code": "project \"my-project\" do\n ...\n notify via: \"email\",\n from: \"sender@example.com\",\n to: \"me@example.com\",\n using: \"smtp\", with: {\n address: \"smtp.mandrillapp.com\",\n domain: \"your.hostname.com\",\n port: 25, # 587 and 2525 also supported with STARTTLS\n user_name: \"mandrill-username\",\n password: \"mandrill-password\",\n authentication: \"login\",\n enable_starttls_auto: true\n }\nend", "language": "ruby", "name": "Mandrill" } ] } [/block] [block:api-header] { "type": "basic", "title": "Sendmail" } [/block] This delivery method requires the `sendmail` binary to be present. It usually resides in `/usr/sbin/sendmail` and is provided by the Sendmail or Postfix packages. A lightweight alternative is SSMTP which redirects calls to `sendmail` to an external SMTP server. _The notifier assumes the Sendmail program is properly configured._ [block:parameters] { "data": { "h-0": "Option", "h-1": "Description", "0-2": "Required: no", "0-0": "`location`", "0-1": "The absolute path to the `sendmail` program" }, "cols": 3, "rows": 1 } [/block] [block:code] { "codes": [ { "code": "project \"my-project\" do\n ...\n notify via: \"email\",\n from: \"sender@example.com\",\n to: \"me@example.com\",\n \tusing: \"sendmail\", with: {\n # Optional, the default location usually does the job\n location: \"/path/to/sendmail\"\n }\nend", "language": "ruby", "name": "Sendmail" } ] } [/block] [block:api-header] { "type": "basic", "title": "Exim" } [/block] This delivery method requires the `exim` binary to be present. It usually resides in `/usr/sbin/exim` and is provided by the Exim4 package. _The notifier assumes the Exim program is properly configured._ [block:parameters] { "data": { "h-0": "Option", "h-1": "Description", "0-0": "`location`", "0-1": "The absolute path to the `exim` program", "0-2": "Required: no" }, "cols": 3, "rows": 1 } [/block] [block:code] { "codes": [ { "code": "project \"my-project\" do\n ...\n notify via: \"email\",\n from: \"sender@example.com\",\n to: \"me@example.com\",\n using: \"exim\", with: {\n # Optional, the default location usually does the job\n location: \"/path/to/exim\"\n }\nend", "language": "ruby", "name": "Exim" } ] } [/block]