summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorCinghio Pinghio <cinghio@linuxmail.org>2015-12-16 13:30:31 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2015-12-16 16:10:22 +0000
commit0042fc710dfcc93d9c09891c388fae2797ce052f (patch)
tree099ca54965abee0d36d563b30ccd177310bf79a2 /docs
parent96126036a672b75b071a7d6c5aef8e4aced10eee (diff)
added hook for the user to sinitize attachments filenames
Diffstat (limited to 'docs')
-rw-r--r--docs/source/configuration/hooks.rst16
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/source/configuration/hooks.rst b/docs/source/configuration/hooks.rst
index 1709df68..a384d73e 100644
--- a/docs/source/configuration/hooks.rst
+++ b/docs/source/configuration/hooks.rst
@@ -178,3 +178,19 @@ Apart from command pre- and posthooks, the following hooks will be interpreted:
.. py:function:: exit()
run just before the program exits
+
+.. py:function:: sanitize_attachment_filename(filename=None, prefix='', suffix='')
+
+ returns `prefix` and `suffix` for a sanitized filename to use while
+ opening an attachment.
+ The `prefix` and `suffix` are used to open a file named
+ `prefix` + `XXXXXX` + `suffix` in a temporary directory.
+
+ :param filename: filename provided in the email (can be None)
+ :type filename: str or None
+ :param prefix: prefix string as found on mailcap
+ :type prefix: str
+ :param suffix: suffix string as found on mailcap
+ :type suffix: str
+ :returns: tuple of `prefix` and `suffix`
+ :rtype: (str, str)