Remove local headers on debian wheezy for outgoing mail

debian-wheezyexim

I have clean installation of debian wheezy. I need to remove following headers:

Received: from www-data by %SERVERNAME% with local (Exim 4.80)

Related answers did not help, because i just can't find where to configure this:

I tried to execute /usr/sbin/exim4 -bP received_header_text, and it shows current received_header_text variable value. But where i can set it up?

I tried to see in /etc/exim4, but grep -r "received_header_text" has given no results.
Where should i change received_header_text variable value?

Best Answer

Doing a recursive grep for the option was a good idea. The configuration files in /etc/exim4 are where you should make the change you want. As to why your grep didn't find it, many exim options have a hard-coded default value. The option was not set in the Debian config files because the Debian authors didn't need to change it from the default.

The ultimate solution was in the answer you linked, but these links show the syntax of the change:

  1. http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_run_time_configuration_file.html#SECTcos
  2. http://www.exim.org/exim-html-current/doc/html/spec_html/ch-main_configuration.html

On Squeeze, at least, this would go in /etc/exim4/conf.d/main/02_exim4-config_options: received_header_text = blah blah ... or hide received_header_text = blah blah ... if you don't want non-root local users to be able to see what you did.

But the Debian-ized breakouts of the files don't really matter to exim; they're just for administrator convenience. Debian builds a single large config file from all of these individual files each time you start or restart exim or manually run update-exim4.conf. So after you make your changes, don't forget to restart exim (to regenerate the config file).