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
23fd0592
...
23fd0592e1bba8ad05f44d24e08b47d77314154f
authored
2007-07-16 18:16:10 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
New mtstailor variable "username"
1 parent
a581fd70
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
2 deletions
mh/send.c
mh/send.c
View file @
23fd059
...
...
@@ -303,7 +303,7 @@ read_mts_profile ()
char
*
hostname
=
NULL
;
int
rc
;
mh_context_t
*
local_profile
;
p
=
mh_expand_name
(
MHLIBDIR
,
"mtstailor"
,
0
);
mts_profile
=
mh_context_create
(
p
,
1
);
mh_context_read
(
mts_profile
);
...
...
@@ -321,7 +321,7 @@ read_mts_profile ()
}
else
if
((
rc
=
mu_get_host_name
(
&
hostname
)))
mu_error
(
_
(
"Cannot get system host name: %s"
),
mu_strerror
(
rc
));
if
((
p
=
mh_context_get_value
(
mts_profile
,
"localdomain"
,
NULL
)))
{
char
*
newdomain
;
...
...
@@ -341,6 +341,36 @@ read_mts_profile ()
exit
(
1
);
}
}
if
((
p
=
mh_context_get_value
(
mts_profile
,
"username"
,
NULL
)))
{
size_t
len
;
const
char
*
domain
;
char
*
newemail
;
int
rc
;
rc
=
mu_get_user_email_domain
(
&
domain
);
if
(
rc
)
{
mu_error
(
_
(
"Cannot get user email: %s"
),
mu_strerror
(
rc
));
exit
(
1
);
}
len
=
strlen
(
p
)
+
1
+
strlen
(
domain
)
+
1
;
newemail
=
xmalloc
(
len
);
strcpy
(
newemail
,
p
);
strcat
(
newemail
,
"@"
);
strcat
(
newemail
,
domain
);
rc
=
mu_set_user_email
(
newemail
);
if
(
rc
)
{
mu_error
(
_
(
"Cannot set user email (%s): %s"
),
newemail
,
mu_strerror
(
rc
));
exit
(
1
);
}
free
(
newemail
);
}
}
...
...
Please
register
or
sign in
to post a comment