[Dovecot] Dovecot LDA (deliver) stopped working
tomas at tuxteam.de
tomas at tuxteam.de
Fri Jan 25 19:44:08 EET 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Fri, Jan 25, 2008 at 10:03:30AM -0600, falz wrote:
> On Jan 25, 2008 9:22 AM, <tomas at tuxteam.de> wrote:
> > > Postfix people suggested placing a wrapper script for mailbox_command,
> > > which I did, and have it log to a text file, so I do know that deliver
> > > is being called.
> >
> > To get you right here: the wrapper is being called by Postfix, right?
>
> Yes, postfix calls a wrapper. The wrapper is a shell script that calls
> deliver. This is the wrapper. $LOGNAME comes from postfix, it's a
> built in variable it populates as the local username:
>
> #!/bin/sh
> DELIVER=/usr/local/libexec/dovecot/deliver
> DATE=`date`
> echo "==" >> /tmp/foo.txt
> echo $DATE >> /tmp/foo.txt
> echo $USER >> /tmp/foo.txt
> $DELIVER -d "$LOGNAME"
> echo $DATE >> /tmp/foo.txt
I'd typically do
#!/bin/sh
{
DELIVER=...
echo "=="
echo $DATE
...
} >> /tmp/foo.txt 2>&1
...so you have the redirection in one place. Plus it catches stdout and
stderr of other calls (especially the one from deliver, you are
interested in).
Maybe an "strace $DELIVER", although definitely overkill, might lead you
to the problem.
[...]
> Well, it's hard for me to tell. I know for sure that the wrapper ran,
> as I get my temp log does get the tiemstamp that's before/after
> deliver. However, I guess I dont know the best way to log the
> output/exit status of the deliver command.
As for the output, see above. The exit status is in the special shell
variable $?
[...]
> Hmm, perhaps I should somehow log the entire status of SETENV or
> something.
That would be env (/usr/bin/env)
> What I probably really need to do is figure out the
> appropriate pipes after the deliver line to find out if it's spitting
> anything back to stderr or something. This is usually.. >> 2&1 or
> something similar? Anyone have suggestions for that?
See above. I'd group everything in { ... } and do the redirection at the
end. Less to write (and less to fix when you change your mind :-)
Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFHmh/nBcgs9XrR2kYRAtpcAJ91Y43K5UtN+W7+JskD4VVa0EVsvQCfW9tm
qJCCdNitfJFnarvPUU/0shg=
=th7z
-----END PGP SIGNATURE-----
More information about the dovecot
mailing list