(Discussion) Can we auto-detect open relays?

Open
#1,835 8 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
helm, kubernetes

Research direction

No files, tests, or entry points are named. Start by reviewing the Mailu Helm chart and the related open-relay issues mentioned in the discussion. Define how an external probe, observed source IP, internal IP configuration, and an administrative safeguard would work before implementation.

Written by the indexing model from the issue text.

Description

type/discussion type/feature

In the mailu helm chart, I found several ways how people create an open relay. Some are just bad setups, others happens completely unexpected (e.g. one user had a broken CNI configuration in kubernetes). Others might come from a change to the environment even when mailu itself is untouched. In the mailu main repository, also some issues exists which discuss open relays.

I think, creating open relays is one of the bigges issues when running an MTA - even bigger than other security issues like outdated software since it affects way more people. So I'm thinking about how we could auto-detect if a running mailu application is an open relay or not.

I have read through many open relay issues. While it's possible to create open relays by bad postfix configuration, the most common situation is that mailu does not see the real IP where mail traffic is coming from so that external traffic is handled like local traffic.

So what is needed for a mailu installation to detect, that it's running as an open relay?

1st, mailu needs to know what internal IPs are. This is the case by default since it's part of the setup.
2nd, mailu would need an incoming request that comes from a known-to-be-external IP address. This could be achieved by an external service.
3rd, the request needs to be recorded and it's source IP as it is seen by the "front" service must be checked.
And finally, some action must be taken when an open relay is detected. This could be a flag in mailu admin that prevents any mail to be received unless an admin verifies and fixes the setup.

What do you think about such a feature?

Kind regards,
Michael.

Dominant language
Python
Stars
7.6k
Forks
1k
Avg merge
15h 38m
Merged PRs (30d)
59

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Mailu/Mailu

All issues in Mailu/Mailu

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.