Re: [exim] Too Many Arguments

Pàgina inicial
Delete this message
Reply to this message
Autor: Ted Cooper
Data:  
A: exim-users
Assumpte: Re: [exim] Too Many Arguments
Marc Perkel wrote:
> Getting error "Too many arguments in command ...... in ${run} expansion"
>
> Just wondering what the limitations are and how to fix it. Would
> eliminating spaces reduce the number of arguments or is it the length of
> the strings?


A 5 second grep into the code sitting on your computer there shows up
the following little snippet near the only mention of the error above.

/* Get store in which to build an argument list. Count the number of
addresses
supplied, and allow for that many arguments, plus an additional 60, which
should be enough for anybody. Multiple addresses happen only when the local
delivery batch option is set. */

The code limits you to an arbitrarily chosen 60 additional command line
arguments which are stripped of all leading and trailing spaces,
unwrapped and un-escaped.

A command line argument is a single word unless multiple words are
quoted together.

There doesn't seem to be a limit on the length of strings, other than
memory. Keep in mind that /bin/sh has a limit on command line length,
but that is not the error you are getting.

An alternative to hacking the code might be to

1) Rationalise your command line arguments.
2) Use positional parameters rather than --key value pairs
3) Pass whatever you want in key="value"&key="value" pairs
4) Use a named pipe to talk to a listening daemon


I use #4 since it should be less expensive than using ${run, however
I've never quantified it. I ran into issues with ${run processes getting
killed off by something (kernel?) because too many were started too soon
when it went into production. Using ${readsocket got rid of that
limitation and allowed me to do file/database/memory locking.

--
The Exim Manual
http://www.exim.org/docs.html
http://www.exim.org/exim-html-current/doc/html/spec_html/index.html