Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
6f45a881
...
6f45a881265bbc8945fd9e15ec691359972345fd
authored
2003-02-12 00:00:26 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(mh_is_my_name): Honor Alternate-Mailboxes variable, use wildcard matching.
1 parent
ca73d6d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
1 deletions
mh/mh_init.c
mh/mh_init.c
View file @
6f45a88
...
...
@@ -25,6 +25,7 @@
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <fnmatch.h>
char
mh_list_format
[]
=
"%4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>"
...
...
@@ -142,11 +143,49 @@ mh_get_my_name (char *name)
}
int
emailcmp
(
char
*
pattern
,
char
*
name
)
{
char
*
p
;
p
=
strchr
(
pattern
,
'@'
);
if
(
p
)
for
(
p
++
;
*
p
;
p
++
)
*
p
=
toupper
(
*
p
);
return
fnmatch
(
pattern
,
name
,
0
);
}
int
mh_is_my_name
(
char
*
name
)
{
char
*
pname
,
*
p
;
int
rc
=
0
;
pname
=
strdup
(
name
);
p
=
strchr
(
pname
,
'@'
);
if
(
p
)
for
(
p
++
;
*
p
;
p
++
)
*
p
=
toupper
(
*
p
);
if
(
!
my_email
)
mh_get_my_name
(
NULL
);
return
strcasecmp
(
name
,
my_email
)
==
0
;
if
(
emailcmp
(
my_email
,
pname
)
==
0
)
rc
=
1
;
else
{
char
*
nlist
=
mh_global_profile_get
(
"Alternate-Mailboxes"
,
NULL
);
if
(
nlist
)
{
char
*
p
,
*
sp
;
p
=
strtok_r
(
nlist
,
","
,
&
sp
);
do
rc
=
emailcmp
(
p
,
pname
)
==
0
;
while
(
rc
==
0
&&
(
p
=
strtok_r
(
NULL
,
","
,
&
sp
)));
}
}
free
(
pname
);
return
rc
;
}
char
*
...
...
Please
register
or
sign in
to post a comment