This package has no administrator interface.
The package is not working out-of-the-box, it must be configured by an administrator first.
- Go to the System Configuration screen.
- Select OTRSDeleteAttachments in the Navigation widget.
- Navigate to Core → Ticket in the navigation tree.
- Add some file MIME types to setting
OTRSDeleteAttachments::Filetypesas key-value pairs. The key is the MIME type, the value is the deletion flag.
- 0: This type of attachments are not to be deleted.
- 1: This type of attachments are going to deleted.
Automatic File Type Population¶
There is a console command
Maint::Ticket::Attachment::AddMIMETypes to populate the system configuration setting automatically.
otrs> /opt/otrs/bin/otrs.Console.pl Maint::Ticket::Attachment::AddMIMETypes Searching attachment types received the last 90 days... | Added undefined MIME type: application/x-yaml | Added undefined MIME type: image/png | Added undefined MIME type: text/html | Added undefined MIME type: application/pdf | Added undefined MIME type: text/plain Updating SysConfig... Done.
The console command collects only MIME types of attachments, that are in closed tickets and received within the last 90 days.
Delete Attachments From Tickets¶
The attachment deletion is done by console command
Maint::Ticket::Attachment::Delete. Check the following settings to customize the job:
A list of queues (specified by their names) which are processed by the
If no queues are defined, all queues will be affected.
- The period (in days) which should be analyzed, starting from the time when the ticket was closed, backwards.
- The minimum time span (in days) between the current time and the time when the ticket was closed, to delete the attachments of a ticket.
TimeSpan value of 1 and
TimePeriod value of 30 means that the eligible tickets to delete their attachments are the ones that has been closed between 30 days ago and yesterday.
Eligible tickets |=========================| TimePeriod TimeSpan |------------|------------|------------|------------| 31 days ago 30 days ago 15 days ago 1 day ago Today
The console command
Maint::Ticket::Attachment::Delete has some other options. Run the command with the
--help option to see the possibilities.
otrs> /opt/otrs/bin/otrs.Console.pl Maint::Ticket::Attachment::Delete --help
Updating the file types and deleting the attachments can be run in the background by the OTRS daemon. Enable the following settings to run the jobs in a regular basis:
- Delete attachments from tickets.
- Populate system configuration MIME types for attachment deletion.
Do not forget to restart the OTRS daemon after the system configuration is changed.