Mailing List Archive

svn commit: rev 6643 - incubator/spamassassin/trunk/spamc
Author: mss
Date: Fri Feb 13 15:35:05 2004
New Revision: 6643

Modified:
incubator/spamassassin/trunk/spamc/spamc.c
incubator/spamassassin/trunk/spamc/spamc.pod
Log:
Cleaned up the usage a bit.


Modified: incubator/spamassassin/trunk/spamc/spamc.c
==============================================================================
--- incubator/spamassassin/trunk/spamc/spamc.c (original)
+++ incubator/spamassassin/trunk/spamc/spamc.c Fri Feb 13 15:35:05 2004
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+
#ifdef _WIN32
#include <io.h>
#include <fcntl.h>
@@ -88,34 +89,33 @@

void print_usage(void)
{
- printf("Usage: spamc [options] < message\n\n");
- printf
- ("-B: BSMTP mode - expect input to be a single SMTP-formatted message\n");
- printf
- ("-c: check only - print score/threshold and exit code set to 0 if message is not spam, 1 if spam\n");
- printf("-r: report if spam - print report for spam messages\n");
- printf("-R: report - print report for all messages\n");
- printf("-y: symbols - print only the names of the tests hit\n");
- printf("-d host: specify host to connect to [default: localhost]\n");
- printf
- ("-e command [args]: Command to output to instead of stdout. MUST BE THE LAST OPTION.\n");
- printf
- ("-f: fallback safely - in case of comms error, dump original message unchanges instead of setting exitcode\n");
- printf("-h: print this help message\n");
- printf("-p port: specify port for connection [default: 783]\n");
- printf
- ("-s size: specify max message size, any bigger and it will be returned w/out processing [default: 250k]\n");
+ printf("Usage: spamc [options] [-e command [args]] < message\n");
+ printf("Options:\n");
+ printf(" -B Assume input is a single BSMTP-formatted message.\n");
+ printf(" -c Just print the summary line and set an exit code.\n");
+ printf(" -d host Specify host to connect to.\n"
+ " [default: localhost]");
+ printf(" -e command [args] Pipe the output to the given command instead of stdout.\n"
+ " This must be the last option.\n");
+ printf(" -h Print this help message and exit.\n");
+ printf(" -H Randomize IP addresses for the looked-up hostname.\n");
+ printf(" -p port Specify port for connection to spamd.\n"
+ " [.default: 783\n");
+ printf(" -r Print full report for messages identified as spam.\n");
+ printf(" -R Print full report for all messages.\n");
+ printf(" -s size Specify maximum message size, in bytes.\n"
+ " [default: 250k]\n");
#ifdef SPAMC_SSL
- printf("-S: use SSL to talk to spamd\n");
+ printf(" -S Use SSL to talk to spamd.\n");
+#endif
+ printf(" -t timeout Timeout in seconds for communications to spamd.\n"
+ " [default: 600]\n");
+ printf(" -u username User for spamd to process this message under.\n");
+#ifndef _WIN32
+ printf(" -U path Connect to spamd via UNIX domain sockets.\n");
#endif
- printf
- ("-u username: specify the username for spamd to process this message under\n");
- printf
- ("-x: don't fallback safely - in a comms error, exit with a TEMPFAIL error code\n");
- printf
- ("-t: timeout in seconds to read from spamd. 0 disables. [default: 600]\n\n");
- printf("-H: randomize the IP addresses in the looked-up hostname\n");
- printf("-U path: use UNIX domain socket with path\n");
+ printf(" -x Don't fallback safely.\n");
+ printf(" -y Just print the names of the tests hit.\n");
}

int

Modified: incubator/spamassassin/trunk/spamc/spamc.pod
==============================================================================
--- incubator/spamassassin/trunk/spamc/spamc.pod (original)
+++ incubator/spamassassin/trunk/spamc/spamc.pod Fri Feb 13 15:35:05 2004
@@ -24,34 +24,16 @@

=item B<-c>

-Just check if the message is spam or not. Set process exitcode to 1 is
+Just check if the message is spam or not. Set process exitcode to 1 if
message is spam, 0 if not spam or processing failure occurs. Will print
score/threshold to stdout (as ints) or 0/0 if there was an error.

-=item B<-r>
-
-Just output the SpamAssassin report text to stdout, if the message
-is spam. If the message is ham (non-spam), nothing will be printed.
-The first line of the output is the number of hits and the threshold,
-in this format:
-
- hits/threshold
-
-=item B<-R>
-
-Just output the SpamAssassin report text to stdout, for all messages.
-See B<-r> for details of the output format used.
-
-=item B<-y>
-
-Just output the names of the tests hit to stdout, on one line, separated
-by commas.
-
=item B<-d> I<host>

-Connect to spamd server on given host. If I<host> resolves to multiple
-addresses, then spamc will fail-over to the other addresses, if the first one
-cannot be connected to.
+In TCP/IP mode, connect to spamd server on given host (default: localhost).
+
+If I<host> resolves to multiple addresses, then spamc will fail-over to the
+other addresses, if the first one cannot be connected to.

=item B<-e> I<command> I<[args]>

@@ -66,7 +48,7 @@

Cause spamc to safe-failover if it can't connect to spamd -- what this means
is that in case spamc fails to connect to spamd, it will not return with an
-exitcode set, it will instead dump the original message to stdout, allowing
+exitcode set but dump the original message to stdout instead. This allows
the message to be delivered, albeit unscanned for spam. Without this flag,
connection failures to spamd will cause message delivery failures.

@@ -74,38 +56,59 @@
encounters an error at a later stage of communication, it will still return
an exitcode.

-This now defaults to B<on>. This flag is accepted though for
-backwards-compatibility. B<-x> can be used to tell spamc to use an
-exit-code which will cause the message to be re-queued by the MTA instead.
+This switch is obsolete and now defaults to B<on>. This flag is accepted
+though for backwards-compatibility. B<-x> can be used to tell spamc to use
+an exit-code which will cause the message to be re-queued by the MTA instead.

=item B<-h>

Print this help message and terminate without action.

-=item B<-S>
-
-If spamc was built with support for SSL, encrypt data to and from the
-spamd process with SSL; spamd must support SSL as well.
+=item B<-H>

+For TCP/IP sockets, randomize the IP addresses returned from a DNS name
+lookup (when more than one IP is returned). This provides for a kind of
+hostname-base load balancing.

=item B<-p> I<port>

-Connect to spamd server listening on given port.
+In TCP/IP mode, connect to spamd server listening on given port
+(default: 783).
+
+=item B<-r>
+
+Just output the SpamAssassin report text to stdout, if the message
+is spam. If the message is ham (non-spam), nothing will be printed.
+The first line of the output is the number of hits and the threshold,
+in this format:
+
+ hits/threshold
+
+=item B<-R>
+
+Just output the SpamAssassin report text to stdout, for all messages.
+See B<-r> for details of the output format used.

=item B<-s> I<max_size>

Set the maximum message size which will be sent to spamd -- any bigger than
-this threshold and the message will be returned unprocessed. Note that the
-default size is 250k, so if spamc gets handed a message bigger than this, it
-won't be passed to spamd. The size is specified in bytes, and if you send it a
-negative number, things are quite likely to break very hard.
+this threshold and the message will be returned unprocessed (default: 250k).
+If spamc gets handed a message bigger than this, it won't be passed to spamd.
+
+The size is specified in bytes, and if you send it a negative number, things
+are quite likely to break very hard.
+
+=item B<-S>
+
+If spamc was built with support for SSL, encrypt data to and from the
+spamd process with SSL; spamd must support SSL as well.

=item B<-t> I<timeout>

-Set the timeout for spamc-to-spamd communications. If spamd takes longer than
-this many seconds to reply to a message, spamc will abort the connection and
-treat this as a failure to connect; in other words the message will be
-returned unprocessed.
+Set the timeout for spamc-to-spamd communications (default: 600, 0 disables).
+If spamd takes longer than this many seconds to reply to a message, spamc
+will abort the connection and treat this as a failure to connect; in other
+words the message will be returned unprocessed.

=item B<-u> I<username>

@@ -114,6 +117,11 @@
running spamc as some other user, though, (eg. root, mail, nobody, cyrus, etc.)
then you can still use this flag.

+=item B<-U> I<socketpath>
+
+Connect to C<spamd> via UNIX domain socket I<socketpath> instead of a
+TCP/IP connection.
+
=item B<-x>

Don't use the 'safe fallback' error-recovery method, which passes through the
@@ -137,16 +145,10 @@
EX_NOPERM 77 permission denied
EX_CONFIG 78 configuration error

-=item B<-U> I<socketpath>
-
-Connect to C<spamd> via UNIX domain socket I<socketpath> instead of a
-TCP/IP connection.
-
-=item B<-H>
+=item B<-y>

-For TCP/IP sockets, randomize the IP addresses returned from a DNS name
-lookup (when more than one IP is returned). This provides for a kind of
-hostname-base load balancing.
+Just output the names of the tests hit to stdout, on one line, separated
+by commas.

=back