---
title: Charmhub | smtp interface
description: Interfaces describe the relation between two charms. This interface shows
  opinionated, standardized interface specifications for charm relations.
url: https://charmhub.io/integrations/smtp
---

# smtp

## Overview

This relation interface specification describes the expected behavior of charms integrating over the `smtp` Juju interface to provide or consume SMTP data.

## Usage

In most cases, this will be accomplished using the [smtp library](https://github.com/canonical/smtp-integrator-operator/blob/main/lib/charms/smtp_integrator/v0/smtp.py), although charm developers are free to provide alternative libraries as long as they fulfil the behavioural and schematic requirements described in this document.

## Direction

The `smtp` interface implements a provider/requirer pattern.
The requirer is a charm that requires SMTP details to connect to an SMTP server, and the provider is a charm holding those details.

```
flowchart TD
    Provider -- host, port, user, password_id, auth_type, transport_security, domain --> Requirer
```

or alternatively, if secrets are not supported by either sides

```
flowchart TD
    Provider -- host, port, user, password, auth_type, transport_security, domain --> Requirer
```

## Behavior

The requirer and the provider must adhere to a certain set of criteria to be considered compatible with the interface.

### Provider

* Is expected to provide the SMTP details so that the requirer can connect.

### Requirer

* Is not expected to publish anything

## Relation Data

### Provider

[[Pydantic Schema]](https://github.com/canonical/charmlibs/blob/main/interfaces/smtp/interface/vv0/schema.py)

Provider publishes the SMTP configuration. It should be placed in the **application** databag.

#### Example

```
related-units: {}
application_data: {
  "host": "example.com",
  "port": "587",
  "user": "example_user",
  "password_id": "01548499c9233d4612352c989162d940f6a9e6f6d5cc058dfcf66f51575e09c2",
  "auth_type": "plain",
  "transport_security": "tls",
  "domain": "example.com",
}
```

## Charms implementing this interface

### Providers

* [smtp-integrator](https://charmhub.io/smtp-integrator)

### Requirers

## Other charms using this interface

### Providers

* [smtp-integrator](https://charmhub.io/smtp-integrator)

### Requirers

* [opensearch](https://charmhub.io/opensearch)
* [mattermost-k8s](https://charmhub.io/mattermost-k8s)
* [indico](https://charmhub.io/indico)
* [kratos](https://charmhub.io/kratos)
* [superset-k8s](https://charmhub.io/superset-k8s)
