mailprint

package module
v0.0.0-...-afad6bc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

README

Mailprint Deluxe!

Mailprint is a replacement for muttprint: It reads an email on stdin and writes a PDF on stdout.

Installation and setup

Installation:

git clone github.com/gnoack/mailprint
cd mailprint
go install ./cmd/mailprint

In your muttrc:

set print_command="mailprint | lpr"

Alternatively, print it into a PDF viewer which first lets you look at the result:

set print_command="mailprint | zathura -"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindFont

func FindFont(fontName string, bold bool) (string, error)

FindFont uses Fontconfig to find the path to a font file given a string-formatted Fontconfig pattern (a font name) and weight.

It returns the path of the font file, discarding additional properties that may have been provided.

The Fontconfig pattern syntax ("Font name") is described at: https://www.freedesktop.org/software/fontconfig/fontconfig-user.html#AEN36

func RenderPdf

func RenderPdf(em *Email, opts *RenderOptions, w io.Writer) error

Types

type Email

type Email struct {
	Subject  string
	From     []*mail.Address
	To       []*mail.Address
	Cc       []*mail.Address
	Date     time.Time
	TextBody string
}

func Parse

func Parse(r io.Reader) (*Email, error)

type FontPathOptions

type FontPathOptions struct {
	Header     string
	HeaderBold string
	Content    string
}

func FindFonts

func FindFonts(headerFontName, contentFontName string) (FontPathOptions, error)

type RenderOptions

type RenderOptions struct {
	PageFormat string
	LogoPath   string
	FontPaths  FontPathOptions
}

Directories

Path Synopsis
cmd
mailnotify command
mailprint command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL