Fix handling of URL authentication credentials in SMTP AUTH.
Provide special functions for storing and retrieving URL from mu_smtp_t object, instead of using MU_SMTP_PARAM_URL. The major drawback of the latter is that URLs in textual form can contain obfuscated access credentials, which makes them unusable for authentication. * include/mailutils/smtp.h (mu_smtp_set_url) (mu_smtp_get_url) (mu_smtp_set_secret,mu_smtp_get_secret): New protos. * include/mailutils/sys/smtp.h (_mu_smtp) <url>: New member. * libproto/mailer/smtp_secret.c: New file. * libproto/mailer/smtp_url.c: New file. * libproto/mailer/Makefile.am (libmu_mailer_la_SOURCES): Add new files. * libproto/mailer/smtp.c (smtp_open): Use mu_smtp_set_url to preserve URL credentials. * libproto/mailer/smtp_auth.c (_mu_smtp_fixup_params): Use smtp->url. * libproto/mailer/smtp_create.c (mu_smtp_destroy): Destroy smtp->url. * libproto/mailer/smtp_param.c (mu_smtp_set_param): Special handling for MU_SMTP_PARAM_URL. (mu_smtp_get_param): Likewise.
Showing
9 changed files
with
138 additions
and
18 deletions
libproto/mailer/smtp_secret.c
0 → 100644
libproto/mailer/smtp_url.c
0 → 100644
-
Please register or sign in to post a comment