Git Product home page Git Product logo

haraka-plugin-access's Introduction

Haraka - a Node.js Mail Server

Tests Coverage Status

Haraka is a highly scalable node.js email server with a modular plugin architecture. Haraka can serve thousands of concurrent connections and deliver thousands of messages per second. Haraka and plugins are written in asynchronous JS and are very fast.

Haraka has very good spam protection (see plugins) and works well as a filtering MTA. It also works well as a MSA running on port 587 with auth and dkim_sign plugins enabled.

Haraka makes no attempt to be a mail store (like Exchange or Postfix/Exim/Qmail), a LDA, nor an IMAP server (like Dovecot or Courier). Haraka is typically used with such systems.

Haraka has a scalable outbound mail delivery engine built in. Mail marked as relaying (such as via an auth plugin) is automatically queued for outbound delivery.

Getting Help

Screencast

Getting started with Haraka

Why Use Haraka?

Haraka's plugin architecture provides an easily extensible MTA that complements traditional MTAs that excel at managing mail stores but do not have sufficient filtering.

The plugin system makes it easy to code new features. A typical example is providing qmail-like extended addresses to an Exchange system, whereby you could receive mail as [email protected], and yet still have it correctly routed to [email protected]. This is a few lines of code in Haraka.

Plugins are provided for running mail through SpamAssassin, validating HELO names, checking DNS Blocklists, and many others.

Installing Haraka

Haraka requires node.js to run. Install Haraka with npm:

# If the second command gives "nobody" errors, uncomment & run the next command
# npm -g config set user root
npm install -g Haraka

After installation, use the haraka binary to set up the service.

Running Haraka

First, create the service:

haraka -i /path/to/haraka_test

That creates the directory haraka_test with config and plugin directories within. It also sets the host name used by Haraka to the output of hostname.

If hostname is not correct, edit config/host_list. For example, to receive mail addressed to [email protected], add domain.com to the config/host_list file.

Finally, start Haraka using root permissions:

haraka -c /path/to/haraka_test

And it will run.

Configure Haraka

To choose which plugins run, edit config/plugins. Plugins control the overall behaviour of Haraka. By default, only messages to domains listed in config/host_list will be accepted and then delivered via the smtp-forward plugin. Configure the destination in config/smtp_forward.ini.

Read the Fine Manual

haraka -h plugins/$name

The docs detail how each plugin is configured. After editing config/plugins, restart Haraka and enjoy!

Running from git

If you are unable to use npm to install Haraka, you can run from git by following these steps:

First clone the repository:

$ git clone https://github.com/haraka/Haraka.git
$ cd Haraka

Install Haraka's node.js dependencies locally:

$ npm install

Edit config/plugins and config/smtp.ini to specify the plugins and config you want.

Finally run Haraka:

$ node haraka.js

License and Author

Haraka is MIT licensed - see the LICENSE file for details.

Haraka is a project started by Matt Sergeant, a 10 year veteran of the email and anti-spam world. Previous projects have been the project leader for SpamAssassin and a hacker on Qpsmtpd.

haraka-plugin-access's People

Contributors

dexus avatar greenkeeper[bot] avatar luto avatar msimerson avatar polarismail avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

haraka-plugin-access's Issues

Blocking outgoing mail to individual email-address not working with access plugin

system info

Ubuntu 18.04
Haraka 2.8.2
Node v12.15.0

Expected behavior

When adding [email protected] to config/access.domains I expect outgoing mail to be refused to this address. It this not possible through access-plugin?

Observed behavior

Outgoing mail is delivered to this address, in spite of the configuration. To add, adding a complete domain (e.g.: gmail.com) to config/access.domains then the email-address is correctly blocked

Steps to reproduce

  • add access plugin to config/plugins
  • add config/access.ini with contents [check] any=true
  • add config/access.domains with contents [email protected]

An in-range update of haraka-test-fixtures is breaking the build 🚨

Version 1.0.21 of haraka-test-fixtures just got published.

Branch Build failing 🚨
Dependency haraka-test-fixtures
Current Version 1.0.20
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As haraka-test-fixtures is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
  • continuous-integration/appveyor/branch AppVeyor build succeeded Details

Commits

The new version differs by 2 commits ahead by 2, behind by 4.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

access: standardize & modernize

  • populate [files] in package.json. Delete .npmignore.
  • automated code linting. #3308
    • dep: eslint-plugin-haraka -> @haraka/eslint-config
    • update 'lint' script in package.json
    • verify 'lint' CI test config
  • lint: remove duplicate / stale rules from .eslintrc
  • automated code formatting (see also #3308)
  • automated CI testing.
    • mostly done, verify that local copy of ci.yml is up-to-date.
  • CONTRIBUTORS: see 3309
  • consistent naming of "special" files like CHANGELOG.md.
  • CHANGELOG: verify links at bottom (due to inconsistent tag naming)
    • latest .release does this, fixes most, and warns of errors it can't fix
  • verify GitHub repo About link points to npm package
  • convert test suites to mocha "style"
    • works great today and with node --test in v18+

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

non-regex lists handle case sensitivity in a confusing way

Having one of the following constellations causes the plugin to not allow addresses, which are whitelisted:

a) list says [email protected], client says [email protected]
b) list says [email protected], client says [email protected]

while these will be allowed:

c) list says [email protected], client says [email protected]
d) list says [email protected], client says [email protected]

This is because currently load_file() converts all lists to lowerCase, but the checks do not convert the address given by the client (except for rdns_access). Case a) vs. c) is particularly confusing.

I'd like to change this so that case is ignored in for all methods and all checks, by removing the extra code in rdns_access and adding a simple address.toLowerCase() to in_list(), as well as tests, ofc.
Since the RFC allows for local part of a mail address to be case sensitive, this may be a breaking change in some setups. However, I suspect that most of those setups would already be broken by behavior a) (FOO != FOO). If you are concerned about this, the new behavior may be hidden behind a config flag.

Please let me know what you think. I am happy to code up a PR for this once we reach a consensus about the "right" way to do this. :)

Bad From address causes Haraka to crash

system info

Haraka Haraka.js — Version: 2.8.25
Node v13.12.0
OS Linux mx3.bluestreak.net 3.10.0-1062.18.1.el7.x86_64 haraka/Haraka#1 SMP Tue Mar 17 23:49:17 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
openssl OpenSSL 1.0.2k-fips 26 Jan 2017

Expected behavior

No crash

Observed behavior

This From address causes an exception that isn't caught.
From: =?utf-8?q?Demand_a_Vote-by-Mail_Option_NOW_=E2=86=92_=5BECU=5D?= [email protected]

Apr 6 14:04:55 mx3 haraka[31367]: [CRIT] [CF6B80E5-5CCB-4E18-A19D-A89B89BA079F.1] [core] Plugin access failed: Error: No results
at Object.parse (/usr/local/share/.config/yarn/global/node_modules/address-rfc2822/index.js:20:22)
at Plugin.exports.data_any (/usr/local/share/.config/yarn/global/node_modules/haraka-plugin-access/index.js:389:28)
at Object.plugins.run_next_hook (/usr/local/share/.config/yarn/global/node_modules/Haraka/plugins.js:535:28)
at Object.plugins.run_hooks (/usr/local/share/.config/yarn/global/node_modules/Haraka/plugins.js:449:13)
at MessageStream.end_callback (/usr/local/share/.config/yarn/global/node_modules/Haraka/connection.js:1660:21)
at MessageStream._write (/usr/local/share/.config/yarn/global/node_modules/Haraka/messagestream.js:137:41)
at ChunkEmitter. (/usr/local/share/.config/yarn/global/node_modules/Haraka/messagestream.js:63:22)
at ChunkEmitter.emit (events.js:315:20)
at ChunkEmitter.end (/usr/local/share/.config/yarn/global/node_modules/Haraka/chunkemitter.js:58:18)
at MessageStream.add_line_end (/usr/local/share/.config/yarn/global/node_modules/Haraka/messagestream.js:114:28)

Steps to reproduce

See above From address

An in-range update of eslint-plugin-haraka is breaking the build 🚨

The devDependency eslint-plugin-haraka was updated from 1.0.11 to 1.0.12.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-haraka is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/appveyor/branch: AppVeyor build succeeded (Details).
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 1 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of eslint-plugin-haraka is breaking the build 🚨

The devDependency eslint-plugin-haraka was updated from 1.0.9 to 1.0.10.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-haraka is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/appveyor/branch: AppVeyor build succeeded (Details).
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

feature request: comments in list files

"(for example mail_from.access.whitelist or connect.rdns_access.whitelist) Do these files support comments (like "#" or ";") ? I would like to comment some IPs/Domainnames, why I added them, so I later can more easily maintain/remove them, if needed."

Subdomains for internal email

I need to block outgoing emails from all the @internal.example.com to any non @example.com or @sub.example.com account (all my subdomains should be fine) while keeping the ability to send emails from @example.com or others subdomains to any address (including Gmail or Outlook that should be blocked for @internal.example.com accounts).

Can I do that with this plugin? How?

An in-range update of eslint is breaking the build 🚨

Version 5.0.0 of eslint was just published.

Branch Build failing 🚨
Dependency [eslint](https://github.com/eslint/eslint)
Current Version 4.19.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

eslint is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/appveyor/branch AppVeyor build succeeded Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes v5.0.0

Release blogpost

Migration guide

  • 0feedfd New: Added max-lines-per-function rule (fixes #9842) (#10188) (peteward44)
  • daefbdb Upgrade: eslint-scope and espree to 4.0.0 (refs #10458) (#10500) (Brandon Mills)
  • 077358b Docs: no-process-exit: recommend process.exitCode (#10478) (Andres Kalle)
  • f93d6ff Fix: do not fail on unknown operators from custom parsers (fixes #10475) (#10476) (Rubén Norte)
  • 05343fd Fix: add parens for yield statement (fixes #10432) (#10468) (Pig Fang)
  • d477c5e Fix: check destructuring for "no-shadow-restricted-names" (fixes #10467) (#10470) (Pig Fang)
  • 7a7580b Update: Add considerPropertyDescriptor option to func-name-matching (#9078) (Dieter Luypaert)
  • e0a0418 Fix: crash on optional catch binding (#10429) (Toru Nagashima)
  • de4dba9 Docs: styling team members (#10460) (薛定谔的猫)
  • 5e453a3 Docs: display team members in tables. (#10433) (薛定谔的猫)
  • b1895eb Docs: Restore intentional spelling mistake (#10459) (Wilfred Hughes)
Commits

The new version differs by 148 commits.

  • 36ced0a 5.0.0
  • 5fd5632 Build: changelog update for 5.0.0
  • 0feedfd New: Added max-lines-per-function rule (fixes #9842) (#10188)
  • daefbdb Upgrade: eslint-scope and espree to 4.0.0 (refs #10458) (#10500)
  • 077358b Docs: no-process-exit: recommend process.exitCode (#10478)
  • f93d6ff Fix: do not fail on unknown operators from custom parsers (fixes #10475) (#10476)
  • 05343fd Fix: add parens for yield statement (fixes #10432) (#10468)
  • d477c5e Fix: check destructuring for "no-shadow-restricted-names" (fixes #10467) (#10470)
  • 7a7580b Update: Add considerPropertyDescriptor option to func-name-matching (#9078)
  • e0a0418 Fix: crash on optional catch binding (#10429)
  • de4dba9 Docs: styling team members (#10460)
  • 5e453a3 Docs: display team members in tables. (#10433)
  • b1895eb Docs: Restore intentional spelling mistake (#10459)
  • a9da57d 5.0.0-rc.0
  • 3ac3df6 Build: changelog update for 5.0.0-rc.0

There are 148 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Blocking outgoing mail to individual email-address

Hello I' m having the same issue as #23. Trying to create a blacklist for outgoing mail. Using haraka within poste.io.

Haraka version : 2.8.27

My access.ini file ;

[main]

[check]
any=false
conn=false
helo=false
mail=true
rcpt=true

[rcpt]
accept=false

[deny_msg]
conn=You are not allowed to connect
helo=That HELO is not allowed to connect
mail=That sender cannot send mail here
rcpt=That recipient is not allowed

My rcpt_to.access.blacklist file ;

[email protected]

screenshot of poste io connection. its seen on the connection screen that it hits as it show a red "access: rcpt_to.access.blacklist" but still sends the mail for some reason. Can you help ?

image

An in-range update of eslint is breaking the build 🚨

The devDependency eslint was updated from 5.16.0 to 6.0.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/appveyor/branch: AppVeyor build succeeded (Details).
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v6.0.0
  • 81aa06b Upgrade: [email protected] (#11869) (Teddy Katz)
  • 5f022bc Fix: no-else-return autofix produces name collisions (fixes #11069) (#11867) (Milos Djermanovic)
  • ded9548 Fix: multiline-comment-style incorrect message (#11864) (golopot)
  • cad074d Docs: Add JSHint W047 compat to no-floating-decimal (#11861) (Timo Tijhof)
  • 41f6304 Upgrade: sinon (#11855) (Toru Nagashima)
  • 167ce87 Chore: remove unuseable profile command (#11854) (Toru Nagashima)
  • c844c6f Fix: max-len properly ignore trailing comments (fixes #11838) (#11841) (ZYSzys)
  • 1b5661a Fix: no-var should not fix variables named 'let' (fixes #11830) (#11832) (Milos Djermanovic)
  • 4d75956 Build: CI with Azure Pipelines (#11845) (Toru Nagashima)
  • 1db3462 Chore: rm superfluous argument & fix perf-multifiles-targets (#11834) (薛定谔的猫)
  • c57a4a4 Upgrade: @babel/polyfill => core-js v3 (#11833) (薛定谔的猫)
  • 65faa04 Docs: Clarify prefer-destructuring array/object difference (fixes #9970) (#11851) (Oliver Sieweke)
  • 81c3823 Fix: require-atomic-updates reports parameters (fixes #11723) (#11774) (Toru Nagashima)
  • aef8ea1 Sponsors: Sync README with website (ESLint Jenkins)
Commits

The new version differs by 134 commits.

  • a7985a6 6.0.0
  • be74dd9 Build: changelog update for 6.0.0
  • 81aa06b Upgrade: [email protected] (#11869)
  • 5f022bc Fix: no-else-return autofix produces name collisions (fixes #11069) (#11867)
  • ded9548 Fix: multiline-comment-style incorrect message (#11864)
  • cad074d Docs: Add JSHint W047 compat to no-floating-decimal (#11861)
  • 41f6304 Upgrade: sinon (#11855)
  • 167ce87 Chore: remove unuseable profile command (#11854)
  • c844c6f Fix: max-len properly ignore trailing comments (fixes #11838) (#11841)
  • 1b5661a Fix: no-var should not fix variables named 'let' (fixes #11830) (#11832)
  • 4d75956 Build: CI with Azure Pipelines (#11845)
  • 1db3462 Chore: rm superfluous argument & fix perf-multifiles-targets (#11834)
  • c57a4a4 Upgrade: @babel/polyfill => core-js v3 (#11833)
  • 65faa04 Docs: Clarify prefer-destructuring array/object difference (fixes #9970) (#11851)
  • 81c3823 Fix: require-atomic-updates reports parameters (fixes #11723) (#11774)

There are 134 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

How to refresh cache in haraka

Hello

I found when updating for this example the file: access.domains
domain.com

I need to restart Haraka to take effect, any other way without interrupting the sending?

<** 550 Email from that domain is not accepted here.
 -> QUIT

Requires restarting Haraka to take effect.

An in-range update of eslint-plugin-haraka is breaking the build 🚨

Version 1.0.8 of eslint-plugin-haraka just got published.

Branch Build failing 🚨
Dependency eslint-plugin-haraka
Current Version 1.0.7
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As eslint-plugin-haraka is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/appveyor/branch Waiting for AppVeyor build to complete Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 4 commits.

  • a5b007d import lint updates from haraka/.eslintrc (#13)
  • 1d563c2 Repo badges (#11)
  • e1d8fe0 docs(readme): add Greenkeeper badge (#10)
  • a4947f1 add appveyor.yml (#9)

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

how to block incoming emails?

Hi,
So I was read the read.me file, and I'm trying to block some domain
example.com,gmail.com... etc..

i tried this settings
[check]
any=true
conn=false
helo=false
mail=false
rcpt=false

and this
[check]
any=false
conn=false
helo=false
mail=true
rcpt=false

I add the domain to access.domains and to mail_from.access.blacklist.

the plugin is active in config/plugins

but still, with no success, I have missed something??

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.