diff --git a/__openerp__.py b/__openerp__.py index b9987d3..e100d20 100644 --- a/__openerp__.py +++ b/__openerp__.py @@ -4,7 +4,15 @@ "author" : "Ivan Yelizariev", "category" : "Mail", "website" : "https://it-projects.info", - "description": """Update 'Reply-to' field to catchall value in order to fix problem like that: + "description": """ +Module uses system parameters: + +* mail.catchall.alias +* mail.catchall.domain + +Module updates reply-to field if it posible to sender alias + +Module updates 'FROM' field to catchall value in order to fix problem like that: 2014-01-18 06:25:56,532 6789 INFO trunk openerp.addons.mail.mail_thread: Routing mail from to info@MYDOMAIN.com with Message-Id <49131390026345@web16h.yandex.ru>: direct alias match: (u'res.users', 1, {}, 1, browse_record(mail.alias, 1)) 2014-01-18 06:25:57,212 6789 ERROR trunk openerp.addons.base.ir.ir_mail_server: Mail delivery failed via SMTP server 'smtp.yandex.ru'. diff --git a/mail_fix_553.py b/mail_fix_553.py index 84a5604..8eb5ce4 100644 --- a/mail_fix_553.py +++ b/mail_fix_553.py @@ -65,8 +65,11 @@ class mail_mail(osv.Model): res = None for email in email_list: email_from = mail.email_from + reply_to = mail.reply_to if re.search(correct_email_from, email_from) is None: email_from = default_email_from + else: + reply_to = email_from msg = ir_mail_server.build_email( email_from=email_from, @@ -75,7 +78,7 @@ class mail_mail(osv.Model): body=email.get('body'), body_alternative=email.get('body_alternative'), email_cc=tools.email_split(mail.email_cc), - reply_to=mail.reply_to, + reply_to=reply_to, attachments=attachments, message_id=mail.message_id, references=mail.references,