0

I have a central mail relay server and other 4 servers that send mail through the first one.

When I send a mail from one of the "slave" servers, the outgoing mail arrives to the destination with some references to the original server that originated it.

For example, the final email includes the relay:

Received: from mail.myserver.com (mail.myserver.com. [178.63.10.61])

But also the originating server:

Return-Path: <mywebsite@www1.myserver.com>

I'd like to hide every reference to the second one, and show only the hostname of the final relay.

I've been already able to hide some of the references using regular expressions with header_checks, but some others like the Return-path seem to be un-erasable.

flip79
  • 143
  • 8

2 Answers2

0

The Return-Path header is added by the transmitting MTA or the original generation mechanism (PHP, Java, etc) and is generally used when sendonb bounce messages.

You can set your "slave" servers to use a certain address, the first example below uses sendmail, the second uses PHP:

sendmail -t -i -f webmaster@yourdomain.com
mail($to, $subject, $message, $headers, "-faccount@domain.com");

Sources: RFC 4021, section 2.1.22 and RFC 822, section 4.3.1

Craig Watson
  • 9,370
  • 3
  • 30
  • 46
0

Apart from the solution where you add a sending address to the application code, you may also consider having postfix handle this for you. The Postfix documentation contains an overview of rewriting information at Address rewriting README, receiving.

Another, possibly easier solution, is the use of the canonical table on the mail server, which would then include a mapping like:

mywebsite@www1.myserver.com mywebsite1@myserver.com

The latter will replace every occurence of mywebsite@www1.myserver.com with mywebsite1@myserver.com in all address headers.

Vincent De Baere
  • 1,783
  • 9
  • 9
  • Thank you very much for putting me on the right way! Finally I've set smtp_generic_maps in main.cf with some simple rules that "rewrite" the domains (hostnames) of the slave servers with the one of the master one. – flip79 Mar 06 '14 at 00:50