'ARC' for Postfix / Virtualmin

If mfilter system is changed, might aswell use one that does it all.

In response to Joe’s comment ā€œā€¦that a bunch of major mail providers are using it. I don’t think I’ve seen evidence of that.ā€ I would like to offer this advice from Google’s Gmail section titled:
ā€œEmail sender guidelines => ARCā€

ā€œWe recommend that senders use ARC authentication, especially if they regularly forward email.ā€

(Source: https://support.google.com/a/answer/81126?visit_id=638789307333981630-228384185&rd=1#authentication%20d2e1a72fcca58-73905ee8082si23367309b3a.8&zippy=%2Crequirements-for-all-senders )

Also from search:

Q: Does outlook.com use ARC for email?
A: Yes, Outlook.com uses ARC (Authenticated Received Chain) for email authentication. Outlook.com, like other major email providers, is actively adopting and enforcing ARC to enhance email security and ensure the integrity of received messages.

Q: Does Cloudflare use ARC for email?
A: Yes, Cloudflare’s Email Routing service supports Authenticated Received Chain (ARC).

Positive results are also found for Yahoo Mail, ProtonMail, Mail.com, Apple Mail/iCloud Mail and in the hosting panel space, Plesk (Linux only) and cPanel (experimental) since version 122.

I agree with ā€˜Shoulders’ that it would be good to have a single, well-maintained milter that does everything, especially as it comes from a vendor specialising in email. Only Jamie, Joe and Ilia can comment on how hard or easy it would be to implement.

2 Likes

Hi all, sorry-- Real Life has been a bit 'whelming for a while.

If I may, I’d like to chime in with a few simple insights – hopefully helpful – into DMARC, ARC, etc.

How is ARC helpful?

The primary purpose from where I sit is NOT getting the receiving server to trust forwarded emails. Not quite.

  • Primarily it allows my server to forward directly to Google etc, and (correctly) say ā€œI am certifying this email did NOT originate with me. Here are the headers as I received them.ā€
  • Result: my server is not blamed if spam gets forwarded to Google.
  • This really doesn’t require that Google trusts my server very much.

Note that the above is NOT me certifying the email is good, at all!

Note too: it still helps a lot if I’m able to discard most spam. Even with ARC implemented, Google tends to get upset if too much spam is forwarded to gmail accounts :wink:

How is DMARC helpful?

DMARC empowers savvy email servers to reject massive amounts of spam.

Here’s the setup for a real world example.

I (accidentally) created one of the oldest domain names in the world (octopus.com) – sold that one, but still own a verry old domain with interesting properties:

  • ds.org is only used by us for infrastructure.
  • That domain is never the named source or recipient of valid email. (ie never from/to who@ds.org etc.) Yes, required exceptions ok, eg postmaster and root.
  • Our servers typically are in that domain. aster.ds.org is our (Virtualmin) email server.

A brief history:

  • For decades, our emails blissfully were sent and received. No visible issues.
  • Spam became a Thing. We implemented spf, then dkim. Incoming spam reduced.
  • Then our email server began to be blocked, marked by some major providers as a spam source??!!?? Impossible, I thought! We hardly send any email at all! And we never send any email as ds.org! Our email server, aster.ds.org was being blamed anyway.
  • So, we implemented DMARC, including basic reporting. (At the time, dmarcian.com was free for small users. I’d love to have basic DMARC reporting inside Virtualmin at some point. AFAIK there are some pretty good open source solutions. I just don’t have time to investigate right now.)

Suddenly, everything became clear:

  • Due to DMARC reporting, a variety of email servers around the world started giving us data on emails they were rejecting, attributed to our ds.org domain.
  • Turns out, spammers in eastern Europe and Asia (mostly mainland China) were sending 1-2000 spams a day faking our domain name. Or subdomains: somebody@subdomain.ds.org
  • With DMARC instructions in place (ā€œplease reject and report all such emailsā€), our domain name again became ā€˜clean.’ Whew!
  • Importantly, unlike SPF, DMARC allows control over ALL subdomains, without specifying any particular subdomain. That’s crucial, since of course it’s impossible to define all possible subdomains.

BTW, thanks for the pointer to the FastMail implementation. I’m running OpenARC, which is not exactly robust.

2 Likes

Google seems clear about the future: SRS is not mentioned, ARC is required.

And since gmail is end-of-life-ing POP3 support NOW (medio 2026M01) for fetching email from external email servers, many that use gmail will need to switch from POP3 fetching to forwarding. SPF/DKIM are of course key, but servers most will already have that set up (as Virtualmin has been facilitating that for a while now). ARC is not yet facilitated but is part of Google’s list.

And, frankly, SRS will never be part of the Google’s recommendations, as it is a ā€œhackā€ and does not fully solve the problem (only ARC does that). Even though they will process SRS info (for now), so SRS is still a very necessary thing at this moment, as it will ensure the forward works without ARC (as without SRS, the SPF check will fail, and mail will likely not be accepted from servers with a low mail volume).

In short: SRS is highly recommended (if not required) for Virtualmin users to set up themselves (so maybe we need an ā€œofficialā€ manual for it), until Virtualmin starts supporting it natively. Setting up ARC yourself is possible, but not easy and will likely require rework when Virtualmin will officially support it (which, imho, is very urgent).

PS: The reason SRS is needed is that ARC only works if there is trust; lacking that trust, the receiving server will ā€œfall backā€ to SRS to not fail on SPF.

2 Likes

This is what would prevent dmarc failures for mailing lists right?

apart from ARC/SRS I still believe Virtualmin does not perform inbound DMARC checks.

Opendmarc is not installed and SpamAssasin is doing spf and dkim but not combining for dmarc.

I think it could be implemented, I have it running, part of most distros to have opendmarc in repo.

So the DNS records is there to tell others how to treat your mail, but you should still check the incoming mail to honor the same compliance.

the same is true for virtualmin MTA-STS it does not actually check the policy.
(although we can let that slide, it would require very recent postfix and also postfix-tlspol)

But dmarc should be checked properly.

I think with all of these new technologies that the email stack should be revisited. The current one does have some issues and the GUI needs some improvements (yep, I have submitted a load on GitHub)

It has been mentioned in the past they might do it for VM8 but I don’t think that happend (not looked though).

ARC, MTA-STS, DMARC, SPF, DKIM, BIMI, SRS, GreyListing, SpamAssassain and I am sure there are some more.

2 Likes

Also there is no ā€œreportingā€ in Virtualmins dmaRc.

together with opendmarc I use:

GitHub - oh2fih/OpenDMARC-Reports: Automate OpenDMARC reports securely.

DMARC reports would be an excellent Pro feature. You can define where to send the information I believe.

the DNS entry with email is for someone else sending a report about your servers dmarc

what we miss is us checking their email and sending them the report report about their server.

we are not following the spec, it is incomplete.

any chance you can fire up a GitHub issue with everything outlined including adding a GUI for reading local DMARc information and reports?

maybe a big task for virtualmin, but migrating to rspamd can provide all those features and various daemons/configurations, in just one package = rspamd using included plugins.
so, no opendmarc, opendkim, postfix-policyd, opensrs/openarc, postgrey, spamassassin…

imho, rspamd is much faster, lighter in resources, and easier to manage than spamassassin.
(have already migrated virtualmin-gpl hosts to rspamd, running fine for the past couple of years or so. ).

2c.

2 Likes

I’ve looked into rspamd in the past, and was put off by lack of a package in the repos for EL. But, packaging something isn’t necessarily a disqualifying requirement (we package jailkit, for instance).

I would like a lighter-weight mail stack, but SpamAssassin really isn’t that big of a resource consumer relative to the rest of the mail stack. It’s written in Perl, so it’s got some overhead that rspamd doesn’t necessarily have, but it’s still pretty light and quick. I’ve never used rspamd, so I don’t have any hard data about what resources it uses, but ClamAV is proof you can write huge, resource-intensive, software in C.

I’ll try switching one of my mail servers over to rspamd sometime soon and see what it looks like versus the current stack.

3 Likes

you can try official package : Downloads | Rspamd Documentation
for Debian family (+Ubuntu) : Downloads | Rspamd Documentation

you also need redis (or the valkey fork).

btw, my first tests were about manually training from a spam database.. (got a few k spam emails for training..). spamassassin (sa-learn) ran for a few minutes, while rspamd (rspamc learn_spam) took seconds to scan the same volume of spam. can’t recall exactly but the speed difference in spam learning was pretty obvious.
and the big plus for me was not having to deal with 6-7 extra daemons necessary for the modern SA/amavis setup stack.

best :slight_smile:

I definitely rspamd is worth looking into, thanks Joe

1 Like

If it’s not in the OS standard repos (or EPEL or Code Ready on EL, something maintained upstream), we have to build it ourselves, as we’d need to put it in our repos, and I’m not signing anything I’m not involved directly in building and vetting.

2 Likes

I think it works.

dnf install openarc

mkdir /var/spool/postfix/openarc
chown openarc:openarc /var/spool/postfix/openarc
usermod -a -G openarc postfix

nano /usr/lib/systemd/system/openarc.service

Comment out protections and change umask:

UMask=0002
#ProtectSystem=strict
#ProtectHome=true

apply:

systemctl daemon-reload

Copy DKIM key to ARC:

/etc/opendkim/keys/default.private

to

/etc/openarc/keys/default.private

Also copy

/etc/opendkim/TrustedHosts

to

/etc/openarc/

nano /etc/openarc.conf

Syslog  yes
UserID  openarc:openarc
Socket  local:/var/spool/postfix/openarc/openarc.sock
SignHeaders to,subject,message-id,date,from,mime-version,dkim-signature
PeerList /etc/openarc/PeerList
MilterDebug 2
EnableCoredumps no
InternalHosts /etc/openarc/TrustedHosts
FinalReceiver yes
Mode                    sv
Canonicalization        relaxed/relaxed
Domain                  yourvirtualmindomain.tld
Selector                default
KeyFile                 /etc/openarc/keys/default.private

Add to postfix config:

smtpd_milters = inet:localhost:8891,local:/run/milter-greylist/milter-greylist.sock,local:openarc/openarc.sock,local:opendmarc/opendmarc.sock

non_smtpd_milters = inet:localhost:8891,local:/run/milter-greylist/milter-greylist.sock,local:openarc/openarc.sock,local:opendmarc/opendmarc.sock

In this example we add: local:openarc/openarc.sock (we don’t add the full path here because it is running in the /var/spool/postfix directory

Virtualmin has opendkim on port. Thats ok. This example is with opendmarc and openarc running as socket.

Next:

systemctl enable openarc
systemctl restart postfix
systemctl start openarc

Check it

systemctl status openarc

or

journalctl -xeu openarc.service

Check some headers:

ARC-Seal: i=2; a=rsa-sha256; t=1769863710; cv=pass; …
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; …
ARC-Authentication-Results: i=2; mx.google.com;
dkim=pass header.i=@vom-bruch.com header.s=default header.b=S95YoHA4;
arc=pass (i=1);
spf=pass (google.com: domain of luca@vom-bruch.com designates 2XX.2XX.2X8.23 as permitted sender) smtp.mailfrom=luca@vom-bruch.com;
dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=vom-bruch.com

Authentication-Results: home.vom-bruch.com; arc=pass smtp.remote-ip=2607:f8b0:4864:20::1130

maybe it is also necessary to add:

FinalReceiver yes

to the openarc.conf config.

## FinalReceiver { yes | no }
##      default "no"
##
## If set, causes this filter to pass chain signatory information downstream for
## local policy evaluation in the event of an authentication failure.

I’d recommend against using OpenARC, since it has been unmaintained for many years. There are alternatives that are maintained.

Ok but the current stack includes some of the features for modern email security.

If you were to change it, I think it would make more sense to switch as many features as possible to the new implementation.

rspamd for example. It can do almost all of it. DKIM DMARC SPF Spam… So for me the addon was openarc since all other areas were already covered.

But need to consider that it also wants redis, which will be a requirement for some other things users might run. - No experience with multi instances of that.

Is redis mandatory or recommended?

not sure about the fastmail implementation with redis

Anyway opendkim is also not maintained and virtualmin uses it.

maybe it would be worth it look into rspamd

Anyway maybe it is better to install the fork. I will have a look at it. It has been maintained: