Koozali.org: home of the SME Server

QMail and Oversized Attachments

Robert Birch

QMail and Oversized Attachments
« on: July 30, 2002, 12:16:06 AM »
I am using SME 5.1.2. I have it delegating our email to my exchange server (5.5)

The problem is, if we send a file with a large attachment that is too big for the server we are sending to, we get an email back from the Mailer-Daemon with the attachment as part of the message. The attachment is in MIME format. Therefore the message is very large, and takes a while for Outlook to load it up.

Is there anyway to get QMail to not include the attachment in the error message?

Thanks,
Robert Birch

Nathan Fowler

Re: QMail and Oversized Attachments
« Reply #1 on: July 30, 2002, 05:24:23 AM »
You can limit the attachment size directly by doing the following from console:

pico /etc/e-smith/templates/var/qmail/control/databytes
change the zero to the byte size you will allow
/sbin/e-smith/expand-template /var/qmail/control/databytes
/etc/rc.d/init.d/qmail.init stop
/etc/rc.d/init.d/qmail.init start

Attachment filtering:
http://www.fehcom.de/qmail/filter.html

You could configure your client mailboxes to strip attachments using the above software with the subject lines matching the bounce string.  You wouldn't be avoiding it on the "server" end but it would prevent these attachments from reaching your client mailboxes.

I've searched google for a while on this topic and this is all I could find.

Hope this helps,
Nathan

Charlie Brady

Re: QMail and Oversized Attachments
« Reply #2 on: July 30, 2002, 06:25:39 AM »
Nathan Fowler wrote:

> You can limit the attachment size directly by doing the
> following from console:
>
> pico /etc/e-smith/templates/var/qmail/control/databytes
> change the zero to the byte size you will allow
> /sbin/e-smith/expand-template /var/qmail/control/databytes
> /etc/rc.d/init.d/qmail.init stop
> /etc/rc.d/init.d/qmail.init start

No, Nathan, you shouldn't edit template files directly, you should instead create a custom template. See http://www.e-smith.org/custom/.
In this case, that would be:

mkdir -p /etc/e-smith/templates-custom/var/qmail/control
echo 50000 > \
/etc/e-smith/templates-custom/var/qmail/control/databytes
/etc/rc.d/init.d/qmail.init restart

But in any case, /var/qmail/control/databytes is only used by qmail-smtpd, which is not used in any recent version of the SME server.

In SME 5.5, all that is required is to do:

/sbin/e-smith/db configuration setprop smtpfront-qmail \
  MaxMessageSize nnnnn
/sbin/e-smith/signal-event email-update

Regards

Charlie

Aaron

Re: QMail and Oversized Attachments
« Reply #3 on: July 30, 2002, 09:50:53 AM »
Excellent contribution (so many hidden gems), I just recently had a nut accountant fire off a 20M accounting file to her home over a dialup...me & my big mouth chatting them up about off site backup...

On a 5.12 box I believe the qmail restart command should be:

/etc/rc.d/init.d/qmail restart (not "qmail.init restart")

rob wellesley

Re: QMail and Oversized Attachments
« Reply #4 on: July 30, 2002, 10:06:16 AM »
Charlie Brady wrote:

>
> In SME 5.5, all that is required is to do:
>
> /sbin/e-smith/db configuration setprop smtpfront-qmail \
>   MaxMessageSize nnnnn
> /sbin/e-smith/signal-event email-update
>
> Regards
>
> Charlie

Is this a 5.1.2 feature?

and...   Where does one go to learn about such things?

rob

Robert Birch

Re: QMail and Oversized Attachments
« Reply #5 on: July 30, 2002, 08:27:27 PM »
I don't need to limit the size of attachments. Some of our clients accept real large files, some don't.

I just don't want QMail to send the bounce message back with the attachment in textual format. If it was a straight binary attachment, it would be much easier on Outlook to load up.

I went to Qmail.org and found some patches for the source code to fix this problem, but I don't think I could use that with e-smith.

The filtering would probably work, but would like something a little more graceful.

Any other ideas?

Robert Birch