]> git.madduck.net Git - etc/mailfilter.git/blob - procmail/normalise

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

do not purge duplicates but discard them
[etc/mailfilter.git] / procmail / normalise
1 # add hostname if missing, but only if ORIGINAL_TO is not empty
2 :0
3 * ORIGINAL_TO ?? .
4 * ! ORIGINAL_TO ?? @
5 { ORIGINAL_TO="$ORIGINAL_TO@$HOSTNAME" }
6
7 # rewrite local admin mail to admin.madduck.net domain
8 :0
9 *$ ORIGINAL_TO ?? .+@$HOSTNAME$
10 *$ ^Delivered-To: $LOGNAME\+admin@$HOSTNAME$
11 { ORIGINAL_TO="`echo $ORIGINAL_TO | tr @ =`@admin.madduck.net" }
12
13 # transform root@ to proper localpart
14 # http://marc.info/?t=118495181500014&r=1&w=2
15 :0
16 * ORIGINAL_TO ?? ^root=\/[^@]+
17 *$ ^Delivered-To: \/.+@$MATCH$
18 { ORIGINAL_TO="`echo $MATCH | tr @ =`@admin.madduck.net" }
19
20 # vim:ft=procmail