Lines 664-683
int service_main(int argc __attribute__(
Link Here
|
664 |
if (nntps == 1) cmd_starttls(1); |
664 |
if (nntps == 1) cmd_starttls(1); |
665 |
|
665 |
|
666 |
if (shutdown_file(unavail, sizeof(unavail))) { |
666 |
if (shutdown_file(unavail, sizeof(unavail))) { |
|
|
667 |
if (config_getswitch(IMAPOPT_SHOWSERVERVER)) { |
667 |
prot_printf(nntp_out, |
668 |
prot_printf(nntp_out, |
668 |
"400 %s Cyrus NNTP%s %s server unavailable, %s\r\n", |
669 |
"400 %s Cyrus NNTP%s %s server unavailable, %s\r\n", |
669 |
config_servername, config_mupdate_server ? " Murder" : "", |
670 |
config_servername, config_mupdate_server ? " Murder" : "", |
670 |
CYRUS_VERSION, unavail); |
671 |
CYRUS_VERSION, unavail); |
|
|
672 |
} |
673 |
else { |
674 |
prot_printf(nntp_out, |
675 |
"400 %s Cyrus NNTP%s server unavailable, %s\r\n", |
676 |
config_servername, config_mupdate_server ? " Murder" : "", unavail); |
677 |
} |
671 |
|
678 |
|
672 |
shut_down(0); |
679 |
shut_down(0); |
673 |
} |
680 |
} |
674 |
|
681 |
|
|
|
682 |
if (config_getswitch(IMAPOPT_SHOWSERVERVER)) { |
675 |
prot_printf(nntp_out, |
683 |
prot_printf(nntp_out, |
676 |
"%u %s Cyrus NNTP%s %s server ready, posting %s\r\n", |
684 |
"%u %s Cyrus NNTP%s %s server ready, posting %s\r\n", |
677 |
(nntp_capa & MODE_READ) ? 200 : 201, |
685 |
(nntp_capa & MODE_READ) ? 200 : 201, |
678 |
config_servername, config_mupdate_server ? " Murder" : "", |
686 |
config_servername, config_mupdate_server ? " Murder" : "", |
679 |
CYRUS_VERSION, |
687 |
CYRUS_VERSION, |
680 |
(nntp_capa & MODE_READ) ? "allowed" : "prohibited"); |
688 |
(nntp_capa & MODE_READ) ? "allowed" : "prohibited"); |
|
|
689 |
} |
690 |
else { |
691 |
prot_printf(nntp_out, |
692 |
"%u %s Cyrus NNTP%s server ready, posting %s\r\n", |
693 |
(nntp_capa & MODE_READ) ? 200 : 201, |
694 |
config_servername, config_mupdate_server ? " Murder" : "", |
695 |
(nntp_capa & MODE_READ) ? "allowed" : "prohibited"); |
696 |
} |
681 |
|
697 |
|
682 |
cmdloop(); |
698 |
cmdloop(); |
683 |
|
699 |
|
Lines 1806-1814
static void cmd_capabilities(char *keywo
Link Here
|
1806 |
|
1822 |
|
1807 |
prot_printf(nntp_out, "101 Capability list follows:\r\n"); |
1823 |
prot_printf(nntp_out, "101 Capability list follows:\r\n"); |
1808 |
prot_printf(nntp_out, "VERSION 2\r\n"); |
1824 |
prot_printf(nntp_out, "VERSION 2\r\n"); |
|
|
1825 |
if (config_getswitch(IMAPOPT_SHOWSERVERVER)) { |
1809 |
prot_printf(nntp_out, |
1826 |
prot_printf(nntp_out, |
1810 |
"IMPLEMENTATION Cyrus NNTP%s server %s\r\n", |
1827 |
"IMPLEMENTATION Cyrus NNTP%s server %s\r\n", |
1811 |
config_mupdate_server ? " Murder" : "", CYRUS_VERSION); |
1828 |
config_mupdate_server ? " Murder" : "", CYRUS_VERSION); |
|
|
1829 |
} |
1830 |
else { |
1831 |
prot_printf(nntp_out, |
1832 |
"IMPLEMENTATION Cyrus NNTP%s server\r\n", |
1833 |
config_mupdate_server ? " Murder" : ""); |
1834 |
} |
1812 |
|
1835 |
|
1813 |
/* add STARTTLS */ |
1836 |
/* add STARTTLS */ |
1814 |
if (tls_enabled() && !nntp_starttls_done && !nntp_authstate) |
1837 |
if (tls_enabled() && !nntp_starttls_done && !nntp_authstate) |
Lines 2664-2675
static void cmd_mode(char *arg)
Link Here
|
2664 |
lcase(arg); |
2687 |
lcase(arg); |
2665 |
|
2688 |
|
2666 |
if (!strcmp(arg, "reader")) { |
2689 |
if (!strcmp(arg, "reader")) { |
|
|
2690 |
if (config_getswitch(IMAPOPT_SHOWSERVERVER)) { |
2667 |
prot_printf(nntp_out, |
2691 |
prot_printf(nntp_out, |
2668 |
"%u %s Cyrus NNTP%s %s server ready, posting %s\r\n", |
2692 |
"%u %s Cyrus NNTP%s %s server ready, posting %s\r\n", |
2669 |
(nntp_capa & MODE_READ) ? 200 : 201, |
2693 |
(nntp_capa & MODE_READ) ? 200 : 201, |
2670 |
config_servername, config_mupdate_server ? " Murder" : "", |
2694 |
config_servername, config_mupdate_server ? " Murder" : "", |
2671 |
CYRUS_VERSION, |
2695 |
CYRUS_VERSION, |
2672 |
(nntp_capa & MODE_READ) ? "allowed" : "prohibited"); |
2696 |
(nntp_capa & MODE_READ) ? "allowed" : "prohibited"); |
|
|
2697 |
} |
2698 |
else { |
2699 |
prot_printf(nntp_out, |
2700 |
"%u %s Cyrus NNTP%s server ready, posting %s\r\n", |
2701 |
(nntp_capa & MODE_READ) ? 200 : 201, |
2702 |
config_servername, config_mupdate_server ? " Murder" : "", |
2703 |
(nntp_capa & MODE_READ) ? "allowed" : "prohibited"); |
2704 |
} |
2673 |
} |
2705 |
} |
2674 |
else if (!strcmp(arg, "stream")) { |
2706 |
else if (!strcmp(arg, "stream")) { |
2675 |
if (nntp_capa & MODE_FEED) { |
2707 |
if (nntp_capa & MODE_FEED) { |