Re: mutt/2017: mutt_addr_is_user() "null address is assumed to be the user" (Re: your mail)
* Mon Aug 1 2005 Thomas Roessler <roessler@xxxxxxxxxxxxxxxxxx>
> The rationale here is that mutt, when used without use_from, won't
> write From: headers to Fccs.
Thanks for the information!
Hmm, I think we can use another way to work around it
than the hack in mutt_addr_is_user().
For example, replace mutt_addr_is_user(env->from) with
a new function env_is_from_me(env), which checks for
RECEIVED headers in env->userhdrs at first, and returns
mutt_addr_is_user(env->from) next.
| env_is_from_me (ENVELOPE *env) {
| LIST *tmp;
| if (!env->from) {
| for (tmp = env->userhdrs; tmp; tmp = tmp->next) {
| if (ascii_strncasecmp ("Received:", tmp->data, 9) == 0)
| return 0; /* through servers, but no FROM hdr */
| }
| return 1; /* FCC with $use_from unset */
| }
| return (mutt_addr_is_user (env->from);
| }
Otherwise, just another config variable $fcc_assume_fromme?
Anyway, this is not a serious bug at all.
It would be OK for me if you just said "it's feature." :)
> > >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.
--
tamo