Lines Matching full:queue
40 #include <sys/queue.h>
99 set_from(struct queue *queue, const char *osender) in set_from() argument
133 queue->sender = sender; in set_from()
157 do_alias(struct queue *queue, const char *addr) in do_alias() argument
167 if (add_recp(queue, sit->str, EXPAND_ADDR) != 0) in do_alias()
177 add_recp(struct queue *queue, const char *str, int expand) in add_recp() argument
191 it->sender = queue->sender; in add_recp()
198 LIST_FOREACH(tit, &queue->queue, next) { in add_recp()
206 LIST_INSERT_HEAD(&queue->queue, it, next); in add_recp()
215 aliased = do_alias(queue, it->addr); in add_recp()
217 aliased = do_alias(queue, "*"); in add_recp()
244 go_background(struct queue *queue) in go_background() argument
260 LIST_FOREACH(it, &queue->queue, next) { in go_background()
280 * If necessary, acquire the queue and * mail files. in go_background()
283 * to flush the queue. in go_background()
292 syslog(LOG_WARNING, "could not lock queue file"); in go_background()
297 dropspool(queue, it); in go_background()
340 syslog(LOG_ERR, "lost queue file `%s'", it->queuefn); in deliver()
376 run_queue(struct queue *queue) in run_queue() argument
380 if (LIST_EMPTY(&queue->queue)) in run_queue()
383 it = go_background(queue); in run_queue()
389 show_queue(struct queue *queue) in show_queue() argument
394 if (LIST_EMPTY(&queue->queue)) { in show_queue()
395 printf("Mail queue is empty\n"); in show_queue()
399 LIST_FOREACH(it, &queue->queue, next) { in show_queue()
426 struct queue queue; in main() local
462 bzero(&queue, sizeof(queue)); in main()
463 LIST_INIT(&queue.queue); in main()
562 errx(EX_USAGE, "sending mail and queue operations are mutually exclusive"); in main()
565 errx(EX_USAGE, "conflicting queue operations"); in main()
584 if (load_queue(&queue) < 0) in main()
585 errlog(EX_NOINPUT, "can not load queue"); in main()
586 show_queue(&queue); in main()
592 if (load_queue(&queue) < 0) in main()
593 errlog(EX_NOINPUT, "can not load queue"); in main()
594 run_queue(&queue); in main()
604 if ((sender = set_from(&queue, sender)) == NULL) in main()
607 if (newspoolf(&queue) != 0) in main()
610 setlogident("%s", queue.id); in main()
613 if (add_recp(&queue, argv[i], EXPAND_WILDCARD) != 0) in main()
617 if (LIST_EMPTY(&queue.queue) && !recp_from_header) in main()
620 if (readmail(&queue, nodot, recp_from_header) != 0) in main()
623 if (LIST_EMPTY(&queue.queue)) in main()
626 if (linkspool(&queue) != 0) in main()
634 run_queue(&queue); in main()