🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.mail.misc
Article #5754

Re: SMTP mail size limit

#5754
From: those who know me have no need o...
Date: Thu, 24 Jun 2004 20:24
37 lines
2700 bytes
[fu-t set -- cross-posted articles should always have one set]

in comp.mail.misc i read:

>I'm trying to write something that will enforce a message size limit, 
>intended for use over a modem connection.
>
>The other catch: No ESMTP. It has to be workable with bog-standard SMTP.
>
>Is there a way of doing this without having to wait for all 10Mb of a 
>message to squeeze its way down a 28k8 phone line?

not really.  you might write a mime parser into your mta (which in general
is a mistake to do in an mta), in which case there may be sufficient clues
available (content-length headers) which you would trust (which an mta
should not do, and even a mime parser should be wary of mistakes), but even
that might not always work (think lots of small objects).

>I know just kicking the connection will make the sending server treat it 
>as a 4xx error and retry later. What I want to do is to somehow tell it to 
>get lost and don't bother retrying if the message hits a particular 
>size threshold.

you must return a 5xx code.  technically you shouldn't send it until the
sender is done, but in general it works to send it as soon as your limit is
exceeded; either the sender will immediately stop (modulo stuff already in
transit) or it will continue and you'll just have to dump the connection
and hope it processes the 5xx even though it had an abrupt disconnect.  and
you'll need to decide how to cope with sites that aren't willing to deviate
sufficiently from the standard for this to work -- they'll retry, and even
if you abort as soon as the message-id is seen (another mistake for an mta)
that might end-up transferring as many or more bytes across all retries as
the message you are trying to block, i.e., you need to learn from which
servers you have to give-up and take it.

-- 
a signature
Technical Details
Message-ID: <m1smckafu6.gnus@usa.net>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-post-01!supernews.com!news.supernews.com!not-for-mail
References: <slrncdm9e3.dql.soruk@zeskia.int.eridani.co.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f4424,58f9c86c1fbf283a
X-Google-Thread: 10bb05,58f9c86c1fbf283a
X-Google-Attributes: gidf4424,gid10bb05,public
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-post-01!supernews.com!news.supernews.com!not-for-mail
From: those who know me have no need of my name <not-a-real-address@usa.net>
Newsgroups: comp.mail.misc,demon.tech.unix,demon.ip.developers
Subject: Re: SMTP mail size limit
Followup-To: comp.mail.misc
Date: 24 Jun 2004 20:24:05 GMT
Organization: earthfriends
Message-ID: <m1smckafu6.gnus@usa.net>
References: <slrncdm9e3.dql.soruk@zeskia.int.eridani.co.uk>
User-Agent: Gnus/5.110002 (No Gnus v0.2) XEmacs/21.4 (Rational FORTRAN,
 linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: abuse@supernews.com
Lines: 37