Discussion:
Processed: RFR: fail2ban can't send e-mail using mail from bsd-mailx
(too old to reply)
Debian Bug Tracking System
2021-08-04 20:00:01 UTC
Permalink
severity -1 normal
Bug #991781 [release-notes] fail2ban is broken with mail from bsd-mailx
Severity set to 'normal' from 'serious'
notforwarded -1
Bug #991781 [release-notes] fail2ban is broken with mail from bsd-mailx
Unset Bug forwarded-to-address
tags -1 - upstream
Bug #991781 [release-notes] fail2ban is broken with mail from bsd-mailx
Removed tag(s) upstream.
tags -1 patch pending
Bug #991781 [release-notes] fail2ban is broken with mail from bsd-mailx
Added tag(s) pending and patch.
--
991781: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991781
Debian Bug Tracking System
Contact ***@bugs.debian.org with problems
Joost van Baal-Ilić
2021-08-05 04:40:01 UTC
Permalink
Hi,

I've fixed a typo in the patch: s/provide/provider/ , patch below
adjusted.

Also, it's not clear to me wether one should do e.g.

sudo update-alternatives --config mail

and select mail.mailutils, or would it be easier/better to edit files in
/etc/fail2ban/action.d/ ? But indeed, otoh, maybe we should just leave it as
is.

HTH, Bye,

Joost
Control: severity -1 normal
Control: notforwarded -1
Control: tags -1 - upstream
Control: tags -1 patch pending
Hi,
I have the attached patch ready to push. I'm wondering if we need more
detailed instructions.
Paul
From 072744ceed8cac5cef19c92d9e506bebeb26b482 Mon Sep 17 00:00:00 2001
Date: Wed, 4 Aug 2021 09:59:34 +0200
Subject: [PATCH] issues.dbk: fail2ban and mail from bsd-mailx don't work
together
Closes: #991781
---
en/issues.dbk | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/en/issues.dbk b/en/issues.dbk
index a01b2967..4eab01ef 100644
--- a/en/issues.dbk
+++ b/en/issues.dbk
@@ -493,6 +493,29 @@ data = ${lookup{$local_part}lsearch{/some/path/$domain_data/aliases}}
</para>
</section>

+ <section id="fail2ban">
+ <title>fail2ban can't send e-mail using mail from bsd-mailx</title>
+ <para>
+ The <systemitem role="package">fail2ban</systemitem> package can
+ be configured to send out e-mail notifications. It does that
+ using <command>mail</command>, which is provided by multiple
+ packages in Debian. A security update (needed on systems that
+ use <command>mail</command> from <systemitem
+ role="package">mailutils</systemitem>) just before the release
+ of bullseye broke this functionality for systems that have
+ <command>mail</command> provided by <systemitem
+ role="package">bsd-mailx</systemitem>. Users of
+ <systemitem>fail2ban</systemitem> in combination with
+ <systemitem>bsd-mailx</systemitem> that wish
+ <systemitem>fail2ban</systemitem> to send out e-mail, should
+ either switch to a different provider for <command>mail</command>
+ or manually unapply <ulink
+ url="https://github.com/fail2ban/fail2ban/commit/410a6ce5c80dd981c22752da034f2529b5eee844">the
+ upstream commit</ulink> (all files are in
+ <filename>/etc/fail2ban/action.d/</filename>).
+ </para>
+ </section>
+
<section id="before-first-reboot">
<title>Things to do post upgrade before rebooting</title>
<!-- If there is nothing to do -->
Justin B Rye
2021-08-05 04:40:01 UTC
Permalink
I have the attached patch ready to push. I'm wondering if we need more
detailed instructions.
+ <section id="fail2ban">
+ <title>fail2ban can't send e-mail using mail from bsd-mailx</title>
+ <para>
+ The <systemitem role="package">fail2ban</systemitem> package can
+ be configured to send out e-mail notifications. It does that
+ using <command>mail</command>, which is provided by multiple
+ packages in Debian. A security update (needed on systems that
Has bullseye added extra providers for mailx? On buster there's
only bsd-mailx and mailutils. Mind you, fail2ban only Suggests
mailx, so maybe it's assuming some more complicated alternative.
+ use <command>mail</command> from <systemitem
+ role="package">mailutils</systemitem>) just before the release
+ of bullseye broke this functionality for systems that have
+ <command>mail</command> provided by <systemitem
+ role="package">bsd-mailx</systemitem>. Users of
+ <systemitem>fail2ban</systemitem> in combination with
Don't these need to be <systemitem role="package">? I'm not sure what
<systemitem> on its own does.
+ <systemitem>bsd-mailx</systemitem> that wish
English fix: I'd prefer who wish
+ <systemitem>fail2ban</systemitem> to send out e-mail, should
English fix: better without a comma here ^
+ either switch to a different provide for <command>mail</command>
English fix: typo provider

(but if there's no other provider, we might as well say "switch
to mailutils")
+ or manually unapply <ulink
+ url="https://github.com/fail2ban/fail2ban/commit/410a6ce5c80dd981c22752da034f2529b5eee844">the
+ upstream commit</ulink> (all files are in
+ <filename>/etc/fail2ban/action.d/</filename>).
+ </para>
+ </section>
+
A suggestion for a slightly more detailed version:

or manually unapply <ulink
url="https://github.com/fail2ban/fail2ban/commit/410a6ce5c80dd981c22752da034f2529b5eee844">the
upstream commit</ulink> (which inserted the string
"<literal>-E 'set escape'</literal>" in multiple places under
<filename>/etc/fail2ban/action.d/</filename>).
--
JBR with qualifications in linguistics, experience as a Debian
sysadmin, and probably no clue about this particular package
Paul Gevers
2021-08-05 06:30:01 UTC
Permalink
Hi,

Thanks for the reviews.
Post by Justin B Rye
Has bullseye added extra providers for mailx?
I don't know. I'm not aware of it.
Post by Justin B Rye
On buster there's
only bsd-mailx and mailutils. Mind you, fail2ban only Suggests
mailx, so maybe it's assuming some more complicated alternative.
Indeed, the third binary I can find [1] that adds an alternative to mail is
https://sources.debian.org/src/nmh/1.7.1-7/debian/nmh.postinst/?hl=17#L17
Post by Justin B Rye
Post by Joost van Baal-Ilić
+ use <command>mail</command> from <systemitem
+ role="package">mailutils</systemitem>) just before the release
+ of bullseye broke this functionality for systems that have
+ <command>mail</command> provided by <systemitem
+ role="package">bsd-mailx</systemitem>. Users of
+ <systemitem>fail2ban</systemitem> in combination with
Don't these need to be <systemitem role="package">? I'm not sure what
<systemitem> on its own does.
I *think* the "role" is only needed to get the right link in the index.
However, as the same packages are already mentioned in the same
paragraph, I *think* it's redundant to add it again.
Post by Justin B Rye
Post by Joost van Baal-Ilić
+ either switch to a different provide for <command>mail</command>
English fix: typo provider
(but if there's no other provider, we might as well say "switch
to mailutils")
I think there's at least three.
Post by Justin B Rye
or manually unapply <ulink
url="https://github.com/fail2ban/fail2ban/commit/410a6ce5c80dd981c22752da034f2529b5eee844">the
upstream commit</ulink> (which inserted the string
"<literal>-E 'set escape'</literal>" in multiple places under
<filename>/etc/fail2ban/action.d/</filename>).
Thanks.

Paul

[1] https://codesearch.debian.net/search?q=--slave.%2Bmail&literal=0&page=3
Debian Bug Tracking System
2021-08-05 19:40:01 UTC
Permalink
Your message dated Thu, 5 Aug 2021 21:36:46 +0200
with message-id <31dc2748-889b-78f2-5ae9-***@debian.org>
and subject line Re: Bug#991781: RFR: fail2ban can't send e-mail using mail from bsd-mailx
has caused the Debian Bug report #991781,
regarding fail2ban is broken with mail from bsd-mailx
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ***@bugs.debian.org
immediately.)
--
991781: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991781
Debian Bug Tracking System
Contact ***@bugs.debian.org with problems
Loading...