OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: postfix bounces on first try with recipient_delimiter

From: Adam Jacob Muller (lists-postfixadam.gs)
Date: Sun Apr 08 2007 - 11:54:32 CDT


On Mar 23, 2007, at 5:10 PM, Wietse Venema wrote:

> Koen Vermeer:
>> Op vr, 23-03-2007 te 15:16 -0400, schreef Wietse Venema:
>>> Koen Vermeer:
>>>> I was bold and patched my own postfix (mostly copy&paste from the
>>>> ${mailbox} code in pipe.c). Let me know if I should submit this
>>>> somewhere, or that this is considered to be of my interest only.
>>> If you can post this (or send an URL) we could fold this into
>>> Postfix 2.5.
>>
>> OK, this is a patch against the Debian version 2.3.8-2. It's my first
>> try at something like this, so don't shoot me if the format is
>> incorrect, I made some stupid mistake, or it eats all your mail. The
>> patch is very simple. I'd like to add some text to the man page as
>> well,
>> but I'm not sure yet how the other flags affect ${domain}. I
>> assume it
>> is affected in the same way by 'u' as ${extension}, ${mailbox} and
>> ${user}.
>>
>> Let me know if there is something else I can do!
>>
>
> I think this will work. As you have found, with Postfix it's not
> hard to add a variation on an existing feature.
>
> As for documentation, the domain is subject to the 'h' flag
> just like ${nexthop} and ${recipient}.
>
> Wietse

There is a side-affect of this patch I had not noticed until today
(i've been using it for ~1w now).

If your pipe uses the D flag (append delivered-to header). The
delivered-to header is "wrong".

Below examples use recipient_delimiter = +

as an example:

Mail to
adam-alias+foo=bar.comadam.gs

where adam-aliasadam.gs => adamadam.gs in virtual alias table
rewritten to
adam+foo=bar.comadam.gs

mail pipes to ${user}${domain}, which is
adamadam.gs

however,
delivered-to header is
adam+foo=bar.comadam.gs

This would probably occur identically for the simpler form where mail
is sent to adam+foo=bar.comadam.gs of course.

I have -no- idea how to categorize this, it's definitely not a bug
per-se. It also seems like incorrect behavior though.

-Adam