
kyle-qmail at memoryhole
Nov 29, 2009, 2:07 PM
Post #4 of 4
(1445 views)
Permalink
|
On Sunday, November 29 at 09:06 PM, quoth Steve Wilson: > The reason for wanting to do this at MTA level is so I one central > place for configuring it. I use 2 dual boot machines and a triple > boot macbook, giving 7 different MUAs that would need setting up. For what it's worth, it's relatively easy to synchronize mutt config files using something like cvs. But, you can alter stuff like that relatively easily using a wrapper around qmail-remote. For example: #!/bin/bash host="$1" sender="$2" size="$3" shift 3 recips=( "$@" ) for F in "${recips[@]}"; do if [ -f /var/qmail/redirects/"$F" ] ; then config=`cat /var/qmail/redirects/"$F"` if [ "$sender" == `echo $config | cat -d: -f1` ] ; then sender=`echo $config | cat -d: -f2` break fi fi done exec /var/qmail/bin/qmail-remote.orig "$host" "$sender" "$size" "${recips[@]}" Then, all you need to do is create the directory /var/qmail/redirects/, put the addresses that need to trigger a sender-redirect in there, and put the sender's address you want to redirect and the new the sender to be inside that file, like so: echo 'me [at] mydomai:me-qmail [at] mydomai' > \ /var/qmail/redirects/qmail [at] lists ~Kyle -- People who would give up their Freedom for security deserve neither. -- Benjamin Franklin
|