Beispiel #1
0
int doODMR (struct query *ctl)
/* retrieve messages using ODMR */
{
    int status;

    if (ctl->keep) {
	fprintf(stderr, GT_("Option --keep is not supported with ODMR\n"));
	return(PS_SYNTAX);
    }
    if (ctl->flush) {
	fprintf(stderr, GT_("Option --flush is not supported with ODMR\n"));
	return(PS_SYNTAX);
    }
    if (ctl->mailboxes->id) {
	fprintf(stderr, GT_("Option --folder is not supported with ODMR\n"));
	return(PS_SYNTAX);
    }
    if (check_only) {
	fprintf(stderr, GT_("Option --check is not supported with ODMR\n"));
	return(PS_SYNTAX);
    }
    peek_capable = FALSE;

    status = do_protocol(ctl, &odmr);
    if (status == PS_NOMAIL)
	status = PS_SUCCESS;
    return(status);
}
Beispiel #2
0
void
netfinger(char *name)
{
	int error, multi;
	char *host;
	struct addrinfo *ai, *ai0;
	static struct addrinfo hint;

	host = strrchr(name, '@');
	if (host == 0)
		return;
	*host++ = '\0';
	signal(SIGALRM, cleanup);
	alarm(TIME_LIMIT);

	hint.ai_flags = AI_CANONNAME;
	hint.ai_family = family;
	hint.ai_socktype = SOCK_STREAM;

	error = getaddrinfo(host, "finger", &hint, &ai0);
	if (error) {
		warnx("%s: %s", host, gai_strerror(error));
		return;
	}

	multi = (ai0->ai_next) != 0;

	/* ai_canonname may not be filled in if the user specified an IP. */
	if (ai0->ai_canonname == 0)
		printf("[%s]\n", host);
	else
		printf("[%s]\n", ai0->ai_canonname);

	for (ai = ai0; ai != 0; ai = ai->ai_next) {
		if (multi)
			trying(ai);

		error = do_protocol(name, ai);
		if (!error)
			break;
	}
	alarm(0);
	freeaddrinfo(ai0);
}