Settings¶
You should specify settings in your settings.py like this:
DJANGO_MAIL_ADMIN = {
'BATCH_SIZE': 1000,
'LOG_LEVEL': 1,
}
Here’s a list of available settings:
Settings for outgoing email¶
| Setting | Default | Description |
|---|---|---|
| BATCH_SIZE | 100 | How many email’s to send at a time. Used in mail.py/get_queued |
| THREADS_PER_PROCESS | 5 | How many threads to use when sending emails |
| DEFAULT_PRIORITY | ‘medium’ | Priority, which is assigned to new email if not given specifically |
| LOG_LEVEL | 2 | Log level. 0 - log nothing, 1 - log errors, 2 - log errors and successors |
| SENDING_ORDER | [‘-priority’] | Sending order for emails. If you want to send queued emails in FIFO order, set this to [‘created’] |
Settings for incoming email¶
| Setting | Default | Description |
|---|---|---|
| STRIP_UNALLOWED_MIMETYPES | False | Controls whether or not we remove mimetypes not specified in ALLOWED_MIMETYPES from the message prior to storage. |
| ALLOWED_MIMETYPES | [‘text/plain’, ‘text/html’] | Has no effect if STRIP_UNALLOWED_MIMETYPES is set to False, otherwise - specifies allowed mimetypes that will not be stripped |
| TEXT_STORED_MIMETYPES | [‘text/plain’, ‘text/html’] | A list of mimetypes that will remain stored in the text body of the message in the database. |
| ALTERED_MESSAGE_HEADER | ‘X-Django-Mail-Admin-Altered-Message’ | Header to add to a message payload part in the event that the message cannot be reproduced accurately |
| ATTACHMENT_INTERPOLATION_HEADER | ‘X-Django-Mail-Admin-Interpolate-Attachment’ | Header to add to the temporary ‘dehydrated’ message body in lieu of a non-text message payload component. The value of this header will be used to ‘rehydrate’ the message into a proper e-mail object in the event of a message instance’s get_email_object method being called. |
| ATTACHMENT_UPLOAD_TO | ‘mail_admin_attachments/%Y/%m/%d/’ | Attachments will be saved to this location. Specifies the upload_to setting for the attachment FileField. For more info, consult Django docs |
| STORE_ORIGINAL_MESSAGE | True | Controls whether or not we store original messages in eml field |
| COMPRESS_ORIGINAL_MESSAGE | False | Defines whether we compress the stored original message (.eml becomes .emg.gz) |
| ORIGINAL_MESSAGE_COMPRESSION | 6 | Defines the level of original message compression, if enabled |
| DEFAULT_CHARSET | ‘iso8859-1’ | The charset that is used by default when decoding emails |