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
8b81f4eb
...
8b81f4eb3bde48207ee76c6696d0630910856ffb
authored
2003-08-21 16:22:34 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(scan_addrs): Added support for aliases
1 parent
9ba6ef46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
6 deletions
mh/mh_whom.c
mh/mh_whom.c
View file @
8b81f4e
...
...
@@ -53,23 +53,84 @@ ismydomain (char *p)
static
void
scan_addrs
(
char
*
str
,
int
isbcc
)
{
address_t
addr
;
address_t
addr
=
NULL
,
exaddr
=
NULL
;
size_t
i
,
count
;
if
(
address_create
(
&
addr
,
str
))
size_t
argc
;
char
**
argv
;
char
*
buf
;
int
rc
;
if
(
!
str
)
return
;
argcv_get
(
str
,
","
,
NULL
,
&
argc
,
&
argv
);
for
(
i
=
0
;
i
<
argc
;)
{
if
(
i
+
1
==
argc
)
{
if
(
mh_alias_get_address
(
argv
[
i
],
&
exaddr
)
==
0
)
{
free
(
argv
[
i
]);
memcpy
(
&
argv
[
i
],
&
argv
[
i
+
1
],
(
argc
-
i
+
1
)
*
sizeof
(
argv
[
0
]));
argc
--
;
}
else
i
++
;
}
else
if
(
argv
[
i
+
1
][
0
]
==
','
)
{
if
(
mh_alias_get_address
(
argv
[
i
],
&
exaddr
)
==
0
)
{
free
(
argv
[
i
]);
free
(
argv
[
i
+
1
]);
memcpy
(
&
argv
[
i
],
&
argv
[
i
+
2
],
(
argc
-
i
)
*
sizeof
(
argv
[
0
]));
argc
-=
2
;
}
else
i
+=
2
;
}
else
{
for
(;
i
<
argc
;
i
++
)
if
(
argv
[
i
][
0
]
==
','
)
{
i
++
;
break
;
}
}
}
if
(
argc
)
{
int
status
;
argcv_string
(
argc
,
argv
,
&
buf
);
if
(
status
=
address_create
(
&
addr
,
buf
))
mh_error
(
_
(
"Bad address `%s': %s"
),
buf
,
mu_strerror
(
status
));
free
(
buf
);
}
argcv_free
(
argc
,
argv
);
address_union
(
&
addr
,
exaddr
);
address_destroy
(
&
exaddr
);
if
(
addr
==
NULL
||
address_get_count
(
addr
,
&
count
))
return
;
address_get_count
(
addr
,
&
count
);
for
(
i
=
1
;
i
<=
count
;
i
++
)
{
char
*
buf
,
*
p
;
int
rc
;
char
*
p
;
rc
=
address_aget_email
(
addr
,
i
,
&
buf
);
if
(
rc
)
{
mh_error
(
"address_aget_email: %s"
,
mu_strerror
(
rc
));
continue
;
}
p
=
strchr
(
buf
,
'@'
);
if
(
ismydomain
(
p
))
addrcp
(
&
local_rcp
,
buf
,
isbcc
);
else
...
...
@@ -146,6 +207,7 @@ mh_whom (char *filename, int check)
int
rc
=
0
;
mh_context_t
*
ctx
;
mh_read_aliases
();
ctx
=
mh_context_create
(
filename
,
1
);
if
(
mh_context_read
(
ctx
))
{
...
...
Please
register
or
sign in
to post a comment