Hi,
Is there any string "replace" functionality in maildrop? I've checked the docs
and there doesn't seem to be but I thought I'd ask here to check.
Here's what I'm trying to do...
I run qpsmtpd / qmail / vpopmail and use maildrop to deliver the mail so I can
spam filter it using bogofilter and auto-filter my mailing lists. It's the
auto-filtering I need some help with.
I have a series of pattern matches in mmy maildrop filter that identifies any
traffic from mailing lists and puts it into the appropriate folder. Something
like this:
if ( /^List-Post: <mailto:![0-9A-Za-z_\-]*!@.*!>/ \
|| /^Delivered-To: mailing list ![0-9A-Za-z_\-]*!@.*/ \
|| /^X-Mailing-List:[:space:]![0-9A-Za-z_\-]*!@.*/ \
|| /^Return-Path: <owner-![0-9A-Za-z_\-]*!@.*>/ )
{
exception {
if (${LOGGING_ENABLED})
{
log "Matched mailing list ${MATCH2}"
}
to "${VMAILDIR}/${LISTS}.${MATCH2}/"
}
}
So for example, for this list, the "List-Post: <mailto:bi...@bincimap.org>"
header would be matched and the message stored in the folder Lists.binc.
This has worked fine for many months. However, now I have got two mailing lists
with the same name at different domains. So, I've decided to use the whole of
the list address as the folder name, e.g List...@bincimap.org instead of just
Lists.binc. The problem I've just run into is that the period in the domain name
is the IMAP separater character so my mail clients see a lists folder, with a
binc@bincimap inside, then another folder "org" inside the binc@bincimap folder.
Ideally, I'd solve this without munging the list names, but if that's not
possible then I'm looking for the best way to replace "." with "_" in the
address string from maildrop as the message is being delivered.
Is there an easy way to fix this without munging the list names, e.g.
binc@bincimap_org or similar?
Thanks,
R.