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
ac03d720
...
ac03d720bcda61952b0b2d3cf779ddbfa4f790fd
authored
2002-10-15 09:10:29 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(parse822_phrase): Allow for dots in non-quoted personal phrase.
1 parent
3cdb766c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
2 deletions
mailbox/parse822.c
mailbox/parse822.c
View file @
ac03d72
...
...
@@ -617,6 +617,33 @@ parse822_word (const char **p, const char *e, char **word)
return
EPARSE
;
}
/* rfc822 says:
The local-part of an addr-spec in a mailbox specification
(i.e., the host's name for the mailbox) is understood to be
whatever the receiving mail protocol server allows. For exam-
ple, some systems do not understand mailbox references of the
form "P. D. Q. Bach", but others do.
This specification treats periods (".") as lexical separators.
Hence, their presence in local-parts which are not quoted-
strings, is detected. However, such occurrences carry NO
semantics. That is, if a local-part has periods within it, an
address parser will divide the local-part into several tokens,
but the sequence of tokens will be treated as one uninter-
preted unit. The sequence will be re-assembled, when the
address is passed outside of the system such as to a mail pro-
tocol service.
*/
int
parse822_word_dot
(
const
char
**
p
,
const
char
*
e
,
char
**
word
)
{
int
rc
=
parse822_word
(
p
,
e
,
word
);
for
(;
rc
==
0
&&
(
*
p
!=
e
)
&&
**
p
==
'.'
;
++*
p
)
rc
=
str_append
(
word
,
"."
);
return
rc
;
}
int
parse822_phrase
(
const
char
**
p
,
const
char
*
e
,
char
**
phrase
)
{
...
...
@@ -625,14 +652,14 @@ parse822_phrase (const char **p, const char *e, char **phrase)
const
char
*
save
=
*
p
;
int
rc
;
if
((
rc
=
parse822_word
(
p
,
e
,
phrase
)))
if
((
rc
=
parse822_word
_dot
(
p
,
e
,
phrase
)))
return
rc
;
/* ok, got the 1 word, now append all the others we can */
{
char
*
word
=
0
;
while
((
rc
=
parse822_word
(
p
,
e
,
&
word
))
==
EOK
)
while
((
rc
=
parse822_word
_dot
(
p
,
e
,
&
word
))
==
EOK
)
{
rc
=
str_append_char
(
phrase
,
' '
);
...
...
Please
register
or
sign in
to post a comment