If we are using -check, post(8) will need to talk to a remote SMTP server,
and it might need to perform authentication when doing so. So include a
-credentials option if there is the appropriate line in the user's profile.
vec[vecp++] = "-library";
vec[vecp++] = getcpy (m_maildir (""));
vec[vecp++] = "-library";
vec[vecp++] = getcpy (m_maildir (""));
+ if ((cp = context_find ("credentials"))) {
+ /* post doesn't read context so need to pass credentials. */
+ vec[vecp++] = "-credentials";
+ vec[vecp++] = cp;
+ }
+
/* Don't need to feed fileproc or mhlproc to post because
it doesn't use them when used for whom. */
/* Don't need to feed fileproc or mhlproc to post because
it doesn't use them when used for whom. */