filecheck

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package filecheck provides mail attachment file validation utilities shared by the emlbuilder and draft packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBlockedExtension

func CheckBlockedExtension(filename string) error

CheckBlockedExtension returns an error if the filename has a blocked extension.

func CheckInlineImageFormat

func CheckInlineImageFormat(filename string, content []byte) (string, error)

CheckInlineImageFormat validates that the file is an allowed inline image format by checking both extension and content-sniffed MIME type. Both must match the whitelist to prevent extension spoofing and MIME forgery. On success it returns the detected MIME type; callers MUST use this as the final Content-Type instead of trusting any user-supplied or inherited value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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