sendmail: work around (bogus) gcc warning
This commit is contained in:
parent
63e49fa56f
commit
8d07560eef
@ -255,7 +255,8 @@ static void pop3_message(const char *filename)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char *parse_url(char *url, char **user, char **pass)
|
// NB: parse_url can modify url[] (despite const), but only if '@' is there
|
||||||
|
static const char *parse_url(const char *url, const char **user, const char **pass)
|
||||||
{
|
{
|
||||||
// parse [user[:pass]@]host
|
// parse [user[:pass]@]host
|
||||||
// return host
|
// return host
|
||||||
@ -284,8 +285,8 @@ int sendgetmail_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
{
|
{
|
||||||
llist_t *opt_attachments = NULL;
|
llist_t *opt_attachments = NULL;
|
||||||
char *opt_from;
|
char *opt_from;
|
||||||
char *opt_user;
|
const char *opt_user;
|
||||||
char *opt_pass;
|
const char *opt_pass;
|
||||||
enum {
|
enum {
|
||||||
OPT_w = 1 << 0, // network timeout
|
OPT_w = 1 << 0, // network timeout
|
||||||
OPT_H = 1 << 1, // [user:password@]server[:port]
|
OPT_H = 1 << 1, // [user:password@]server[:port]
|
||||||
@ -344,7 +345,7 @@ int sendgetmail_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
// fetch username and password, if any
|
// fetch username and password, if any
|
||||||
// NB: parse_url modifies opt_connect[] ONLY if '@' is there.
|
// NB: parse_url modifies opt_connect[] ONLY if '@' is there.
|
||||||
// Thus "127.0.0.1" won't be modified, an is ok that it is RO.
|
// Thus "127.0.0.1" won't be modified, an is ok that it is RO.
|
||||||
opt_connect = parse_url((char*)opt_connect, &opt_user, &opt_pass);
|
opt_connect = parse_url(opt_connect, &opt_user, &opt_pass);
|
||||||
// bb_error_msg("H[%s] U[%s] P[%s]", opt_connect, opt_user, opt_pass);
|
// bb_error_msg("H[%s] U[%s] P[%s]", opt_connect, opt_user, opt_pass);
|
||||||
|
|
||||||
// username must be defined!
|
// username must be defined!
|
||||||
@ -405,7 +406,7 @@ int sendgetmail_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
// set sender
|
// set sender
|
||||||
// NOTE: if password has not been specified
|
// NOTE: if password has not been specified
|
||||||
// then no authentication is possible
|
// then no authentication is possible
|
||||||
code = (opt_pass) ? -1 : 250;
|
code = (opt_pass ? -1 : 250);
|
||||||
// first try softly without authentication
|
// first try softly without authentication
|
||||||
while (250 != smtp_checkp("MAIL FROM:<%s>", opt_from, code)) {
|
while (250 != smtp_checkp("MAIL FROM:<%s>", opt_from, code)) {
|
||||||
// MAIL FROM failed -> authentication needed
|
// MAIL FROM failed -> authentication needed
|
||||||
|
Loading…
x
Reference in New Issue
Block a user