Re: [exim-dev] Pipe transport and 64kB limit due to wrong (?…

Etusivu
Poista viesti
Vastaa
Lähettäjä: Christoph Schulz
Päiväys:  
Vastaanottaja: Phil Pennock
Kopio: exim-dev
Aihe: Re: [exim-dev] Pipe transport and 64kB limit due to wrong (?) SIGPIPE handling
Hello!

Phil Pennock schrieb am Sun, 24 Jun 2012 03:28:12 -0700:

> Is it possible that your /usr/bin/email2system is doing something more
> than the brief description you gave?
>
> The NM/06 change only changes the signal handler in the child process,
> which becomes the process running your command, so the parent process is
> doing nothing differently.


As you say, it is the _child_ exim process executing my script, so the
change may be/is really relevant to my problem. It would be very
strange if changing the handling of SIGPIPE in the _parent_ process
influenced the execution of the script, wouldn't it?

>
> I might be wrong, but at this point I suspect that this is the invoked
> script assuming the old, broken, behaviour of Exim and breaking with the
> fixed behaviour. That's unfortunate, if true.


Hmmm, if my script assumes any broken behaviour, than by accident.

>
> If you still believe the fault lies with Exim, could we see your
> email2system script please, so we can consider next steps in tracking
> this down?


Really, there is no advanced stuff in this script. The only part
dealing with I/O is:

=== %< ===

#
# format and save incoming mail
#

EMAIL_FILE="${E2S_EMAIL_FILE_STEM}-${EMAIL_ID}"
EMAIL_FILE_RAW="${E2S_EMAIL_FILE_STEM}-${EMAIL_ID}.raw"

UMASK=`umask`
umask 0077
tee "${EMAIL_FILE_RAW}" | e2sformat > "${EMAIL_FILE}"

=== %< ===

There is a little signal handling with "trap" earlier on but this does
not do anything with the SIGPIPE signal:

=== %< ===

#
# generate unique message id
#

LOCK_ID=$$

hel-lock "${E2S_LOCK_DIR}" "${E2S_NEXT_ID_LOCK_NAME}" "${LOCK_ID}"
trap "hel-unlock \"${E2S_LOCK_DIR}\" \"${E2S_NEXT_ID_LOCK_NAME}\"
\"${LOCK_ID}\"" 0
trap "exit 1" 1 2 3 13 15

EMAIL_ID="`cat \"${E2S_NEXT_ID_FILE}\"`"
echo "`expr \"${EMAIL_ID}\" + 1`" > "${E2S_NEXT_ID_FILE}"

hel-unlock "${E2S_LOCK_DIR}" "${E2S_NEXT_ID_LOCK_NAME}" "${LOCK_ID}"
trap - 0

=== %< ===

If there is anything wrong with the script, I'm eager to hearing it.
Do I really have to explicitly change SIGPIPE handling in any shell
script that is called from within exim?


Regards,

Christoph