LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-14-2014, 10:46 PM   #1
mefox
LQ Newbie
 
Registered: Aug 2014
Posts: 1

Rep: Reputation: Disabled
Need help with Postfix canonical maps


I’m having difficulty getting the canonical_maps function to work as needed to repair some incorrect addresses from a legacy client. Here’s the situation and what I’ve tried so far:

Legacy client (oldhost.legacy.org) does not append its domain (legacy.org) to addresses in the envelope or the message when sending them via SMTP. So, if the user types an address such as “user@oldhost”, the legacy clients sends it out with SMTP as “user@oldhost” instead of “user@oldhost.legacy.org”.

A machine with postfix has a different domain (standard.org) from the legacy machine. It also acts as MX and relay for the oldhost.legacy.org domain.

When messages from the legacy client arrive at the postfix machine with addresses such as “user@oldhost” (missing .legacy.org), I’d like to rewrite those to read “user@oldhost.legacy.org” . It’s my understanding that the canonical_maps function is intended for this purpose.

In /etc/postfix/canonical.pcre I have:
/^(.*)@oldhost&/ $1@oldhost.legacy.org

If I test with: postmap –q “user@oldhost” pcre:/etc/postfix/canonical.pcre
the answer is: user@oldhost.legacy.org. Perfect.

In /etc/postfix/main.cf I have
canonical_maps = pcre:/etc/postfix/canonical.pcre

Then, on the legacy host, I send a message such as:
To: user@someotherhost.domain
Cc: user@oldhost

The message arrives at the postfix machine, but the CC line is not rewritten.

The documentation for canonical_maps says that in order for the headers to be rewritten, the client needs to either match the local_header_rewrite_clients or else the remote_header_rewrite_domain must be non-null. I tried both but neither produces the output that I need. Here's what I found:

If I set local_header_rewrite_clients = static:all or permit_mynetworks or some other option that would cause a match of the legacy client, then the append_dot_domain option takes over and rewrites the address as user@oldhost.standard.org. The canonical table is apparently ignored.

If I instead leave local_header_rewrite_clients at its default (which does not match the legacy client) and turn on remote_header_rewrite_domain = invalid.domain, then the address is rewritten as user@oldhost.invalid.domain and, once again, the canonical table is apparently ignored.

So the documentation for the canonical table is correct in that rewriting only occurs if the local_header_rewrite_clients matches the client or if remote_header_rewrite_domain is set. And the rewrites are indeed occurring. But the rewriting that takes place completely ignores the canonical table.

So how do I get Postfix to apply the append_dot_domain and append_at_myorigin only to the local and apply the canonical table to other clients or, at least apply the canonical table first?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix won't start after testing virtual domain maps and can view logs! jonizen Linux - Server 1 10-02-2011 04:21 AM
Google maps versus Nokia's OVI maps Aquarius_Girl General 8 05-30-2011 04:26 AM
[SOLVED] POSTFIX - virtual domain and alias maps results in 'unknown user' brenton.williams Linux - Server 2 08-19-2009 12:32 AM
Postfix canonical maps failure mrbubblesort Linux - Server 0 08-17-2009 02:25 AM
postfix canonical search order jittinan2 Linux - Software 1 06-18-2008 02:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration