Koozali.org: home of the SME Server

Reject Mail on size

Offline kadybee

  • **
  • 40
  • +0/-0
Reject Mail on size
« on: November 17, 2011, 08:20:20 AM »
I'm having an issue where large messages are not being delivered or rejected but ending up with multiple copies on the spool drive.

SME 7.5:

I have an SME Server in a DMZ simply accepting mail and forwarding it to an internal mail server (also SME 7.5).  At the moment there is no spam or av checking just the standard qpsmtp stuff.

Someone has sent a 25+MB message!   As the message is coming in, it runs through the basic checks and then just stops (at around 20MB) and leaves a copy of that data in the /var/spool/qpsmtd/ directory without even attempting to pass it onto the internal mail server.

The upstream (ISP) just gets lost data signal and requeues it for another attempt.

Would I be right in assuming that the rejection is not occurring as it hasn't reached its final delivery point?  I really would like this DMZ server to reject the message based on size.  Any thoughts anyone?


Thanks

Klaus
......

Offline pfloor

  • *****
  • 889
  • +1/-0
Re: Reject Mail on size
« Reply #1 on: November 20, 2011, 01:54:21 AM »
In life, you must either "Push, Pull or Get out of the way!"

Offline kadybee

  • **
  • 40
  • +0/-0
Re: Reject Mail on size
« Reply #2 on: November 20, 2011, 03:03:22 AM »
Have a look here:

http://wiki.contribs.org/Email#Set_max_email_size

Yes - thanks - already did all that.  That's the issue, I have set a max size, but the server is not rejecting it.

Klaus
......

Offline pfloor

  • *****
  • 889
  • +1/-0
Re: Reject Mail on size
« Reply #3 on: November 20, 2011, 08:25:48 AM »
Did you set them all the same?
In life, you must either "Push, Pull or Get out of the way!"

Offline kadybee

  • **
  • 40
  • +0/-0
Re: Reject Mail on size
« Reply #4 on: November 20, 2011, 08:47:30 AM »
Yes - and then toyed with a number of other settings with the same result.
......

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Reject Mail on size
« Reply #5 on: November 20, 2011, 10:10:40 AM »
kadybee

Did you follow your db changes commands with
signal-event email-update
?
Please post your actual settings here & the procedure (commands issued) you used to make those changes.
Show output of
config show qmail
config show clamav
config show qpsmtpd
config show php
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline kadybee

  • **
  • 40
  • +0/-0
Re: Reject Mail on size
« Reply #6 on: November 20, 2011, 10:30:02 AM »
Yes Mary, updated, even rebooted!  I'm fairly comfortable I set a max size of 20MB here.  I even upped it to 50MB at one stage in an attempt to allow the large message that was looping in the queue directory through.  That didn't work either.  I have since had the failing message removed from the ISP queue.


# config show qmail
qmail=service
    MaxMessageSize=20000000
    status=enabled

# config show clamav
clamav=service
    ArchiveBlockEncrypted=no
    ArchiveBlockEntrypted=no
    ArchiveBlockMax=no
    ArchiveMaxCompressionRatio=300
    Checks=24
    DNSDatabaseInfo=current.cvd.clamav.net
    DatabaseMirror=db.local.clamav.net
    Debug=no
    DetectBrokenExecutables=no
    FilesystemScan=weekly
    FilesystemScanExclude=/proc,/sys,/usr/share,/var
    FilesystemScanFilesystems=/
    FilesystemScanReportTo=admin
    Foreground=yes
    HTTPProxyPassword=
    HTTPProxyPort=
    HTTPProxyServer=
    HTTPProxyUsername=
    HeuristicScanPrecedence=no
    IdleTimeout=60
    LeaveTemporaryFiles=no
    LogClean=no
    LogFileUnlock=yes
    LogTime=no
    LogVerbose=yes
    MaxAttempts=6
    MaxConnectionQueueLength=30
    MaxDirectoryRecursion=20
    MaxFileSize=20M
    MaxFiles=1500
    MaxRecursion=8
    MaxThreads=20
    Quarantine=enabled
    QuarantineDirectory=/var/spool/clamav/quarantine
    ReadTimeout=300
    ScanArchive=yes
    ScanHTML=yes
    ScanMail=yes
    ScanOLE2=yes
    ScanPE=yes
    ScanRAR=no
    SelfCheck=1800
    ShowProxySettings=no
    ShowUpdateSettings=no
    SignaturesUpdated=unknown
    UpdateNonOfficeHrs=disabled
    UpdateOfficeHrs=disabled
    UpdateWeekend=disabled
    status=enabled

# config show qpsmtpd
qpsmtpd=service
    Bcc=disabled
    BccMode=cc
    BccUser=maillog
    DNSBL=disabled
    LogLevel=6
    MaxScannerSize=25000000
    RBLList=whois.rfc-ignorant.org:dnsbl.njabl.org:zen.spamhaus.org
    RHSBL=disabled
    RequireResolvableFromHost=no
    SBLList=dsn.rfc-ignorant.org
    access=public
    qplogsumm=disabled
    status=enabled

# config show php
php=service
    AllowUrlFopen=Off
    status=enabled
......

Offline axessit

  • *****
  • 213
  • +0/-0
Re: Reject Mail on size
« Reply #7 on: November 21, 2011, 05:29:24 AM »
I'm not quite sure which way the email is going here - are you recieving a large email from your ISP, or is your ISP rejecting your 25MB message from one of your users ? You don't mention if these settings are from your internal SME or your DMZ SME. Is it bouncing from one SME to the other ?

Offline kadybee

  • **
  • 40
  • +0/-0
Re: Reject Mail on size
« Reply #8 on: November 21, 2011, 05:39:29 AM »
Coming inbound from the ISP, landing on the DMZ server and not going further (to the internal server) nor being rejected.

......

Offline mmccarn

  • *
  • 2,656
  • +10/-0
Re: Reject Mail on size
« Reply #9 on: November 21, 2011, 03:02:17 PM »
databytes

The file config/databytes determines the maximum size of messages qpsmtpd will accept, in bytes. The default is not to have a limit (except memory and storage limitations, of course). This file is used by lib/Qpsmtpd/SMTP.pm.

I read this to indicate that on a SME server you need the file /var/service/qpsmtpd/config/databytes in order to ahve qpsmtpd enforce email size limits on in-bound messages.

My SME servers don't have this file.

This should set the qpsmtpd message size to match the message limit configured for qmail:
Code: [Select]
echo `config getprop qmail MaxMessageSize` > /var/service/qpsmtpd/config/databytes
sv t qpsmtpd

If this works, please open a 'new feature request' in bugzilla asking to have 'databytes' for qpsmtpd set to match qmail::MaxMessageSize


Offline kadybee

  • **
  • 40
  • +0/-0
Re: Reject Mail on size
« Reply #10 on: November 21, 2011, 10:41:33 PM »
Yes, thanks, that did the trick.

......

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Reject Mail on size
« Reply #11 on: November 21, 2011, 11:51:20 PM »
If this works, please open a 'new feature request' in bugzilla asking to have 'databytes' for qpsmtpd set to match qmail::MaxMessageSize

If qpsmtpd is leaving partially received message files in its spool directory, then that is a problem as well. Please create a bug report.