User Tools

Site Tools


exim4:remove_local_username

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
exim4:remove_local_username [2016/11/16 14:52] – [Exim4 - Remove local username] peterexim4:remove_local_username [2020/07/15 09:30] (current) – external edit 127.0.0.1
Line 10: Line 10:
 </code> </code>
  
-So I want to remove the part with root and the local hostname together(?).+You need to modify **received_header_text** as per the [[http://www.exim.org/exim-html-current/doc/html/spec_html/ch14.html|documentation]].
  
 +This string defines the contents of the "Received:" message header that is added to each message, except for the timestamp, which is automatically added on at the end, preceded by a semicolon.  The string is expanded each time it is used.
  
-You need to modify **received_header_text** as per the [[http://www.exim.org/exim-html-current/doc/html/spec_html/ch14.html|documentation]].+This can be checked by executing: 
 + 
 +<code bash> 
 +exim4 -bP received_header_text 
 +</code>
  
 It defaults to: It defaults to:
  
 <code> <code>
-received_header_text = Received: \+received_header_text = "Received: \
   ${if def:sender_rcvhost {from $sender_rcvhost\n\t}\   ${if def:sender_rcvhost {from $sender_rcvhost\n\t}\
   {${if def:sender_ident \   {${if def:sender_ident \
Line 30: Line 35:
   {(envelope-from <$sender_address>)\n\t}}\   {(envelope-from <$sender_address>)\n\t}}\
   id $message_exim_id\   id $message_exim_id\
-  ${if def:received_for {\n\tfor $received_for}}+  ${if def:received_for {\n\tfor $received_for}}"
 </code> </code>
  
Line 55: Line 60:
  
 <code> <code>
-  received_header_text = Received: \+received_header_text = "Received: \
   by $primary_hostname \   by $primary_hostname \
   ${if def:received_protocol {with $received_protocol}} \   ${if def:received_protocol {with $received_protocol}} \
Line 63: Line 68:
   {(envelope-from <$sender_address>)\n\t}}\   {(envelope-from <$sender_address>)\n\t}}\
   id $message_exim_id\   id $message_exim_id\
-  ${if def:received_for {\n\tfor $received_for}}+  ${if def:received_for {\n\tfor $received_for}}"
 </code>   </code>  
  
Line 69: Line 74:
  
 <code> <code>
-received_header_text = Received: \ +received_header_text = "Received: \ 
   ${if def:sender_fullhost {from ${sender_fullhost}\    ${if def:sender_fullhost {from ${sender_fullhost}\ 
   ${if def:sender_ident {(${sender_ident})}}}\    ${if def:sender_ident {(${sender_ident})}}}\ 
Line 78: Line 83:
   ${if def:tls_peerdn {(tls_peerdn ${tls_peerdn})}}\    ${if def:tls_peerdn {(tls_peerdn ${tls_peerdn})}}\ 
   (Exim ${version_number} #${compile_number} (Gentoo Linux 1.4))\    (Exim ${version_number} #${compile_number} (Gentoo Linux 1.4))\ 
-  id ${message_id} +  id ${message_id}"
 </code> </code>
 +
 +
 +===== Is it RFC-legal? =====
 +
 +Ignoring the fact that the use is widespread (googlemail for example) [[http://www.ietf.org/rfc/rfc2821.txt|RFC2821]] section 4.4 states:
 +
 +<WRAP box 80% center>
 +The FROM field, which MUST be supplied in an SMTP environment, SHOULD contain both (1) the name of the source host as presented in the EHLO command and (2) an address literal containing the IP address of the source, determined from the TCP connection.
 +</WRAP>
 +
 +Mail submission ([[http://www.ietf.org/rfc/rfc4409.txt|RFC4409]]) can be considered to not be "SMTP" in this context so it is not considered to violate this requirement.  However, it would be fairly simple to add in a from couplet padded with false data such as localhost or an RFC1918 address.
 +
 +Note that this only removes the location from the Recieved: header generated by the submission server - the information may also exist in other parts of the header such as Message-Id: header, it depends on the MUA involved.
 +
 +To refresh the Message-Id for submission mail, one method would be to use a system filter:
 +
 +<code>
 +if $authenticated_id is not "" then
 +  headers remove "Message-Id"
 +  headers add "Message-Id: <submit.$message_id@$primary_hostname>"
 +endif
 +</code>
 +
 ===== Alternative Approach ===== ===== Alternative Approach =====
  
Line 93: Line 121:
  
 http://www.exim.org/exim-html-current/doc/html/spec_html/ch14.html http://www.exim.org/exim-html-current/doc/html/spec_html/ch14.html
 +
 +http://hep.itp.tuwien.ac.at/cgi-bin/info2www?(exim)received_header_text
 +
exim4/remove_local_username.1479307951.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki