On 7/7/2023 5:12 PM, Wietse Venema via Postfix-users wrote:
joe a via Postfix-users:
On 7/7/2023 3:46 PM, joe a via Postfix-users wrote:
One hesitates to post this.

Found some oddness when changing a destination in transport_maps
(transport_maps = lmdb:/etc/postfix/transport).

Seems related to pattern matching.

The file /etc/postfix/transport contains entries of this form:

somename-xyz.com     noauth:ipaddress_1
somename.xyz               noauth:ipaddress_2
*            relay:[someISP]:587

ipaddress_1 is a server of long standing.  ipaddress_2 is a new box, to
eventually replace the older box.

Testing reveals that emails to the first case (translated to real)
address yieldd proper results, as do those to the second case.

However, when I change the first case from ipaddress_1 to ipaddress_2,
after postmap /etc/posfix/transport, test email to the first case
"u...@somename-xyz.com" seem to "fall through" to the relay, resulting
in a bounce.

Will I need to resort to a "reg-ex table" to, hopefully, resolve this?

Perhaps meaningful, found that "grep somename.xyz /etc/postfix/*" for
example resulted in a match for somename.xyz and somename-xyz.com with
somename.xyz and somename-xyz colorized, indicating the "matched" text.
Variations on the form of the search term found that "grep "somename\-"
files", provided an exact match.  That is enclosing the search term in
double quotes with the escape character seemed to "fix" it.

Or, is this just "expected behavior"?

Oh, Nurse, is it time for meds yet?

Apparently wrong again.

postmap -q "stuff" /etc/postfix/transport seems to match as expected in
      each case.

The need to use "stuff" in the "poatmap -q" command indicates that
the query contained one or more whitespace characters. In the
"postmap -q" command, a query that contains whitespace needs to be
enclosed to prevent the shell (bash) from splitting it into multiple
arguments.

Also note this in the postmap manpage:

     INPUT FILE FORMAT
         The format of a lookup table input file is as follows:

         - A table entry has the form

                key whitespace value

         ... Whitespace in lookup keys is supported in Postfix 3.2 and
         later, by surrounding the key with double quote characters `"'.
         Within the double quotes, double quote `"' and backslash `\'
         characters can be included by quoting them with a preceding
         backslash.

        Wietse
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Thanks. It's been an illuminating day, even though I spent much of it following several White Rabbits down a hole (of my own digging).

The ways one can mislead oneself are many. Resorting to actually following the reject messages and failed delivers, line by line rather than "speed skimming, because I can you know", and Googling the relevant term things, the solution was presented.

Seems that some email bounced as it was contained a header "Delivered-To", which was causing one set of problems. Following this, resolved that one:

# vim /etc/postfix/main.cf
> header_checks = regexp:/etc/postfix/header_checks

# vim /etc/postfix/header_checks
> /^Delivered-To:.*/ IGNORE

# postmap /etc/postfix/header_checks
# service postfix restart
# service postfix status

The last two lines of course needed to be done "the modern way".

The other issue was dovecot related, oddly enough with the same user. It appeared to be defined, yet, was not found.

Thanks to all who commented and for the tolerance of my too often sketchy posts. Yeah. Sketchy, go with that one.

joe a.

_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to