Re: How to match a string like '+447537170394 <[email protected]>' in a send hook?
Chris Green <[email protected]>
| Newsgroups | gmane.mail.mutt.user |
|---|---|
| Message-ID | <ZvPv0xZHRabrZ0yp@q957> |
On Wed, Sep 25, 2024 at 11:23:41AM +0100, Chris Green wrote: > On Wed, Sep 25, 2024 at 10:30:33AM +0200, Francesco Ariis wrote: > > Hello Chris, > > > > Il 25 settembre 2024 alle 08:50 Chris Green ha scritto: > > > I want to match the following string in a To: address for a send-hook:- > > > > > > +447537170394 <[email protected]> > > > > > > The + and < and > have special meanings (I think) in an RE, is there a > > > simple way to tell send-hook that this is just a string with no > > > special meanings at all or am I going to have to escape all the > > > specials? If I do need to escape them all what do I actually need to > > > put? Is it just:- > > > > > > '\+447537170394 \<sms\@aa\.net\.uk\>' > > > > > > ... just tried the above, it doesn't match. So there must be more to > > > it. > > > > I am sure there is a proper solution, but meanwhile wouldn’t it be > > good enough to just match 447537170394? > > Maybe in your case it uniquely identifies your recipient > > OP here. I think I have found a much more basic problem, I don't > think a send-hook can change the To: address. > > So, next question (which replaces the first one), how can I change a > To: header dependent on the contents of the To: header? > > What I am trying to do is to change the destination address when I get > messages from addresses like '+447537170394 <[email protected]>' because > messages back to that address disappear into a black hole. > To clarify, whhen I get an E-Mail with a From: header like:- From: +447537170394 <[email protected]> I want replies (i.e. the To: header) to go to:- To: Fred Bloggs <[email protected]> I can't seem to get mutt to do this for me, I'm sure it must be possible and, probably, quite easy. -- Chris Green