| 1 | Date: Tue, 23 Nov 1999 02:49:32 +0200 |
| 2 | From: Vadim Vygonets <vadik@cs.huji.ac.il> |
| 3 | |
| 4 | This is an Exim filter snippet to change locally-generated |
| 5 | Message-Id: and Resent-Message-Id: headers to world-unique values. |
| 6 | |
| 7 | |
| 8 | # Exim filter |
| 9 | |
| 10 | # Copyright (c) 1999 |
| 11 | # Hans Matzen <hans@tm.informatik.uni-frankfurt.de>, |
| 12 | # Vadim Vygonets <vadik@vygo.net>. All rights reserved. |
| 13 | |
| 14 | ################################################################# |
| 15 | # Change locally-generated Message-Id: and Resent-Message-Id: |
| 16 | # headers to world-unique values. |
| 17 | |
| 18 | # Notes: |
| 19 | # Change every occurrence of "home.dom" to your home domain. |
| 20 | # Change every occurrence of "uniqie.remote.dom" to some unique value. |
| 21 | |
| 22 | # Unique values, as Vadik explained in his message to exim-users, |
| 23 | # can be chosen in different ways: |
| 24 | |
| 25 | ### The ideal way is to choose "hostnames" in existing domains whose |
| 26 | ### admins you know, and you will be sure that no hostname ending |
| 27 | ### with ".nonexistent.friendly.dom" will ever appear on this planet, |
| 28 | ### not even on someone else's message IDs. |
| 29 | |
| 30 | ### Another ideas include putting after your hostname things like: |
| 31 | ### .972.2.6412694.phone |
| 32 | ### .29.32.columbia.street.jerusalem.96583.israel.addr |
| 33 | ### .1122.3576.3847.1446.visa.01.2002.expiration.date.vadim.vygonets.name.credit.card |
| 34 | |
| 35 | # This snippet provides to schemes to do such rewriting. The |
| 36 | # first scheme is to have mapping from local hostnames to unique |
| 37 | # "Message-Id domains". The second scheme is to use one unique |
| 38 | # "Message-Id domain", inserting the original "domain" into the |
| 39 | # "local-part" of the new Message-Id header. |
| 40 | |
| 41 | # Precaution |
| 42 | headers remove "X-Vygo-Net-Temporary-Message-Id" |
| 43 | |
| 44 | # Change Message-Id: |
| 45 | if "${if def:h_Message-Id: {yes}}" is yes and |
| 46 | ${lc:${domain:$h_Message-Id:}} is "home.dom" or |
| 47 | ${lc:${domain:$h_Message-Id:}} ends ".home.dom" then |
| 48 | # This is if you want to have a file mapping each hostname to a unique |
| 49 | # Message-Id domain part, or, if it fails, preserves the original domain part: |
| 50 | # headers add "X-Vygo-Net-Temporary-Message-Id: <${local_part:$h_Message-Id:}@${lookup{${domain:$h_Message-Id:}}lsearch{/var/exim/msgid-hosts}{$value}{${domain:$h_Message-Id:}}}>\n" |
| 51 | # This rewrites Message-Id as <local_part.domain@unique.domain>: |
| 52 | headers add "X-Vygo-Net-Temporary-Message-Id: <${local_part:$h_Message-Id:}.${domain:$h_Message-Id:}@unique.remote.dom>\n" |
| 53 | headers remove "Message-Id" |
| 54 | headers add "Message-Id: $h_X-Vygo-Net-Temporary-Message-Id:" |
| 55 | headers remove "X-Vygo-Net-Temporary-Message-Id" |
| 56 | endif |
| 57 | |
| 58 | # Change Resent-Message-Id: |
| 59 | if "${if def:h_Resent-Message-Id: {yes}}" is yes and |
| 60 | ${lc:${domain:$h_Resent-Message-Id:}} is "home.dom" or |
| 61 | ${lc:${domain:$h_Resent-Message-Id:}} ends ".home.dom" then |
| 62 | # This is if you want to have a file mapping each hostname to a unique |
| 63 | # Message-Id domain part, or, if it fails, preserves the original domain part: |
| 64 | # headers add "X-Vygo-Net-Temporary-Message-Id: <${local_part:$h_Resent-Message-Id:}@${lookup{${domain:$h_Resent-Message-Id:}}lsearch{/var/exim/msgid-hosts}{$value}{${domain:$h_Resent-Message-Id:}}}>\n" |
| 65 | # This rewrites Message-Id as <local_part.domain@unique.domain>: |
| 66 | headers add "X-Vygo-Net-Temporary-Message-Id: <${local_part:$h_Resent-Message-Id:}.${domain:$h_Resent-Message-Id:}@unique.remote.dom>\n" |
| 67 | headers remove "Resent-Message-Id" |
| 68 | headers add "Resent-Message-Id: $h_X-Vygo-Net-Temporary-Message-Id:" |
| 69 | headers remove "X-Vygo-Net-Temporary-Message-Id" |
| 70 | endif |
| 71 | |