Coder Social home page Coder Social logo

jop-software / imap-mailbox-exporter Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 2.0 42 KB

IMAP Mailbox exporter for prometheus

License: MIT License

Shell 0.75% Makefile 4.50% Go 88.35% Dockerfile 6.39%
hacktoberfest email email-monitoring exporter imap monitoring prometheus-exporter imap-monitoring

imap-mailbox-exporter's Introduction

Imap Mailbox Exporter

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

Usage

Probe

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

Provided metrics

# 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.

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

pushd examples

docker compose pull
docker compose up -d

Compilation

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

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

Alternativly you can use gnu make with the make build command to execute the go build command.

License

This project is licensed under the MIT License

© 2022, jop-software Inh. Johannes Przymusinski

imap-mailbox-exporter's People

Contributors

cngjo avatar

Watchers

 avatar

Forkers

mfournier qoqa

imap-mailbox-exporter's Issues

chore: publish to docker hub

We currently only push the image to the GHCR, if possible we should try to push the image also to hub.docker.com

Configuration for multiple imap accounts

Create YAML configuration which allows to define credentials for multiple accounts.

The configuration should be composed from two components:

  • Server
  • User
    Where a server can have multiple users.
    A user is composed of a username and a password.
    A server contains a hostname, port and list of users.

There should be a %env(ENVIRONMENT_VARIABLE)% directive, which loads the corresponding environment variable.

Multi Tenancy

This should be able to be configured with multiple IMAP Credentials so one of this exporters can be used to scrape multiple mailboxes from different users on different servers.

There should be a way to pass a user and server parameter to determine which user and server to use and which password to load from configuration.

The configuration will most likely be to complex to be configured from only environment variables.
But it should be possible to load credentials from environment variables to not store them in config files - which are potential versioned in VCS

Tasks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.