Improve authentication interface in SMTP client.
* include/mailutils/smtp.h (MU_SMTP_PARAM_URL): New parameter code. * include/mailutils/sys/smtp.h (_MU_SMTP_CLNPASS): New flag. (_mu_smtp) <secret>: New member. * libproto/mailer/smtp_auth.c (get_ticket) (_mu_smtp_fixup_params): New static functions. (mu_smtp_auth): Call _mu_smtp_fixup_params to supply missing pararameters. * libproto/mailer/smtp_create.c (mu_smtp_destroy): Destroy secret. Take care to erase eventual plaintext representation of the password. * libproto/mailer/smtp_gsasl.c (_smtp_callback): Use mu_smtp_get_param to obtain parameters. * libproto/mailer/smtp_param.c (mu_smtp_set_param): Setting MU_SMTP_PARAM_PASSWORD updates secret. param[MU_SMTP_PARAM_PASSWORD] points (temporarly and on request only) to plaintext password. (mu_smtp_get_param): Likewise for retrieving password. * testsuite/smtpsend.c (main): New parameter url=.
Showing
7 changed files
with
176 additions
and
27 deletions
-
Please register or sign in to post a comment