Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Qmail: users

Simple Message rewrite

 

 

Qmail users RSS feed   Index | Next | Previous | View Threaded


qmail at swsystem

Nov 28, 2009, 3:32 PM

Post #1 of 4 (1539 views)
Permalink
Simple Message rewrite

Is anyone aware of a filter I can use within qmail to rewrite the
sender, both in the message and the env.

I'm subscribed to several mailing lists similar to this one. Like
several people I know with their own domains I use addresses specific to
the mailing list, qmail@ for here. I'd rather not be setting up multiple
email accounts everywhere I check mail.

Short of writing my own to do things I'd like something I can check the
destination address, and if the sender address matches change it to the
list specific address, preferably with control file based config.

Regards

Steve.


search-web-for-address at pyropus

Nov 28, 2009, 7:18 PM

Post #2 of 4 (1448 views)
Permalink
Re: Simple Message rewrite [In reply to]

Steve Wilson <qmail [at] swsystem> wrote:
> Is anyone aware of a filter I can use within qmail to rewrite the
> sender, both in the message and the env.
[...]
> Short of writing my own to do things I'd like something I can check the
> destination address, and if the sender address matches change it to the
> list specific address, preferably with control file based config.

You needn't necessarily do it at the MTA level. Many MUAs have the ability to
set the sender address based on the recipient address. GUI MUAs frequently
call it "profile selection" or something. mutt lets you do it very easily; I
use mutt for this.

Charles
--
--------------------------------------------------------------------------
Charles Cazabon
GPL'ed software available at: http://pyropus.ca/software/
Read http://pyropus.ca/personal/writings/12-steps-to-qmail-list-bliss.html
--------------------------------------------------------------------------


qmail at swsystem

Nov 29, 2009, 1:06 PM

Post #3 of 4 (1445 views)
Permalink
Re: Simple Message rewrite [In reply to]

Charles Cazabon wrote:
> Steve Wilson <qmail [at] swsystem> wrote:
>> Is anyone aware of a filter I can use within qmail to rewrite the
>> sender, both in the message and the env.
> [...]
>> Short of writing my own to do things I'd like something I can check the
>> destination address, and if the sender address matches change it to the
>> list specific address, preferably with control file based config.
>
> You needn't necessarily do it at the MTA level. Many MUAs have the ability to
> set the sender address based on the recipient address. GUI MUAs frequently
> call it "profile selection" or something. mutt lets you do it very easily; I
> use mutt for this.
>
> Charles

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.

Steve.


kyle-qmail at memoryhole

Nov 29, 2009, 2:07 PM

Post #4 of 4 (1445 views)
Permalink
Re: Simple Message rewrite [In reply to]

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

Qmail users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.