1. Home
  2. Knowledge Base
  3. Attachment extraction

Attachment extraction

This feature allows surgemail to extract large attachments from email messages and store them on the built in web server, it replaces the attachment with a link in the original email message so the destination user can download the attachment (if they want it).

The attachments are then stored for a period of time, based on if the message was sent or received (adjustable per user/domain/global)

To enable the feature set:

       g_att_enable "true"

Then you will want to specify system defaults. If you want the feature turned off by default then DO NOT set the system defaults!

g_att_send "True" # Enable globally by default when sending msgs
g_att_in "True" # Enable globally when receiving msgs

Specify the default time to keep messages!

g_att_send_keep "90" # Set default time to keep sent attachments (days)
g_att_in_keep "2000" # Days to keep incoming attachments (days)

Other OPTIONAL system defaults to configure...


g_att_path   # Path to store attachments, default is 'att' sub folder
g_att_min "100k" # Adjust min size required to detach (default 70k) 
g_msg_max "30mb" # Increase max msg size 
g_msg_max_send "100mb" # Increase even more for authenticated users

# Domain level defaults:
att_send "True"     # Enable when sending msgs
att_send_keep "90"  # Days to keep sent msgs 
att_in "True"       # Enable when receiving msgs
att_in_keep "2000"  # Days to keep incoming attachments (5 years)

In addition the 'user' can enable/disable this feature in the Attachments item in the web admin self management page or in Advanced/Attachments section of SurgeWeb, the user can also view and delete the list of detached files.

You can convert existing messages for a user with the command:

tellmail att_detach user@xyz.com (IRREVERSIBLE!)

(Please make a backup of the users account before doing this!)

Be warned that this will then result in attachments older than the 'keep' settings being deleted the next night.

Quota implications: 30% Of disk space is saved when messages are stored in this format, the size of the users 'attachments' are still accounted for in the quota system.

Security implications: The attachments are protected from third party viewing by the long complex url which cannot be guessed (statistically speaking).

If you add -nodetach to the subject of a message, it will leave the message intact.

User.cgi list of attachements

Users can see their attached files in their user.cgi account settings, under 'Attachments' then "List Files"

Note: to make the new user settings visible in the account manage add:

g_authent_info name="Att Send Keep" field="asendkeep" access="user" default="" type=""
g_authent_info name="Att Send" field="asend" access="user" default="" type=""
g_authent_info name="Att In Keep" field="ainkeep" access="user" default="" type=""
g_authent_info name="Att In" field="ain" access="user" default="" type=""

Was this article helpful?