<<< Date Index >>>     <<< Thread Index >>>

feature request: pattern submatch in hooks



Hello,

All my mailing list subscriptions are from an extension'ed address:

        <login>+lists-<listname>@domain.tld

It eases list filtering at the procmail level but raises an issue when
replying to mailing lists as they require the From: to contain the exact
subscription address (even though the extension after the + shouldn't be
considered part of the address per se).

The obvious solution is to write as many send-hooks as subscribed
mailing lists:

        send-hook '~Cmutt-dev@xxxxxxxx' \
                "my_hdr From: vindex+lists-mutt-dev@xxxxxxxxxxx"

However the most elegant way would be to have regex submatch support in
mutt:

        send-hook '~l && ~t(.*)@' \
                "my_hdr From: vindex+lists-${SUBMATCH1}@apartia.org"

Or:

        message-hook '~hX-Original-To: vindex+lists-([^@]+)@apartia.org' \
                "my_hdr From: vindex+lists-${SUBMATCH1}@apartia.org"

Should I attempt to make a patch for this or is someone already working
on it?

Thanks,

-- 
ldm@xxxxxxxxxx