Giter Site home page Giter Site logo

yoannperriolat / mac-signature-installer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cloudunder/mac-signature-installer

0.0 1.0 0.0 37 KB

Script helping to install HTML email signatures in Mail.app on macOS

License: MIT License

Shell 77.42% JavaScript 22.58%

mac-signature-installer's Introduction

HTML Email Signature Installer for Mail.app (macOS)

Build Status npm version

This repository contains a shell script (Bash), which should make it easier for Mac users to install custom email signatures in the Mail.app.

Although it is not an app with a fancy UI, it is still much easier to use than trying to do all steps manually in the Terminal.

This is particularly handy for companies who want to provide their employees a fairly easy way to install email signatures.

The script expects that you already have a .mailsignature file ready to be installed. This script does not create or convert the signature itself.

Please be aware that this script has not been tested too much. In theory it should also work for some older versions. Although the script should be pretty safe to use, use at your own risk and as always make sure to have a backup of your data. Let us know if it works for you.

How it works

The script has a few sanity-checks built in, which, for example, checks the version of the operating system and if the provided mailsignature file (very) roughly looks like it is one and not something completely else.

It tries to detect the Mail directory used by the Mail.app and should be able to also recognize if the Mail settings are iCloud-synced.

If everything looks well, the user is instructed to go into the Mail preferences, create or pick a signature to be replaced and enter the name into the Terminal window and continue with Enter.

The script then tries to find that signature in the settings and will only proceed if found.

The user is then asked to quit Mail to ensure that changes do not conflict with the running app. The script will continue automatically as soon as Mail has terminated.

The script will then override the existing .mailsignature file with the new file provided and the user may open Mail again.

Usage

1. Pass file as an argument

Example:

./mac-signature-installer.command mysignature.mailsignature

2. Bake in the signature

Especially for a company-wide email signature roll-out, it may be useful to prepare or generate a custom script for each employee with their signature already baked into the script. This makes it even easier as users can run the installer script by simply double-clicking the .command file.

To embed the signature into the script, insert the signature data between the two lines containing the string EndOfStaticRawSignature.

If a signature is embedded, the filename argument will be ignored.

2.1 JavaScript for baking

To generate a copy of the installer script with the signature already baked in as described, you may find the included JavaScript function useful. The function is also available as Node.js package via npm install mac-signature-installer.

const macSignatureInstaller = require('mac-signature-installer');
const mailsignature = '...'; // You have to provide this
const shellScript = macSignatureInstaller(mailsignature);
// You may then e.g. write the content (string) to disk.

Change Log

0.2.0

  • Make installer compatible with macOS 10.13 "High Sierra".
  • If signature does not contain the Mime-Version: 1.0 header, the necessary MIME headers will be generated automatically.
  • You can now set FIXED_SIGNATURE_NAME in the installer script to hard-code a name for the signature. The user will then not be asked to enter the name of the signature.

mac-signature-installer's People

Watchers

 avatar

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.