LISTSERV at Work
Tweet This
LISTSERV Tech Tip

Q: Why should I restrict message size in LISTSERV and how can I best do this?

It's common for people to use mailing lists to share attachments, and this doesn't usually cause any problems if the attachments are small and the mailing list has relatively few subscribers. However, there are some pitfalls to avoid, particularly if someone sends a very large attachment to a mailing list with a lot of subscribers.

This tip is split into several sections. The first two deal with why you might want to restrict the size of messages allowed on your mailing lists, and the last two focus on the best ways to accomplish this.

Why Your Subscribers May Not Want Large Attachments

Attachments can prove problematic for recipients for a variety of reasons:

  • While some mail systems can accept attachments that are many megabytes in size, many others have a limit on the size of messages that they will accept. For subscribers using such systems, messages with large attachments may not arrive at all. Additionally, if these messages bounce, then the subscribers may be automatically removed from the mailing list, depending on its configuration.
  • Most email providers only allocate a certain amount of space for each user's mail, and messages with large attachments eat into that valuable space.
  • Even if the size of the message itself is not a problem, some sites may not accept certain types of attachments (notably .exe files, but some may not even accept .doc files) due to security concerns.
  • If your mailing list has a large number of subscribers at a single site, then a flurry of messages with large attachments may overload their mail server, leading to mail delays.

LISTSERV Resource Considerations

Messages with large attachments also take up extra LISTSERV resources. In particular, if a mailing list is configured with "Mail-Merge= Yes", then LISTSERV must create a separate .mail file (each containing a copy of the message) for each subscriber in its spool directory.

So, for instance, if you have a "Mail-Merge= Yes" mailing list with 50,000 subscribers, and someone sends a message with a 5MB attachment to it, then LISTSERV will need 5MB * 50,000 copies = 250GB of free disk space in order to process the mailing. Since LISTSERV deletes the mailing from the spool directory after it has been delivered, this can lead to a puzzling situation where LISTSERV claims to have run out of space, even though (when the situation is investigated after the mailing is completed) it seems to have many GB of space free. LISTSERV will then deliver all of these messages to its outgoing mail server, which may risk overwhelming that server as well.

This problem is made even more extreme if multiple messages with attachments are sent to large mailing lists in a short period of time. Additionally, be aware that these rule of thumb estimates are always going to be a bit on the low side. There is always some additional overhead resulting from encoding the attachments for transmission via email and so on.

If the server that LISTSERV is installed on does run out of disk space, even for a short period of time, this can have dire consequences: subscribers not receiving messages (or receiving multiple copies of messages), files becoming corrupted, crashes, etc.

An additional issue may arise if the messages are sent to a mailing list with archives as those will also take up space on the server and will increase memory usage when the messages containing the attachments are accessed by users. LISTSERV has ways to minimize the amount of system resources used in these circumstances, but servers with tight constraints on disk space or memory usage could run into problems.

Ways To Restrict Message Size Within LISTSERV

The FILEMAXL Site Configuration Setting

The FILEMAXL setting, available under "Server Administration -> Site Configuration" in the web interface under the "Optimization" tab (Expert Mode), tells LISTSERV not to process jobs that have more than a certain number of lines. If a message exceeds the FILEMAXL size, then LISTSERV will not process it and a notification will be sent to the site administrators only. A rejection message is not generated in this case as LISTSERV would need to process the message in order to determine to whom to send the rejection message, and it can't process the message because it's too big.

FILEMAXL is measured in the number of lines the message contains, including the text of the message, the lines of HTML code if the message is formatted using HTML, and the number of lines used by any encoded attachments included with the message. Since the number of characters per line is generally not going to be exactly the same between two messages, the rule of thumb is that 1MB is roughly between 13,000 lines (at 80 characters per line) and 16,000 lines (at 65 characters per line). The default value of FILEMAXL is 500,000, which is roughly between 30 and 40MB.

Since the sender isn't notified when FILEMAXL is exceeded, and its value can't be specified in kilobytes or megabytes, this setting can generally be set fairly liberally (or leaving it at its default value), and then further restricting the message size for individual mailing lists as follows.

The SizeLim Mailing List Setting

You can set a smaller limit for individual mailing lists using the "SizeLim" mailing list setting, which is available under "List Management -> List Configuration" under the "Attachments" tab. It can be specified in kilobytes or megabytes.

If a message exceeds the SizeLim limit but is smaller than the FILEMAXL limit, then a rejection message will be sent to the sender of the message. The rejection message is based on the MSG_POSTING_REJECT_EXCEED_SIZELIM mail template, which can be accessed and edited under "List Management -> Mail Templates" (to customize it for a specific mailing list) or "Server Administration -> Mail Templates" (to customize the default version used sitewide).

Other Settings Related to Attachments

Depending on the purpose of a mailing list, it may make sense to disallow attachments altogether. If this is desired, you can use "Attachments= No" or "Attachments= No,Filter". With "Filter", messages will be distributed with any attachments removed. Without it, messages with attachments will be rejected outright. Note that this may have undesirable effects if users have signatures that include small images as those are typically included as attachments in their messages, so use these settings with caution.

More complicated "Attachments" settings are also possible. Details can be found in the List Keyword Reference Guide and in the below video tutorial.

How can I restrict the size or type of attachments allowed on my list?

Alternatives To Sending Attachments To Mailing Lists

In general, it's better to send a link to a large attachment to a mailing list rather than sending the attachment itself. There are numerous file sharing solutions out there that can be used for this purpose, including Dropbox, Google Drive, Sendspace, OneDrive, and so on.

If the mailing lists are used for communication within your company or organization, then check to see if your organization has a preferred file-sharing platform since there may be a policy over where files containing confidential information can be stored, for instance.

Otherwise, file-sharing sites like these generally work pretty similarly, so L-Soft doesn't specifically recommend one of them over any of the others.

Got Feedback?

What kind of tech tips would you like to read next?

Get in Touch

Next Steps


© L-Soft 2021. All Rights Reserved.




Powered by LISTSERV Maestro