summaryrefslogtreecommitdiff
path: root/addons/mail/static/scripts/openerp_mailgate.py
diff options
context:
space:
mode:
authorJigar Amin - OpenERP <jam@tinyerp.com>2012-06-29 16:10:21 +0530
committerJigar Amin - OpenERP <jam@tinyerp.com>2012-06-29 16:10:21 +0530
commit58f095d89df5d7d4294629dbafbae46f07e87ff4 (patch)
treee26f749b90fd12b7cdd4e6306354ee3c0aa2debc /addons/mail/static/scripts/openerp_mailgate.py
parentf3db89aa8c98828c81602fd16a74d9c485d6151a (diff)
[FIX] mailgate script
bzr revid: jam@tinyerp.com-20120629104021-bdacv1hwqwnglj7a
Diffstat (limited to 'addons/mail/static/scripts/openerp_mailgate.py')
-rwxr-xr-xaddons/mail/static/scripts/openerp_mailgate.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/addons/mail/static/scripts/openerp_mailgate.py b/addons/mail/static/scripts/openerp_mailgate.py
index 9d046027b6e..64dafc56785 100755
--- a/addons/mail/static/scripts/openerp_mailgate.py
+++ b/addons/mail/static/scripts/openerp_mailgate.py
@@ -1,4 +1,4 @@
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:#!/usr/bin/env python
+#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
#
@@ -157,28 +157,29 @@ def main():
"""
Receive the email via the stdin and send it to the OpenERP Server
"""
+
parser = configure_parser()
(options, args) = parser.parse_args()
method = "message_process"
email_parser = EmailParser(options.userid,
options.password,
- options.model,
- options.default,
- dbname=options.dbname,
- host=options.host,
- port=options.port)
+ options.dbname,
+ options.host,
+ options.port,
+ model=options.model,
+ email_default= options.default)
msg_txt = sys.stdin.read()
custom_values = {}
if not options.model:
method = "message_catchall"
try:
- custom_values = dict(eval(options.custom_values or {} ))
+ custom_values = dict(eval(options.custom_values or "{}" ))
except:
import traceback
traceback.print_exc()
try:
- email_parser.parse(msg_txt, custom_values, options.save_original or False)
+ email_parser.parse(method, msg_txt, custom_values, options.save_original or False)
except Exception:
msg = '\n'.join([
'parameters',