← Back to team overview

openerp-india team mailing list archive

[Bug 1085488] Re: mail alias not being processed

 

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).
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 "project_foo@xxxxxxxxxxxxxxxx" it would be handed to local(8) and delivered to the script with a Delivered-To: <project_foo@localhost> header, in which the local part "project_foo" would match an OpenERP mail.alias entry.

Have you done a similar configuration, or are you instead using a virtual_alias rule that maps @erp.mydomain.com to foo@xxxxxxxxxxxx in combination with a fetchmail IMAP/POP config that fetches foo@xxxxxxxxxxxx?
I think that in the latter configuration the Delivered-To: header might always be set to "foo@xxxxxxxxxxxx", 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
[2] http://www.postfix.org/VIRTUAL_README.html#mailing_lists

** Changed in: openobject-addons
   Importance: Undecided => High

** Changed in: openobject-addons
       Status: New => Confirmed

** Changed in: openobject-addons
    Milestone: None => 7.0

** Changed in: openobject-addons
     Assignee: (unassigned) => OpenERP's Framework R&D (openerp-dev-framework)

** Summary changed:

- mail alias not being processed
+ mail alias not being processed in all "catch-all" configurations

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1085488

Title:
  mail alias not being processed in all "catch-all" configurations

Status in OpenERP Addons (modules):
  Confirmed

Bug description:
  Hi,

  I am using 6.2dev-20121127-000102.

  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,

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1085488/+subscriptions


Follow ups

References