npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

haraka-plugin-attachment

v1.2.1

Published

A message attachment scanning plugin for Haraka

Downloads

59,553

Readme

haraka-plugin-attachment

Build Status Code Climate

This plugin allows you to reject messages based on Content-Type anywhere in the MIME tree (the body and every nested part are walked) or on the filename of any attachment, including filenames inside expanded archives.

Limitations

The ctype regex rules are advisory: they match against the Content-Type headers the sender supplied, and a sender can lie. No magic-byte / file-signature inspection is performed. For hard blocking, prefer disallowed_extensions and the attachment.filename.regex / attachment.archive.filename.regex lists, which match on the actual filenames (including filenames discovered inside archives).

Encrypted archives that contain encrypted sub-archives cannot be expanded and will cause the plugin to reject the message.

Requirements

To check filenames inside archive files the npm module tmp is required and the bsdtar binary must be available.

If either tmp or bsdtar are unavailable then the plugin will not expand archives.

Logging

At INFO level logging this plugin will output the filename and type of each attached file along with an MD5 checksum of the contents. The MD5 checksum is useful to check against www.virustotal.com

Configuration

  • attachment.ini

    • default settings shown
    • timeout=30

      Timeout in seconds before the plugin will abort.

    • disallowed_extensions=exe,com,pif,bat,scr,vbs,cmd,cpl,dll

      File extensions that should be rejected when detected.

      [archive]

    • max_depth=5

      Maximum number of archive levels unpacked, counting the outermost archive as level 0. With max_depth=5, archives at depths 0..4 are unpacked and a 6th nested archive is rejected.

    • max_total_bytes=104857600

      Maximum total decompressed size, in bytes, summed across every archive expanded for a single message. Default 100 MiB. When the running total exceeds this budget the message is rejected.

    • max_total_entries=1000

      Maximum number of entries (files + directories) listed across every archive expanded for a single message. Default 1000. When the running total exceeds this budget the message is rejected.

      [archive]

    • extensions=zip,tar,tgz,taz,z,gz,rar,7z

      File extensions that should be treated as archives. This can be any file type supported by bsdtar.

  • attachment.filename.regex

    This file contains a list of regular expressions, one per line that will be tested against each filename found within a message. The first regexp to match will cause the message to be rejected. Any invalid regexps will be detected, reported and skipped.

  • attachment.archive.filename.regex

    This file contains a list of regular expressions, one per line that will be tested against each filename found within an archive file. The first regexp to match will cause the message to be rejected. Any invalid regexps will be detected, reported and skipped.

  • attachment.ctype.regex

    This file contains a list of regular expressions, one per line that will be tested against each MIME Content-Type header in the message. The first regexp to match will cause the message to be rejected. Any invalid regexps will be detected, reported and skipped.