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
99acbcfc
...
99acbcfc6c6f4c18704a1017e208713924df2a3a
authored
2001-10-23 22:29:29 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Determine full user email address (mail_set_my_name).
1 parent
a83c767b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
mail/alt.c
mail/alt.c
View file @
99acbcf
...
...
@@ -52,28 +52,26 @@ mail_whoami ()
return
my_name
;
}
/* FIXME: this lacks domain name part! */
void
mail_set_my_name
(
char
*
name
)
{
char
hostname
[
256
];
if
(
!
name
)
{
struct
passwd
*
pw
=
getpwuid
(
getuid
());
struct
passwd
*
pw
=
getpwuid
(
getuid
());
if
(
!
pw
)
{
util_error
(
"can't determine my username"
);
util_error
(
"can't determine my username"
);
exit
(
1
);
}
name
=
pw
->
pw_name
;
}
my_name
=
strdup
(
name
);
gethostname
(
hostname
,
sizeof
(
hostname
));
hostname
[
sizeof
(
hostname
)
-
1
]
=
0
;
my_email
=
xmalloc
(
strlen
(
name
)
+
strlen
(
hostname
)
+
2
);
sprintf
(
my_email
,
"%s@%s"
,
name
,
hostname
);
my_email
=
mu_get_user_email
(
name
);
if
(
!
my_email
)
{
util_error
(
"can't determine my email address: %s"
,
strerror
(
errno
));
exit
(
1
);
}
}
int
...
...
Please
register
or
sign in
to post a comment