An open API service indexing awesome lists of open source software.

https://github.com/jop-software/imap-mailbox-exporter

IMAP Mailbox exporter for prometheus
https://github.com/jop-software/imap-mailbox-exporter

email email-monitoring exporter hacktoberfest imap imap-monitoring monitoring prometheus-exporter

Last synced: about 2 months ago
JSON representation

IMAP Mailbox exporter for prometheus

Awesome Lists containing this project

README

        

# Imap Mailbox Exporter

> Export the amount of mails in a mailbox for use in prometheus.

## Usage

### Probe

```txt
http://127.0.0.1:9101/probe?target=INBOX&hostname=imap.example.com&[email protected]
```

### Provided metrics

```txt
# HELP probe_mailbox_count Displays the count of mails found in the mailbox
# TYPE probe_mailbox_count gauge
probe_mailbox_count 0
```

### Configuration

The `imap-mailbox-exporter` can be configures with a `config.yaml` file and environment variables.

```yaml
server:
- hostname: 'imap.example.com'
port: '993'
accounts:
- username: '[email protected]'
password: 'env:E_AT_MAIL_COM_PASSWORD'
```

You can use environment variables with the `env:VARIABLE_NAME` directive in YAML.

The configuration file is expected in `./config.yaml` relative to the `imap-mailbox-exporter` binary.

### Example Usage

You can find a example docker compose configuration.

Make sure to update `examples/imap-exporter.env` with your imap credentials.

**Start the example container**

```shell
pushd examples

docker compose pull
docker compose up -d
```

## Compilation

You can compile the source-code with the `go build` command.

```bash
go build -o imap-mailbox-exporter main.go
```

Alternativly you can use [`gnu make`](https://www.gnu.org/software/make/) with the `make build` command to execute the `go build` command.

## License

This project is licensed under the [MIT License](./LICENCE)


© 2022, jop-software Inh. Johannes Przymusinski