Community: Framework mailing list archives

expert-framework@mail.odoo.com

Re: [PATCH] [WIP] Identifies with the SMTP server properly.

by
Rui Andrada
- 11/05/2014 11:56:24
Hi Manuel,

Thanks for sharing your experience I do appreciate to see your topic and
guess I have this strange behavior here.
My setup is little different and I'll reproduce your tests to see if
have same problem,
Is anything I can do for help you, I really would like to know.

On 24-10-2014 17:27, Manuel Vázquez Acosta wrote:
> From: Manuel Vázquez Acosta <mva.led@gmail.com>
>
> ---
>  openerp/addons/base/ir/ir_mail_server.py | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/openerp/addons/base/ir/ir_mail_server.py b/openerp/addons/base/ir/ir_mail_server.py
> index f2fa7a7..5ba0935 100644
> --- a/openerp/addons/base/ir/ir_mail_server.py
> +++ b/openerp/addons/base/ir/ir_mail_server.py
> @@ -386,7 +386,14 @@ class ir_mail_server(osv.osv):
>          :return: the Message-ID of the message that was just sent, if successfully sent, otherwise raises
>                   MailDeliveryException and logs root cause.
>          """
> -        smtp_from = message['Return-Path'] or message['From']
> +        # TODO: If the from address is not in the catchall domain.
> +        _get_param = self.pool['ir.config_parameter'].get_param
> +        catchall_alias = _get_param(cr, uid, "mail.catchall.alias", context=context)
> +        catchall_domain = _get_param(cr, uid, "mail.catchall.domain", context=context)
> +        if catchall_alias and catchall_domain:
> +            message['Sender'] = '%s@%s' % (catchall_alias, catchall_domain)
> +
> +        smtp_from = message['Return-Path'] or message['Sender'] or message['From']
>          assert smtp_from, "The Return-Path or From header is required for any outbound email"
>  
>          # The email's "Envelope From" (Return-Path), and all recipient addresses must only contain ASCII characters.
> -- 
> 1.9.1
>
> _______________________________________________
> Mailing-List: https://www.odoo.com/groups/community-framework-62
> Post to: mailto:expert-framework@mail.odoo.com
> Unsubscribe: https://www.odoo.com/groups?unsubscribe
>

-- 
Rui Andrada