Skip to content

Instantly share code, notes, and snippets.

View swvanbuuren's full-sized avatar

Sietze van Buuren swvanbuuren

  • Robert Bosch GmbH
  • Hildesheim, Germany
View GitHub Profile
@swvanbuuren
swvanbuuren / readme.md
Created August 4, 2024 18:46
Decorator as a class with optional keyword arguments

Function decorator class with optional keyword arguments

The following features a class implementation for a function decorator in Python with an arbitrary number of optional keywords arguments.

Implementing the decorator as a class, has the advantage of encapsulation and ease of reuse.

Note that this code uses the python package wrapt, which can easily be installed using pip.

@swvanbuuren
swvanbuuren / fetchmail_msmtp_guide.md
Last active January 10, 2024 19:53
Fetching emails using fetchmail and relaying them with msmtp

Fetching emails using fetchmail and relaying them with msmtp

This is a short set of instructions how to regularly fetch emails from an IMAP server and relay them to another email address using an SMTP server.

Prerequisites

  • Debian based operating system; on a server or comparable (e.g. a Raspberry Pi) that runs continuously
  • Access to an IMAP server from which the emails are to be fetched
  • Access to an SMTP server to be able to send of the emails to another email address