Mailing List Archive

svn commit: r169757 - /spamassassin/trunk/spamc/spamc.c /spamassassin/trunk/spamc/spamc.pod
Author: jm
Date: Wed May 11 21:28:08 2005
New Revision: 169757

URL: http://svn.apache.org/viewcvs?rev=169757&view=rev
Log:
update documentation for spamc patch, and some minor reformatting

Modified:
spamassassin/trunk/spamc/spamc.c
spamassassin/trunk/spamc/spamc.pod

Modified: spamassassin/trunk/spamc/spamc.c
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/spamc/spamc.c?rev=169757&r1=169756&r2=169757&view=diff
==============================================================================
--- spamassassin/trunk/spamc/spamc.c (original)
+++ spamassassin/trunk/spamc/spamc.c Wed May 11 21:28:08 2005
@@ -458,8 +458,10 @@
*
* returns EX_OK on success, EX_CONFIG on failure
*/
-int combine_args(char *prefix, char *config_file,
- int argc, char **argv, int *combo_argc, char **combo_argv) {
+int
+combine_args(char *prefix, char *config_file,
+ int argc, char **argv, int *combo_argc, char **combo_argv)
+{
FILE *config;
char option[100];
int i, count = 0;
@@ -696,10 +698,12 @@
}

if((combine_args(prefix, config_file, argc, argv,
- &combo_argc, combo_argv)) != EX_OK) {
+ &combo_argc, combo_argv)) != EX_OK)
+ {
/* parse only command line arguments (default behaviour) */
if((ret = read_args(argc, argv, &max_size, &username,
- &extratype, &trans)) != EX_OK) {
+ &extratype, &trans)) != EX_OK)
+ {
if(ret == EX_TEMPFAIL)
ret = EX_OK;
goto finish;
@@ -707,7 +711,8 @@
} else {
/* Parse the combined arguments of command line and config file */
if ((ret = read_args(combo_argc, combo_argv, &max_size, &username,
- &extratype, &trans)) != EX_OK) {
+ &extratype, &trans)) != EX_OK)
+ {
if (ret == EX_TEMPFAIL)
ret = EX_OK;
goto finish;

Modified: spamassassin/trunk/spamc/spamc.pod
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/spamc/spamc.pod?rev=169757&r1=169756&r2=169757&view=diff
==============================================================================
--- spamassassin/trunk/spamc/spamc.pod (original)
+++ spamassassin/trunk/spamc/spamc.pod Wed May 11 21:28:08 2005
@@ -93,6 +93,11 @@
Filter according to the other options, but set the process exitcode to 1 if
message is spam, 0 if not spam or processing failure occurs.

+=item B<-F> I</path/to/file>
+
+Specify a configuration file to read additional command-line flags from.
+See B<CONFIGURATION FILE> below.
+
=item B<-h>

Print this help message and terminate without action.
@@ -193,103 +198,24 @@

=back

-=head1 CONFIGURATION PARAMETERS
-
-=over
-
-=item B<Host>
-
-Set the hostname for the spamd daemon that spamc should connect to. This
-option, and the F<Socket> option are mutually exclusive, and only the first
-listed in the configuration file will be used.
-
-Default : C<localhost>.
-
-Valid options : server DNS name (server.tld) or IP address.
-
-=item B<Port>
-
-Set the port that the spamd daemon is running on.
-
-Default : C<783>.
-
-Valid options : an integer less than or equal to 65535
-
-=item B<Socket>
-
-Set the path to the unix domain socket to use to connect to spamd. This
-option and the F<Host> option are mutually exclusive, and only the first
-listed in the configuration file will be used.
-
-Default : don't use unix domain sockets.
-
-Valid options : /path/to/socket
-
-=item B<User>
-
-Set the user that spamc should run as.
-
-Default : user running spamc.
-
-Valid options : any user on the system
-
-=item B<Max-Size>
-
-Set the maximum message size (in bytes).
-
-Default : C<256000> bytes.
-
-Valid options : an integer size for the message in bytes
-
-=item B<UseSSL>
+=head1 CONFIGURATION FILE

-Turn on or off whether to use SSL when connecting to spamd.
+The above command-line switches can also be loaded from a configuration
+file.

-Default : C<off>.
-
-Valid options : C<yes> / C<on> or C<no> / C<off>
-
-=item B<Timeout>
-
-Set the timeout (in seconds) for connecting to spamd.
-
-Default : C<600>.
-
-Valid options : an integer
-
-=item B<BSMTP>
-
-Assume input is a single BSMTP formatted message.
-
-Default : C<off>.
-
-Valid options : C<yes> / C<on> or C<no> / C<off>
-
-=item B<Fallback>
-
-Turn on or off safe fallback.
-
-Default : C<on>
-
-Valid options : C<yes> / C<on> or C<no> / C<off>
-
-=item B<Randomize>
-
-Turn on or off whether to randomize IP addresses for looked-up hostname.
-
-Default : C<off>
-
-Valid options : C<yes> / C<on> or C<no> / C<off>
-
-=item B<LogSTDERR>
-
-Log errors and warnings to stderr.
-
-Default : C<off>
-
-Valid options : C<yes> / C<on> or C<no> / C<off>
-
-=back
+The format of the file is similar to the SpamAssassin rules files; blank lines
+and lines beginning with C<#> are ignored. Any space-separated words are
+considered additions to the command line, and are prepended. Existing command
+line switches will override any settings in the configuration file.
+
+If the B<-F> switch is specified, that file will be used. Otherwise,
+C<spamc> will attempt to load defaults as follows.
+
+If the installation prefix begins with C</usr>,
+C</etc/mail/spamassassin/spamc.conf> will be attempted. If it begins with
+C</opt>, C</etc/opt/mail/spamassassin/spamc.conf> will be attempted. If those
+don't exist, C</etc/spamc.conf> will be appended to the prefix and tried. If
+none of those exist, no configuration file will be read by default.

=head1 EXIT CODES