Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in selective service #256

Closed
tomav opened this issue Aug 14, 2016 · 13 comments · Fixed by #432
Closed

Bug in selective service #256

tomav opened this issue Aug 14, 2016 · 13 comments · Fixed by #432
Assignees

Comments

@tomav
Copy link
Contributor

tomav commented Aug 14, 2016

Bug found by @ep0ch2 in #250

Many thanks for this, the following settings work:

  • DISABLE_AMAVIS=0
  • DISABLE_SPAMASSASSIN=1
  • DISABLE_CLAMAV=1

however with disable_amavis=1 i can't send/receive emails. so perhaps some extra config changes are needed,

@KyleOndy: I'm opening this issue for reminder.
Will you be able to work on it? May I help?

Thank you.

@tomav tomav added the bug label Aug 14, 2016
@tomav tomav mentioned this issue Aug 14, 2016
5 tasks
@tomav tomav added this to the v2.1 milestone Aug 14, 2016
@KyleOndy
Copy link
Contributor

I went on a yak-shaving expedition attempting to expand the testing suite to catch issues like this. Let me look back into it.

@KyleOndy
Copy link
Contributor

These next few weeks I am going to have very little or no availability. Anyone is welcome to take a look at this and submit a PR.

@tomav tomav removed this from the v2.1 milestone Oct 8, 2016
@tomav
Copy link
Contributor Author

tomav commented Oct 21, 2016

@KyleOndy, any update on these 2 issues #256 and #324 ? Thanks.

@kachkaev
Copy link
Contributor

Great that this issue has been reported! I struggled to figure out what went wrong after setting DISABLE_AMAVIS=1 :–)

It seems reasonable to switch to an alternative service config as suggested in #297 while fixing this bug – it will require some config refactoring anyway.

IMHO not having a spam filter and an anti-virus has more pros than cons since it suggests a lightweight start with an option for extra nice features on demand. Otherwise, lots of users end up with a large chunk of their RAM swallowed by the container while they only use it as a simple ‘reverse-proxy’ for their corporate or private mail.

@KyleOndy
Copy link
Contributor

I have not looked into this issue much as I have still been trying to figure out an acceptable way to remedy #324.

I may switch gears in the next week and at least push out a simple fix that will work for the time being.

@kachkaev
Copy link
Contributor

kachkaev commented Oct 27, 2016

I was able to turn off virus and spam checking in amavis while keeping DKIP and it had a dramatic impact on RAM usage:

screen shot 2016-10-27 at 09 28 00

(a peak before the break is an example how much memory each incoming message consumed!)

The solution was to create config/amavis.cf (thanks to #299) with the following content:

use strict;

@bypass_virus_checks_maps = (1);
@bypass_spam_checks_maps  = (1);

#------------ Do not modify anything below this line -------------
1;  # ensure a defined return

Now I am not sure that we need to have an option to remove AMAVIS at all because most users would probably want to keep DKIM at least. People can be just instructed to turn of the features that they don't want.

@KyleOndy
Copy link
Contributor

KyleOndy commented Oct 28, 2016

That is a pretty big reduction in resources @kachkaev.

You bring up a good point regaring keeping AMAVIS to maintain DKIM. I agree that should be the recommendation for most users.

I am going to attempt to turn off the virus and spam checking on my personal server as I am moving to a smaller host. Once I get a clean implementation I'll open up a PR.


Also, what dashboard / munitioning system are you using @kachkaev? I like the looks of it.

@tomav
Copy link
Contributor Author

tomav commented Oct 28, 2016

Grafana probably.

@kachkaev
Copy link
Contributor

@KyleOndy it's netdata – really great stuff!

@kachkaev
Copy link
Contributor

kachkaev commented Oct 28, 2016

One important thing to note before anyone else has started to encounter this. I don't know if this is related to turning off spam and virus filtering, but I've recently started to spot these pretty sad warnings in the logs from time to time:

mail postfix/qmgr[1038]: 93A1BBF5: from=<bounces+848413-8bd4-my.custom.address=example.com@sgmail.github.com>, size=9427, nrcpt=1 (queue active)
mail postfix/smtp[4308]: Trusted TLS connection established to gmail-smtp-in.l.google.com[173.194.222.26]:25: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
mail postfix/smtp[4308]: 93A1BBF5: host gmail-smtp-in.l.google.com[173.194.222.26] said: 421-4.7.0 [42.MY.IP.42      15] Our system has detected an unusual rate of 421-4.7.0 unsolicited mail originating from your IP address. To protect our 421-4.7.0 users from spam, mail sent from your IP address has been temporarily 421-4.7.0 rate limited. Please visit 421-4.7.0  https://support.google.com/mail/?p=UnsolicitedRateLimitError to 421 4.7.0 review our Bulk Email Senders Guidelines. d185si8612556lfe.262 - gsmtp (in reply to end of DATA command)
mail postfix/smtp[4308]: connect to gmail-smtp-in.l.google.com[2a00:1450:4010:c07::1a]:25: Network is unreachable
mail postfix/smtp[4308]: Trusted TLS connection established to alt1.gmail-smtp-in.l.google.com[74.125.198.26]:25: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
mail postfix/smtp[4308]: 93A1BBF5: to=<my.gmail.address@gmail.com>, relay=alt1.gmail-smtp-in.l.google.com[74.125.198.26]:25, delay=38374, delays=38372/0.01/1.7/0.53, dsn=4.7.0, status=deferred (host alt1.gmail-smtp-in.l.google.com[74.125.198.26] said: 421-4.7.0 [42.MY.IP.42      15] Our system has detected an unusual rate of 421-4.7.0 unsolicited mail originating from your IP address. To protect our 421-4.7.0 users from spam, mail sent from your IP address has been temporarily 421-4.7.0 rate limited. Please visit 421-4.7.0  https://support.google.com/mail/?p=UnsolicitedRateLimitError to 421 4.7.0 review our Bulk Email Senders Guidelines. v47si9447174otv.121 - gsmtp (in reply to end of DATA command))

Key message (from gmail):

Our system has detected an unusual rate of 421-4.7.0 unsolicited mail originating from your IP address. To protect our 421-4.7.0 users from spam, mail sent from your IP address has been temporarily 421-4.7.0 rate limited. Please visit 421-4.7.0 https://support.google.com/mail/?p=UnsolicitedRateLimitError to 421 4.7.0 review our Bulk Email Senders Guidelines. d185si8612556lfe.262 - gsmtp (in reply to end of DATA command)

It turns out that some attempts to forward notifications from github, ebay and other services to gmail via my custom email server fail. I was doing this kind of forwarding for years without using fancy things like DKIM, Letsencrypt, DNS records, etc. and never heard of this issue before. A shallow search reveals that this a side-effect of google's recently updated spam policy. What is interesting is that real spam is either successfully discarded by zen.spamhaus.org on my server or is successfully swallowed by google and placed into the gmail's spam folder. My personal emails (hopefully) go well in both directions. Mail-testing services like http://mail-tester.com/ & http://mxtoolbox.com/ say that my settings a perfect. Neither IP address nor host name appear in any ban lists.

Not sure that this is something to be discussed in the thread or even in this repo, but I've still decided to share such a finding as this might save others some time. I'll be happy to join a discussion in another issue thread if this problem does not look to irrelevant to docker-mailserver.

@tomav
Copy link
Contributor Author

tomav commented Nov 28, 2016

Hi @KyleOndy, have you been able to fix the selective service startup?
Thank you.

@tomav
Copy link
Contributor Author

tomav commented Dec 25, 2016

I'm gonna work on this one.
DISABLE_AMAVIS will me removed to let DKIM work as expected.
DISABLE_CLAMAV will remain untouched.
DISABLE_SPAMASSASSIN does not exist in the code :-)
(I'll see if I can add it)

@tomav
Copy link
Contributor Author

tomav commented Dec 25, 2016

And I think everything should be ENABLE_ and not DISABLE_.

tomav added a commit that referenced this issue Dec 25, 2016
* Removed DISABLE_AMAVIS
* Renamed DISABLE_* to ENABLE_* with 0 as default value. (this must be explicit)
* Added missing tests for ENABLE_*
* Improved readme and docker-compose example

Should fix #256 and #386
tomav added a commit that referenced this issue Dec 25, 2016
* Removed DISABLE_AMAVIS
* Renamed DISABLE_* to ENABLE_* with 0 as default value. (this must be explicit)
* Added missing tests for ENABLE_*
* Improved readme and docker-compose example

Should fix #256 and #386
RichardFevrier pushed a commit to RichardFevrier/docker-mailserver that referenced this issue Aug 26, 2019
* Removed DISABLE_AMAVIS
* Renamed DISABLE_* to ENABLE_* with 0 as default value. (this must be explicit)
* Added missing tests for ENABLE_*
* Improved readme and docker-compose example

Should fix docker-mailserver#256 and docker-mailserver#386
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants