Re: [Mutt] #2017: mutt_addr_is_user() "null address is assumed to
#2017: mutt_addr_is_user() "null address is assumed to be the user"
---------------------------------------+------------------------------------
Reporter: ttakah@xxxxxxxxxxxxxxxxx | Owner: mutt-dev
Type: defect | Status: new
Priority: trivial | Milestone:
Component: mutt | Version: 1.5.9
Resolution: | Keywords:
---------------------------------------+------------------------------------
Old description:
> {{{
> In alias.c, mutt_addr_is_user():
> > /* NULL address is assumed to be the user. */
> > if (!addr)
> > {
> > dprint (5, (debugfile, "mail_addr_is_user: yes, NULL address\n"));
> > return 1;
> > }
>
> This causes a strange effect: A message with no headers is shown
> as sent from me, on the index menu.
>
> I'm afraid mutt_addr_is_user() is misused at almost all its
> occurences. We should not assume that env->from matches $alternates
> just because mutt_addr_is_user(env->from) returns 1.
>
> Why not return 0?
>
> >How-To-Repeat:
> Delete FROM header of a message.
> The message will be flagged as "F" with the default $to_chars and
> $index_format.
>
> >Fix:
> Simply return 0?
> But that could have side effects.
>
> }}}
New description:
{{{
In alias.c, mutt_addr_is_user():
> /* NULL address is assumed to be the user. */
> if (!addr)
> {
> dprint (5, (debugfile, "mail_addr_is_user: yes, NULL address\n"));
> return 1;
> }
This causes a strange effect: A message with no headers is shown
as sent from me, on the index menu.
I'm afraid mutt_addr_is_user() is misused at almost all its
occurences. We should not assume that env->from matches $alternates
just because mutt_addr_is_user(env->from) returns 1.
Why not return 0?
>How-To-Repeat:
Delete FROM header of a message.
The message will be flagged as "F" with the default $to_chars and
$index_format.
>Fix:
Simply return 0?
But that could have side effects.
}}}
--
Comment(by pdmef):
The same counts for some mailing lists gatewayed from mail to news and
back. Some use completely broken From: headers in usenet that end up as
messages marked to come from me in the mailing list.
--
Ticket URL: <http://dev.mutt.org/trac/ticket/2017#comment:2>
Mutt <http://www.mutt.org/>
The Mutt mail user agent