[Exim] Passing Environment Variables to a pipe

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Dan Egli
Fecha:  
A: exim-users
Asunto: [Exim] Passing Environment Variables to a pipe
Ok. I'm rather lost here. I hope someone can help me out. I'm running
Exim 4.10, and all seems to be working great except that I'm trying to
pass environment variables to procmail so that if a certain recipie is
processed, it has the information it needs in these variables. However,
nothing I have entered into the exim.conf seems to be making any
difference. Here's what I'm trying to do:

Three environment variables are created whenever procmail is called:

SENDER: Who is the envelope's mail from: user is ($sender_address)
EXTENSION: $local_part_suffix
RECIPIENT: $local_part$local_part_suffix@$domain

However, I wrote a wrapper script when I was having problems. The
wrapper script dumps the current environment to a file before executing
the specified commands. Here's my result file: (some lines will probably
wrap)

BASH=/bin/sh
BASH_VERSINFO=([0]="2" [1]="05a" [2]="0" [3]="1" [4]="release"
[5]="i686-pc-linux-gnu")
BASH_VERSION='2.05a.0(1)-release'
DEFAULT=/var/spool/mail/dan
DIRSTACK=()
EUID=500
GROUPS=()
HOME=/home/dan
HOST=shortcircuit.dyndns.org
HOSTNAME=shortcircuit.dyndns.org
HOSTTYPE=i686
IFS='
'
LINEBUF=2048
LOCKEXT=.lock
LOGNAME=dan
MACHTYPE=i686-pc-linux-gnu
MAILDIR=/home/dan
MSGPREFIX=msg.
OPTERR=1
OPTIND=1
ORGMAIL=/var/spool/mail/dan
OSTYPE=linux-gnu
PATH=/home/dan/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11
R6/bin
POSIXLY_CORRECT=y
PPID=30006
PROCMAIL_VERSION=3.22
PS4='+ '
PWD=/home/dan
SENDMAIL=/usr/sbin/sendmail
SENDMAILFLAGS=-oi
SHELL=/bin/bash
SHELLFLAGS=-c
SHELLMETAS='&|<>~;?*['
SHELLOPTS=braceexpand:hashall:interactive-comments:posix
SHLVL=1
TERM=dumb
UID=500
_=/bin/sh

As you can see, the three variables I mentioned are NOT listed. I don't
understand why. Here's my Procmail transport:

procmail_transport:
  driver = pipe
  command = "/usr/bin/procmail -p -d ${local_part}"
  delivery_date_add
  envelope_to_add
  no_freeze_exec_fail
  group = mail
  no_log_defer_output
  no_log_fail_output
  no_return_fail_output
  return_path_add
  umask = 0022
  environment = EXTENSION=${substr_1:local_part_suffix}:\
                RECIPIENT=$local_part$local_part_suffix@$domain


According to the spec.txt file in the exim tarball, SENDER should be
defined automatically, and adding the environment command should add the
others specified. But obviously it is not doing so. According to
spec.txt the following variables should appear in the above list:


  DOMAIN                 the domain of the address
  HOME                   the home directory, if set
  HOST                   the host name when called from a router (see
below)
  LOCAL_PART             see below
  LOCAL_PART_PREFIX      see below
  LOCAL_PART_SUFFIX      see below
  LOGNAME                see below
  MESSAGE_ID             the message's id
  PATH                   as specified by the "path" option below
  QUALIFY_DOMAIN         the sender qualification domain
  RECIPIENT              the complete recipient address
  SENDER                 the sender of the message (empty if a bounce)
  SHELL                  '/bin/sh'
  TZ                     the value of the "timezone" option, if set
  USER                   see below


Funny, I don't see any that match this. Shell for example, is not
/bin/sh but /bin/bash. I don't see a TZ, USER, MESSAGE_ID, etc...

Help???

Thanks!