← Back to team overview

openerp-india team mailing list archive

Re: [Bug 1085488] Re: mail alias not being processed

 

Hi Olivier,

As you pointed, my setup is the one like erp-catchall@. The bad news is
that OpenERP mail.alias approach won't work when the recipient is in BCC in
scenario catch-all, and possibly others, like postfix using delivery agent.

That makes me think why you are relying on Delivered-To. In postfix that
header is used to prevent mail forwarding
loops<http://www.porcupine.org/postfix/doc/faq.html#delivered> and,
as far as I know and after some googling, I have not found a RFC
compliance.

Other option will be use X-Original-To header, but is only added by postfix
if local mailbox delivery, not if lmtp or delivery agent involved.

My current setup is postfix + policyd (modified version 1) + amavisd-new +
spamassassin + dovecot "LDA deliver" with the accounts under a mysql db
using postfixadmin scheme.

As far as I know amavisd can do some address rewriting on X-Original-To.

I have different domains (example1.com, example2.com, example3.com)
aliasied to a main domain (example.com).

*@example1.com -> *@example.com
*@example2.com -> *@example.com
*@example3.com -> *@example.com

There's a catch-all address defined for the destination domain:

*@example.com  goes into catch-all@xxxxxxxxxxx
jordi@xxxxxxxxxxx has own mailbox

Then I set up a fetchmail object for catch-all@xxxxxxxxxxx and one for
jordi@xxxxxxxxxxx

Emails received in the mailbox have headers like:

Return-Path: <llonchj@xxxxxxxxx>

Delivered-To: *catch-all@xxxxxxxxxxx*

From: Jordi Llonch <llonchj@xxxxxxxxx>

To: "Test" <*test_user@xxxxxxxxxxx*>

or

Return-Path: <llonchj@xxxxxxxxx>

Delivered-To: *catch-all@xxxxxxxxxxx*

From: Jordi Llonch <llonchj@xxxxxxxxx>

To: *project+one@xxxxxxxxxxxx*


Hope all that helps you.

Kind regards,
Jordi



2012/12/5 Olivier Dony (OpenERP) <1085488@xxxxxxxxxxxxxxxxxx>

> 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 subscribed to the bug
> report.
> 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
>

-- 
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


References