Mails bigger than 5 MB wont get passed to spamd

Use this forum for discussions about SpamAssassin and anti-spam in general.
Post Reply
steelworm
New user
New user
Posts: 3
Joined: 2020-04-16 22:34

Mails bigger than 5 MB wont get passed to spamd

Post by steelworm » 2020-05-07 19:38

Hello there,

Whenever I receive a message bigger than 5 MB it wont get passed to spamd. This can be confirmed by looking at SA logs which do not state a connection from hmail. In addition to that in hmail's logs the typical "Sending message to SpamAssassin" record is also missing. I adjusted the "Maximum message size to scan" but this did not help. It also seems that no DKIM check has happened but only the following checks:

"DEBUG" 3784 "2020-05-03 02:23:58.172" "Spam test: SpamTestDNSBlackLists, Score: 0"
"DEBUG" 3784 "2020-05-03 02:23:58.181" "Spam test: SpamTestHeloHost, Score: 0"
"DEBUG" 3784 "2020-05-03 02:23:58.181" "Spam test: SpamTestMXRecords, Score: 0"
"DEBUG" 3784 "2020-05-03 02:23:58.184" "Spam test: SpamTestSPF, Score: 0"
"DEBUG" 3784 "2020-05-03 02:23:58.185" "Total spam score: 0"

User avatar
SorenR
Senior user
Senior user
Posts: 3818
Joined: 2006-08-21 15:38
Location: Denmark

Re: Mails bigger than 5 MB wont get passed to spamd

Post by SorenR » 2020-05-07 20:49

hMailAdmin -> Settings -> Anti-Spam [General] : Maximum message size to scan (KB) = ?
SørenR.

“Those who don't know history are doomed to repeat it.”
― Edmund Burke

steelworm
New user
New user
Posts: 3
Joined: 2020-04-16 22:34

Re: Mails bigger than 5 MB wont get passed to spamd

Post by steelworm » 2020-05-08 00:31

I have set it to 10MB which are 10.240 KB for the setting. So the mails in question which are about 5 to 6 MB should get scanned as all the others get which are <5 but they aren’t.

User avatar
jimimaseye
Moderator
Moderator
Posts: 8777
Joined: 2011-09-08 17:48

Re: Mails bigger than 5 MB wont get passed to spamd

Post by jimimaseye » 2020-05-08 01:15

There is also a maximum size in spamassassin (500kb I think). Review spamassassin documentation for more information and how to increase.

[Entered by mobile. Excuse my spelling.]
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

steelworm
New user
New user
Posts: 3
Joined: 2020-04-16 22:34

Re: Mails bigger than 5 MB wont get passed to spamd

Post by steelworm » 2020-05-08 09:07

I already created an according spamc.conf. Do you think there might be an issue with that?

User avatar
jimimaseye
Moderator
Moderator
Posts: 8777
Joined: 2011-09-08 17:48

Re: Mails bigger than 5 MB wont get passed to spamd

Post by jimimaseye » 2020-05-08 09:52

I will leave it to you to research and seek help with spamassassin configurations.

For hms: run this and post the results: https://www.hmailserver.com/forum/viewt ... 20&t=30914
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

User avatar
RvdH
Senior user
Senior user
Posts: 1136
Joined: 2008-06-27 14:42
Location: Netherlands

Re: Mails bigger than 5 MB wont get passed to spamd

Post by RvdH » 2020-05-10 14:36

spamc is only used for spam learning i think... hmailserver uses a internal client, i doubt this will read values from spamc.conf
Not sure what maxIterations is, hardcoded limit?
CIDR to RegEx: d-fault.nl/CIDRtoRegEx
DNS Lookup: d-fault.nl/DNSTools
DNSBL Lookup: d-fault.nl/DNSBLLookup
GEOIP Lookup: d-fault.nl/GeoipLookup

User avatar
SorenR
Senior user
Senior user
Posts: 3818
Joined: 2006-08-21 15:38
Location: Denmark

Re: Mails bigger than 5 MB wont get passed to spamd

Post by SorenR » 2020-05-10 14:51

RvdH wrote:
2020-05-10 14:36
spamc is only used for spam learning i think... hmailserver uses a internal client, i doubt this will read values from spamc.conf
Not sure what maxIterations is, hardcoded limit?
Reading 20000 byte chunks for a maximum of 100000 times... 1.9 GB of data ?

Code: Select all

      const int maxIterations = 100000;
      for (int i = 0; i < maxIterations; i++)
      {
         std::shared_ptr<ByteBuffer> pBuf = oFile.ReadChunk(20000);

         if (pBuf->GetSize() == 0)
            break;

         BYTE *pSendBuffer = (BYTE*) pBuf->GetBuffer();
         size_t iSendBufferSize = pBuf->GetSize();

         EnqueueWrite(pBuf);
      }
SørenR.

“Those who don't know history are doomed to repeat it.”
― Edmund Burke

User avatar
RvdH
Senior user
Senior user
Posts: 1136
Joined: 2008-06-27 14:42
Location: Netherlands

Re: Mails bigger than 5 MB wont get passed to spamd

Post by RvdH » 2020-05-10 15:30

Looks a bit exuberant, isn't? ;)
Anyway, this is controlled/overruled by Maximum message size to scan (KB) in hmailserver settings, so if that value is reasonable it will never reach this 1.9GB
CIDR to RegEx: d-fault.nl/CIDRtoRegEx
DNS Lookup: d-fault.nl/DNSTools
DNSBL Lookup: d-fault.nl/DNSBLLookup
GEOIP Lookup: d-fault.nl/GeoipLookup

User avatar
katip
Senior user
Senior user
Posts: 779
Joined: 2006-12-22 07:58
Location: Istanbul

Re: Mails bigger than 5 MB wont get passed to spamd

Post by katip » 2020-05-10 22:57

in fact, there is a setting for spamc

Code: Select all

    -s *max_size*, --max-size=*max_size*
        Set the maximum message size which will be sent to spamd -- any
        bigger than this threshold and the message will be returned
        unprocessed (default: 500 KB). If spamc gets handed a message bigger
        than this, it won't be passed to spamd. The maximum message size is
        256 MB.

        The size is specified in bytes, as a positive integer greater than
        0. For example, -s 500000.
i have no idea where to place a spamc.conf in a JAM SA installation (and if it ever works). root probably??
but this should be irrelevant. OP means, mail never gets queued to SA, according to logs.
Katip
--
HMS 5.7.0 x64, MariaDB 10.4.10 x64, SA 3.4.2, ClamAV 0.101.2 + SaneS

User avatar
RvdH
Senior user
Senior user
Posts: 1136
Joined: 2008-06-27 14:42
Location: Netherlands

Re: Mails bigger than 5 MB wont get passed to spamd

Post by RvdH » 2020-05-11 13:54

katip wrote:
2020-05-10 22:57
in fact, there is a setting for spamc

Code: Select all

    -s *max_size*, --max-size=*max_size*
        Set the maximum message size which will be sent to spamd -- any
        bigger than this threshold and the message will be returned
        unprocessed (default: 500 KB). If spamc gets handed a message bigger
        than this, it won't be passed to spamd. The maximum message size is
        256 MB.

        The size is specified in bytes, as a positive integer greater than
        0. For example, -s 500000.
i have no idea where to place a spamc.conf in a JAM SA installation (and if it ever works). root probably??
but this should be irrelevant. OP means, mail never gets queued to SA, according to logs.
Duh....only hMailServer doesn't use it clamc, but has a build in client :lol: :wink:
CIDR to RegEx: d-fault.nl/CIDRtoRegEx
DNS Lookup: d-fault.nl/DNSTools
DNSBL Lookup: d-fault.nl/DNSBLLookup
GEOIP Lookup: d-fault.nl/GeoipLookup

Post Reply