diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-05-09 13:11:34 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-05-09 13:19:48 +0300 |
commit | ac04b91746a9192b6492fa43fe56200a8c21c65c (patch) | |
tree | be0989cac2f8eb0d643488f55bef67fd35ecb1c8 /include/mailutils/sys | |
parent | 0256b723be3917f3fd608900fe758065e6166555 (diff) | |
download | mailutils-ac04b91746a9192b6492fa43fe56200a8c21c65c.tar.gz mailutils-ac04b91746a9192b6492fa43fe56200a8c21c65c.tar.bz2 |
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.
Diffstat (limited to 'include/mailutils/sys')
-rw-r--r-- | include/mailutils/sys/smtp.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/mailutils/sys/smtp.h b/include/mailutils/sys/smtp.h index f9b01b801..82b566cb3 100644 --- a/include/mailutils/sys/smtp.h +++ b/include/mailutils/sys/smtp.h @@ -57,6 +57,7 @@ struct _mu_smtp /* User-supplied data */ char *param[MU_SMTP_MAX_PARAM]; + mu_url_t url; mu_list_t authmech; /* List of allowed authentication mechs */ mu_secret_t secret; |