Skip to content

Commit

Permalink
Release v1.1.1 (#37)
Browse files Browse the repository at this point in the history
- dep: eslint-plugin-haraka -> @haraka/eslint-config
- lint: remove duplicate / stale rules from .eslintrc
- populate `[files]` in package.json. Delete .npmignore.
- doc: Changes -> CHANGELOG
- doc(CHANGELOG): fixed broken release link
- prettier

Closes #35
  • Loading branch information
msimerson authored Apr 8, 2024
1 parent 97927e4 commit 52c2618
Show file tree
Hide file tree
Showing 12 changed files with 992 additions and 898 deletions.
19 changes: 2 additions & 17 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,6 @@ env:
node: true
es6: true
mocha: true
es2020: true
es2022: true

plugins:
- haraka

extends:
- eslint:recommended
- plugin:haraka/recommended

root: true

globals:
OK: true
CONT: true
DENY: true
DENYSOFT: true
DENYDISCONNECT: true
DENYSOFTDISCONNECT: true
extends: ['@haraka']
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: CI

on: [ push, pull_request ]
on: [push, pull_request]

env:
CI: true

jobs:

lint:
uses: haraka/.github/.github/workflows/lint.yml@master

Expand All @@ -15,9 +14,9 @@ jobs:
# secrets: inherit

ubuntu:
needs: [ lint ]
needs: [lint]
uses: haraka/.github/.github/workflows/ubuntu.yml@master

windows:
needs: [ lint ]
needs: [lint]
uses: haraka/.github/.github/workflows/windows.yml@master
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: "CodeQL"
name: 'CodeQL'

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]
schedule:
- cron: '18 7 * * 4'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ env:
jobs:
publish:
uses: haraka/.github/.github/workflows/publish.yml@master
secrets: inherit
secrets: inherit
58 changes: 0 additions & 58 deletions .npmignore

This file was deleted.

1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
singleQuote: true
2 changes: 1 addition & 1 deletion .release
22 changes: 15 additions & 7 deletions Changes.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,48 @@
# Changelog

The format is based on [Keep a Changelog](https://keepachangelog.com/).

### Unreleased

### [1.1.1] - 2024-04-08

- dep: eslint-plugin-haraka -> @haraka/eslint-config
- lint: remove duplicate / stale rules from .eslintrc
- populate `[files]` in package.json. Delete .npmignore.
- doc: Changes -> CHANGELOG
- doc(CHANGELOG): fixed broken release link
- prettier

### [1.1.0] - 2024-03-20

- chore: bump version deps, and pin them
- fix: minor debug logging issue #32
- fix: restored missing function call #31


### [1.0.7] - 2022-06-16

- import fresh from Haraka
- convert tests to mocha


### 1.0.6 - Dec 22, 2021

- Fix issue with nested archives not getting counted, #26
- replace travis & appveyor with GHA


### 1.0.5 - Aug 21, 2018

- more tests
- update attachment.ini to reflect newer syntax
- fix a cfg path issue
- remove leading dot from file_ext


### 1.0.4 - Aug 21, 2018

- finished converting tests to mocha, tests work again. Yay.
- es6 updates
- backported changes from haraka/plugins/attachment.js


[1.0.7]: https://github.com/haraka/haraka-plugin-attachment/releases/tag/1.0.7
[1.1.0]: https://github.com/haraka/haraka-plugin-attachment/releases/tag/1.1.0
[1.0.6]: https://github.com/haraka/haraka-plugin-attachment/releases/tag/v1.0.6
[1.0.7]: https://github.com/haraka/haraka-plugin-attachment/releases/tag/v1.0.7
[1.1.0]: https://github.com/haraka/haraka-plugin-attachment/releases/tag/v1.1.0
[1.1.1]: https://github.com/haraka/haraka-plugin-attachment/releases/tag/v1.1.1
43 changes: 18 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,85 +1,78 @@
attachment
==========
# attachment

[![Build Status][ci-img]][ci-url]
[![Code Climate][clim-img]][clim-url]
[![NPM][npm-img]][npm-url]

This plugin allows you to reject messages based on Content-Type within the message or any MIME parts or on the filename of any attachments.

Limitations
-----------
## Limitations

This plugin cannot detect forged MIME types where the sender is lying about the type. The type is not confirmed in any way currently.
This plugin cannot detect forged MIME types where the sender is lying about the type. The type is not confirmed in any way currently.

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


Requirements
------------
## 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
-------
## 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

Configuration
-------------
- attachment.ini

* attachment.ini
* default settings shown
- default settings shown

- timeout=30
* timeout=30

Timeout in seconds before the plugin will abort.

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

File extensions that should be rejected when detected.

[archive]
- max\_depth=5

* max_depth=5

The maximum level of nested archives that will be unpacked.
If this is exceeded the message will be rejected.

[archive]
- extensions=zip,tar,tgz,taz,z,gz,rar,7z

* 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
- 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
- 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
- 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.



<!-- leave these buried at the bottom of the document -->

[ci-img]: https://github.com/haraka/haraka-plugin-attachment/actions/workflows/ci.yml/badge.svg
[ci-url]: https://github.com/haraka/haraka-plugin-attachment/actions/workflows/ci.yml
[clim-img]: https://codeclimate.com/github/haraka/haraka-plugin-attachment/badges/gpa.svg
Expand Down
Loading

0 comments on commit 52c2618

Please sign in to comment.