- extract(buf, mxhosts, mx);
- lprintf(CTDL_DEBUG, "Trying <%s>\n", buf);
- sock = sock_connect(buf, "25", "tcp");
+ extract_token(buf, mxhosts, mx, '|', sizeof buf);
+ strcpy(mx_user, "");
+ strcpy(mx_pass, "");
+ if (num_tokens(buf, '@') > 1) {
+ extract_token(mx_user, buf, 0, '@', sizeof mx_user);
+ if (num_tokens(mx_user, ':') > 1) {
+ extract_token(mx_pass, mx_user, 1, ':', sizeof mx_pass);
+ remove_token(mx_user, 1, ':');
+ }
+ remove_token(buf, 0, '@');
+ }
+ extract_token(mx_host, buf, 0, ':', sizeof mx_host);
+ extract_token(mx_port, buf, 1, ':', sizeof mx_port);
+ if (!mx_port[0]) {
+ strcpy(mx_port, "25");
+ }
+ lprintf(CTDL_DEBUG, "FIXME user<%s> pass<%s> host<%s> port<%s>\n",
+ mx_user, mx_pass, mx_host, mx_port);
+ lprintf(CTDL_DEBUG, "Trying %s : %s ...\n", mx_host, mx_port);
+ sock = sock_connect(mx_host, mx_port, "tcp");