- *countp = *newp = -1; /* make sure we don't enter the fetch loop */
-
- /*** This is a sort of horrible HACK because the ETRN protocol
- *** does not fit very well into the mailbox concept used in
- *** this program (IMHO). The last element of ctl->smtphunt
- *** turned out to be the host being queried (i.e., the smtp server).
- *** for that reason the rather "funny" condition in the for loop.
- *** Isn't it sort of unreasonable to add the server to the ETRN
- *** hunt list? (Concerning ETRN I'm sure! In case I want a Q-run of
- *** my SMTP-server I can always specify -Smyserver, and this is only
- *** resonable if I start sendmail without -qtime and in Q-only mode.)
- ***
- *** -- 1997-06-22 Guenther Leber
- ***/
- /* do it for all queues in the smtphunt list except the last one
- which is the SMTP-server itself */
- for (qnp = ctl->smtphunt; ( (qnp != (struct idlist *) NULL) &&
- (qnp->next != (struct idlist *) NULL) ) || (qdone == 0);
- qnp = qnp->next, qdone++)
- {
-
- /* extract name of Q */
- if ( (qnp != (struct idlist *) NULL) &&
- (qnp->next != (struct idlist *) NULL) )
- {
- /* take Q-name given in smtp hunt list */
- qname = qnp->id;
- } else {
- assert(qdone == 0);
- /*** use fully qualified host name as Q name ***/
- /* get hostname */
- if (gethostname(hname, sizeof hname) != 0)
- {
- /* exit with error message */
- error(0, errno, "gethostname failed: ");
- return PS_UNDEFINED;
- }
- /* in case we got a host basename (as we do in Linux),
- make a FQDN of it */
- hp = gethostbyname(hname);
- if (hp == (struct hostent *) NULL)
- {
- /* exit with error message */
- error(0, 0, "gethostbyname failed for %s", hname);
- return PS_TRANSIENT;
- }
- /* here it is */
- qname = hp->h_name;
- }