{
BOOL permitted = FALSE;
const uschar **argv;
-uschar buffer[64];
/* Set up "transport <name>" to be put in any error messages, and then
call the common function for creating an argument list and expanding
the items if necessary. If it fails, this function fails (error information
is in the addresses). */
-sprintf(CS buffer, "%.50s transport", tname);
if (!transport_set_up_command(argvptr, cmd, expand_arguments, expand_fail,
- addr, buffer, NULL))
+ addr, string_sprintf("%.50s transport", tname), NULL))
return FALSE;
/* Point to the set-up arguments. */
/* If allow_commands is set, see if the command is in the permitted list. */
-if (ob->allow_commands != NULL)
+if (ob->allow_commands)
{
int sep = 0;
const uschar *s;
uschar *p;
- uschar buffer[256];
if (!(s = expand_string(ob->allow_commands)))
{
return FALSE;
}
- while ((p = string_nextinlist(&s, &sep, buffer, sizeof(buffer))))
+ while ((p = string_nextinlist(&s, &sep, NULL, 0)))
if (Ustrcmp(p, argv[0]) == 0) { permitted = TRUE; break; }
}
}
}
- else if (ob->allow_commands != NULL)
+ else if (ob->allow_commands)
{
addr->transport_return = FAIL;
addr->message = string_sprintf("\"%s\" command not permitted by %s "
{
int sep = 0;
uschar *p;
- const uschar *listptr = ob->path;
- uschar buffer[1024];
+ const uschar *listptr = expand_string(ob->path);
- while ((p = string_nextinlist(&listptr, &sep, buffer, sizeof(buffer))) != NULL)
+ while ((p = string_nextinlist(&listptr, &sep, NULL, 0)))
{
struct stat statbuf;
sprintf(CS big_buffer, "%.256s/%.256s", p, argv[0]);
break;
}
}
- if (p == NULL)
+ if (!p)
{
addr->transport_return = FAIL;
addr->message = string_sprintf("\"%s\" command not found for %s transport",
uschar *envp[50];
const uschar *envlist = ob->environment;
uschar *cmd, *ss;
-uschar *eol = (ob->use_crlf)? US"\r\n" : US"\n";
+uschar *eol = ob->use_crlf ? US"\r\n" : US"\n";
transport_ctx tctx = {
tblock,
addr,
{
if (ob->force_command)
{
- /* Enables expansion of $address_pipe into seperate arguments */
+ /* Enables expansion of $address_pipe into separate arguments */
setflag(addr, af_force_command);
cmd = ob->cmd;
expand_arguments = TRUE;
and numerical the variables in existence. These are passed in
addr->pipe_expandn for use here. */
-if (expand_arguments && addr->pipe_expandn != NULL)
+if (expand_arguments && addr->pipe_expandn)
{
uschar **ss = addr->pipe_expandn;
expand_nmax = -1;
envp[envcount++] = string_sprintf("DOMAIN=%s", deliver_domain);
envp[envcount++] = string_sprintf("HOME=%#s", deliver_home);
envp[envcount++] = string_sprintf("MESSAGE_ID=%s", message_id);
-envp[envcount++] = string_sprintf("PATH=%s", ob->path);
+envp[envcount++] = string_sprintf("PATH=%s", expand_string(ob->path));
envp[envcount++] = string_sprintf("RECIPIENT=%#s%#s%#s@%#s",
deliver_localpart_prefix, deliver_localpart, deliver_localpart_suffix,
deliver_domain);
/* Now any configured suffix */
-if (ob->message_suffix != NULL)
+if (ob->message_suffix)
{
uschar *suffix = expand_string(ob->message_suffix);
- if (suffix == NULL)
+ if (!suffix)
{
addr->transport_return = search_find_defer? DEFER : PANIC;
addr->message = string_sprintf("Expansion of \"%s\" (suffix for %s "
the command that was given is a non-existent path). By default this is
treated as just another failure, but if freeze_exec_fail is set, the reaction
is to freeze the message rather than bounce the address. Exim used to signal
- this failure with EX_UNAVAILABLE, which is definined in many systems as
+ this failure with EX_UNAVAILABLE, which is defined in many systems as
#define EX_UNAVAILABLE 69
uschar *ss;
int size, ptr, i;
- /* If temp_errors is "*" all codes are temporary. Initializion checks
+ /* If temp_errors is "*" all codes are temporary. Initialization checks
that it's either "*" or a list of numbers. If not "*", scan the list of
temporary failure codes; if any match, the result is DEFER. */
{
const uschar *s = ob->temp_errors;
uschar *p;
- uschar buffer[64];
int sep = 0;
addr->transport_return = FAIL;
- while ((p = string_nextinlist(&s,&sep,buffer,sizeof(buffer))))
+ while ((p = string_nextinlist(&s,&sep,NULL,0)))
if (rc == Uatoi(p)) { addr->transport_return = DEFER; break; }
}