[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-anubis] add header[] puts headers in body
From: |
Paolo |
Subject: |
Re: [bug-anubis] add header[] puts headers in body |
Date: |
Sun, 5 Sep 2004 16:24:45 +0200 |
User-agent: |
Mutt/1.3.28i |
On Wed, Sep 01, 2004 at 01:21:20PM +0300, Sergey Poznyakoff wrote:
...
> to make mutt talk directly to anubis.
>
> See http://www.deez.info/sengelha/projects/mutt/libesmtp/ for more
> information on the patch, including downloads.
Thank you, that's a better solution indeed - and I'm gonna use it, once
I get mutt+patch compile ...
Meanwhile, pls see attached corrected patch for msg2smtp.pl:
- Mutt puts actual destinee as non opt args to 'sendmail' command, ie
$(sendmail) -- address@hidden address@hidden ...
which are discarded by current msg2smtp.pl.
So I added -M opt as 'mutt mode', ie get destinees from nonopt args only.
(I fooled myself before, as I was bouncing myself a msg with
To: myself and did not detect the problem ...)
- Mutt doesn't put a Bcc: for Bcc: destinee, hence current msg2smtp.pl
won't send to those addresses.
OTOH, if msg has a Bcc: line, current msg2smtp.pl would get that address
as well, and would send that line to others, which shouldn't happen.
Then if MTA doesn't strip off Bcc:, that'd be like a Cc:
Patch adds code to strip away Bcc: headers anyway
- Local mail may have non-fq addresses, so '@localhost' is added as default
if '@' isn't found in address.
I've been using it since a couple of days, and WFM so far.
There's quite a bit of overhead due to perl start-up on msg send, if not
already cached, so that's another good point to the native ESMTP approach.
---><---
I've stumbled on another couple issues, for 'modify' command:
1. I'm having troubles to convince 'modify body' work as I understood it.
I have a RULE section like
---BEGIN RULE---
if header[X-Domain] "[ ]*mydomain.it"
modify body :extended [".*X-Cruft:.*"]
fi
---END---
but that doesn't work:
if I write it like in the .info:
modify body ["X-Cruft:"]
I get from anubis -c:
.anubisrc:121: missing replacement value
regardless of :flag, and rc file is ignored. Well, makes sense, command
is 'modify' hence .info needs correction.
Then if I put an "" as VALUE:
modify body ["X-Cruft:"] ""
anubis -c is happy, but 'modify' does nothing - ie 'X-Cruft:' in text is
not deleted.
Then if I say it's an :re :
modify body :re [".*X-Cruft:.*"] ""
anubis -c is happy, but I get in trace file:
/.anubisrc:121: MODIFY BODY [.*X-Cruft:.*] [NULL]
and mutt/msg2smtp.pl reports err9 and nothing is sent.
After several tests, seems that there must be an \(\) enclosing _at least_
one re, ie all following work:
modify body :re [".*X-Cruft:\(.*\)"] ""
modify body :re ["\(.*\)X-Cruft:.*"] ""
modify body :re ["\(.*\)X-Cruft:\(.*\)"] ""
I think there's a bug in the [regex] parser, as '.*X-Cruft:.*' is correct.
2. Next issue: how to remove a piece from an header line? ie I'd need the
equivalent of
echo "Subject: Re: [X-Cruft] test anubis" | \
sed "s/\(.*\)\[X-Cruft\]\(.*\)/\1\2/I"
I tried eg
modify header :re [Subject] [Subject] "\(.*\)\\[brandbox.it\\]\(.*\)" "\1\2"
but got parse error (yes, according to .info that line is wrong) - I could
not find an obvious way to do that as I'd do with sed(1).
Is there a way to have Anubis do that, or is this a 'feature request'?
Thanks
-- paolo
GPG/PGP id:0x21426690 kfp:EDFB 0103 A8D8 4180 8AB5 D59E 9771 0F28 2142 6690
msg2smtp.pl.diff
Description: Text document