summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerghei Mihai <smihai@entrouvert.com>2016-03-29 12:44:18 (GMT)
committerSerghei Mihai <smihai@entrouvert.com>2016-03-31 16:48:20 (GMT)
commita45871b95ad84e0565e160c9a1605e8d7a494775 (patch)
treebd7feeb5aa619311c5e5ead3c7a03107e0b54029
parentadde1b024a8b15b11543c889acce41653831f8ff (diff)
downloadmail2redmine-a45871b95ad84e0565e160c9a1605e8d7a494775.zip
mail2redmine-a45871b95ad84e0565e160c9a1605e8d7a494775.tar.gz
mail2redmine-a45871b95ad84e0565e160c9a1605e8d7a494775.tar.bz2
check the mails dump directory exists
-rw-r--r--mail2redmine.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mail2redmine.py b/mail2redmine.py
index 2ee6504..bcc51ba 100644
--- a/mail2redmine.py
+++ b/mail2redmine.py
@@ -120,7 +120,10 @@ L'équipe Entrouvert
if __name__ == '__main__':
mail = sys.stdin.read()
- filename = '/tmp/%s.mail' % uuid.uuid4()
+ mail_dumps_dir = '/var/tmp'
+ if not os.path.exists(mail_dumps_dir):
+ os.mkdir(mail_dumps_dir)
+ filename = os.path.join(mail_dumps_dir, '%s.mail' % uuid.uuid4())
with open(filename, 'w') as mail_dump:
mail_dump.write(mail)
create_ticket(mail)