mail alias not being processed in all "catch-all" configurations
Bug #1085488 reported by
Jordi Llonch
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
High
|
OpenERP's Framework R&D |
Bug Description
Hi,
I am using 6.2dev-
After setting up a catch-all incoming mail account, incoming messages sent to an alias account are ignored. The SMTP server is Postfix 2.9.4 and Dovecot 2.1.10.
The mail message contains a Delivered-To header with is the catch-all account which OpenERP does not know how to handle and raises the exception:
"No possible route found for incoming message with Message-Id %s. " \
"Create an appropriate mail.alias or force the destination model." % message_id
The suggested patch works for me.
Thanks,
Related branches
To post a comment you must log in.
Hi Jordi,
Thanks for reporting and providing a working patch!
Would you mind providing a little bit more information about your current catch-all setup, in order to be sure we are fixing this in the right manner for everybody, and covering most cases?
We were using the Delivered-To header as a way to unambiguously find the actual recipient of an email, among the possibly numerous recipients mentioned in the mail headers (To:, Cc:, etc.), out of which several could match OpenERP mail.aliases. I realize this was likely a wrong assumption, because various kinds of address rewriting mechanism could alter this behavior, so we can't rely on that exclusively.
The typical setup we had in mind was to configure a catch-all MX domain and pipe all the emails it receives to the email processing script[1] we provide in the `mail` module (The Settings screen still need to be updated to explain this). foo@localhost> header, in which the local part "project_foo" would match an OpenERP mail.alias entry.
If I recall correctly this could be accomplished with Postfix using a technique similar to what is described in the VIRTUAL_README for mailing-lists [2], except with a wildcard virtual alias (e.g. @erp.mydomain.com @localhost) and a regexp-based local(8) alias_maps that pipes everything to the script.
If an email was received for "<email address hidden>" it would be handed to local(8) and delivered to the script with a Delivered-To: <project_
Have you done a similar configuration, or are you instead using a virtual_alias rule that maps @erp.mydomain.com to <email address hidden> in combination with a fetchmail IMAP/POP config that fetches <email address hidden>?
I think that in the latter configuration the Delivered-To: header might always be set to "<email address hidden>", making the alias routing fail.
Yet another option is to have a virtual_alias that maps @erp.mydomain.com to erp-catchall@ localhost and then pipe 'erp-catchall' into our email processing script[1] using a local alias_maps pipe entry. I assume that this configuration would also have Delivered-To: headers set to 'erp-catchall@ localhost' , causing the same problem.
It looks like your patch would fix all configuration schemes without breaking the first one, but it makes me realize that we might have a problem if "foo@something" is used as a catch-all mailbox and there is a actually a 'foo' alias in OpenERP. If we can't prevent that, we might need to warn users about it in the configuration instructions.
Thanks!
[1] http:// bazaar. launchpad. net/~openerp/ openobject- addons/ trunk/view/ head:/mail/ static/ scripts/ openerp_ mailgate. py www.postfix. org/VIRTUAL_ README. html#mailing_ lists
[2] http://