Reply from address with +

Chuck Martin unicorn+mutt at sdf.org
Fri Jun 25 22:41:33 UTC 2021


On Fri, Jun 25, 2021 at 03:49:15PM -0400, Josef 'Jeff' Sipek wrote:
> I see in the docs that alternates takes regular expressions.  So, is the
> best way something like:
>
>       set from="jeffpc at ..."
>       set reverse_name=yes
>       set use_from=yes
>
>       alternates jeffpc(\+[^@]+)?@... jsipek(same regexp)@...
>
> In other words, do I have to (1) add my preferred address to alternates, and
> (2) change every one of my half a dozen alternates to include a +<anystring>
> match?
>
> This seems convoluted, which is why I'm asking if I missed a better way.

I don't think there's another way.  That's the way I do it, anyway, but
I don't bother with the [^@], using .* instead.  I also have the whole
thing in double quotes, and the backslashes are doubled for some reason.
I don't remember why I had to do that, but it is probably necessary, or
it wouldn't work for me (the doubled backslashes, I mean).  I also begin
the regex with a ^ and end it with a $.  That would mean, applying the
differences I have to your example:

    alternates "^jeffpc(\\+.*)?@...$"

with your domain replacing the "...".  If you have the same username at
multiple domains, you might be able to include all of the domains in
the same regex as well.  I do, and then I have another regex for another
username at another domain.

Unfortunately, this doesn't work if your address isn't in the list of
recipients (like a mailing list or a bcc).  In those cases, you still
have to manually edit it.

HTH

Chuck


More information about the Mutt-users mailing list