Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

Max Email Size Suggestion

Quote Reply
Max Email Size Suggestion
hi,

when a message is delivered to the system that is over the maximum allowed size - ie. the limit is 2mb and the email is say 5mb - can we have a setting in admin area to choose if a message is sent to the sender making them aware of the problem?

I'm not sure if the system currently sends an email out or bounces the oversize email or not - as far as i'm aware no.

unless somebody else knows different?

cheers,
regan.
Quote Reply
Re: [ryel01] Max Email Size Suggestion In reply to
Hi,

It should bounce the email message if you have the "Too Many Messages" option set to Bounce in Setup->Undeliverables, it will also bounce messages that are too large.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Max Email Size Suggestion In reply to
In Reply To:
Hi,

It should bounce the email message if you have the "Too Many Messages" option set to Bounce in Setup->Undeliverables, it will also bounce messages that are too large.

Cheers,

Alex


ahhhh ok, so that one setting covers both options. Thanks for clearing that one up. Maybe you could add that into the description of what it does, somebody is bound to ask again at some stage! :)

cheers

regan.
Quote Reply
Re: [Alex] Max Email Size Suggestion In reply to
In Reply To:
It should bounce the email message if you have the "Too Many Messages" option set to Bounce in Setup->Undeliverables, it will also bounce messages that are too large.

Hi Alex,

On this function again - is there any chance future versions could have these two bounce messges seperated? I have just found one user who's mailbox is full, but the sender is being sent a "Your message is too big" email - which isn't correct.

If they could be seperated up so it's clearly understood either their messge is too big, or the users mailbox is full - not - it could be one or the other.

Hope that makes sense.

What do you think?

Regan.
Quote Reply
Re: [ryel01] Max Email Size Suggestion In reply to
I'll get this fixed up tomorrow.

Adrian
Quote Reply
Re: [brewt] Max Email Size Suggestion In reply to
In Reply To:
I'll get this fixed up tomorrow.



cool.

will it be a fix posted here, or will it be something included in the next release?

cheers,
regan.
Quote Reply
Re: [ryel01] Max Email Size Suggestion In reply to
It will be fixed in the next release. If you really want it, I can post a fix too.

Adrian
Quote Reply
Re: [brewt] Max Email Size Suggestion In reply to
In Reply To:
It will be fixed in the next release. If you really want it, I can post a fix too.



if you could post the fix that'd be cool. i've been meaning to upgrade for a while... but the while has been a long time coming. Unimpressed

regan.
Quote Reply
Re: [ryel01] Max Email Size Suggestion In reply to
In incoming.pl, around line line 600, you'll see:
Code:
my $rep = $PLG->dispatch('GMail::Messages::validate', sub { GMail::Messages->validate(@_) }, $size);

If you look at the comments for the function GMail::Messages::validate, you'll see that it returns:
0 if the user has exceeded the maximum number of messages
-1 if the user has exceeded the space quota
-2 if the email is too big

You need to change the condition below that to something like:
Code:
if ($CFG->{email}->{bounce}->{too_many} and !$bounced and $can_bounce) {
$bounced = 1;
my %error_msgs = (
0 => "The user has exceeded the maximum number of allowed messages.",
-1 => "The user has exceeded the space quota.",
-2 => "The email has exceeded the maximum size of $CFG->{limits}->{msgs_size} bytes."
);
GMail->debug("Bouncing message, $error_msgs{$rep}") if $CFG->{debug};
$PLG->dispatch('incoming::bounce', \&bounce, $num, $mail, $error_msgs{$rep}) or next MESSAGE;
$ret->{bounce_count}++;
}

If you use pipe mode, you'll have to do something similar to get_input().

Adrian