Hello, I was testing the extprograms plugin. I think I had it working in the past, but many things have changed since then, so no use trying to figure out where it broke - starting over again... Debug-enabled log give me: Apr 27 04:11:36 mail dovecot: lmtp(test at example.com): Debug: qOGyA0DePHVaOyHEM/SpMA: sieve: action execute: running program: test.sh Apr 27 04:11:36 mail dovecot: lmtp(test at example.com): Debug: waiting for program `/usr/local/etc/dovecot/sieve_globals/test.sh' to finish after 0 seconds So I guess it thinks it is running my script? But simple test script does nothing. Here it is: #!/bin/sh read INPUT INPUT="Hello world: $INPUT" echo "$INPUT" >> /tmp/hello echo "---------------------------" >> /tmp/hello Permissions on this script file for now are rwxrwxrwx But nothing goes to /tmp/hello at all. Script works when I run it manually. I also tried without the "read" but I think that's required isn't it? Anyway, what else can I do to debug this? Dovecot 2.2.16 Pigeonhole 0.4.7
On 4/27/2015 10:47 AM, E.B. wrote:> Hello, I was testing the extprograms plugin. I think I had it working > in the past, but many things have changed since then, so no use > trying to figure out where it broke - starting over again... > > Debug-enabled log give me: > Apr 27 04:11:36 mail dovecot: lmtp(test at example.com): Debug: > qOGyA0DePHVaOyHEM/SpMA: sieve: action execute: running > program: test.sh > Apr 27 04:11:36 mail dovecot: lmtp(test at example.com): Debug: > waiting for program `/usr/local/etc/dovecot/sieve_globals/test.sh' > to finish after 0 seconds > > So I guess it thinks it is running my script? But simple test script > does nothing. Here it is: > > #!/bin/sh > read INPUT > INPUT="Hello world: $INPUT" > echo "$INPUT" >> /tmp/hello > echo "---------------------------" >> /tmp/hello > > Permissions on this script file for now are rwxrwxrwx > But nothing goes to /tmp/hello at all. Script works when I run it > manually. I also tried without the "read" but I think that's required > isn't it? Anyway, what else can I do to debug this?It works here. What exactly is your config (output from `dovecot -n`)? What does the Sieve script that calls this script look like? Regards, Stephan.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mon, 27 Apr 2015, E.B. wrote:> Debug-enabled log give me: > Apr 27 04:11:36 mail dovecot: lmtp(test at example.com): Debug: > qOGyA0DePHVaOyHEM/SpMA: sieve: action execute: running > program: test.sh > Apr 27 04:11:36 mail dovecot: lmtp(test at example.com): Debug: > waiting for program `/usr/local/etc/dovecot/sieve_globals/test.sh' > to finish after 0 seconds > > So I guess it thinks it is running my script? But simple test script > does nothing. Here it is: > > #!/bin/sh > read INPUT > INPUT="Hello world: $INPUT" > echo "$INPUT" >> /tmp/hello > echo "---------------------------" >> /tmp/hello > > Permissions on this script file for now are rwxrwxrwx > But nothing goes to /tmp/hello at all. Script works when I run it > manually. I also tried without the "read" but I think that's required > isn't it? Anyway, what else can I do to debug this?Well, first try with a script that cannot fail (well most likely), e.g.: #!/bin/sh ( id date set ) >>/tmp/test.$$.log 2>&1 Note the /tmp/test.$$.log, so it will create a new file (hopefully) each time it runs, in order to bypass permission problems, if the file exists already. - -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEVAwUBVT4Ds3z1H7kL/d9rAQIuKgf+J5lnE+6DHNZQYz4nA4Kt+xQI3ul0Gf9/ cdHUeyVfpYtPbSUheHalzlXMgnIulHNHs4FBuRpbWoTVG184Vy6ZVFXRUJSNRRyG wLZhYqVFyTa3zRpoxq1fdxbmdyPtq5dKzO8+lGeDAtiNZdi1cGVWfG1wYEbRQkUp cS7l9FiDba7DvwL6LjQZxGkUNsveyq6ZKitOsveSmWugUphfw0ko+84Y0yVI/5d6 QtslPOj7C4Ag5TFg+5UoQ3GSwOBaTY+kYzF58y4XNatpUWiKtOCbGv3P7FbEgfzl Xle6e6a6Wqg+7/3D11sy+1R9CQUIJjLA1dgC6E8Lgi5cdvyNqJdWRQ==HO71 -----END PGP SIGNATURE-----
> > Debug-enabled log give me: > > Apr 27 04:11:36 mail dovecot: lmtp(test at example.com): Debug: > > qOGyA0DePHVaOyHEM/SpMA: sieve: action execute: running > > program: test.sh > > Apr 27 04:11:36 mail dovecot: lmtp(test at example.com): Debug: > > waiting for program `/usr/local/etc/dovecot/sieve_globals/test.sh' > > to finish after 0 seconds > > > > So I guess it thinks it is running my script? But simple test script > > does nothing. Here it is: > > > > #!/bin/sh > > read INPUT > > INPUT="Hello world: $INPUT" > > echo "$INPUT" >> /tmp/hello > > echo "---------------------------" >> /tmp/hello > > > > Permissions on this script file for now are rwxrwxrwx > > But nothing goes to /tmp/hello at all. Script works when I run it > > manually. I also tried without the "read" but I think that's required > > isn't it? Anyway, what else can I do to debug this? > > Well, first try with a script that cannot fail (well most likely), e.g.:I tried your script for fun, same result. Log showing the script was called, but no output from the script. I also deleted the script and made sure that debug log showed that sieve could not find the script. Is it chrooted or something weird? I have confirmed it is being run by calling "exit 3" and seeing in the log that "program ... terminated with non-zero exit code 3" so problem is in commands accessing the filesystem I guess. I added this: echo "HELLO WORLD" 1>&2 And log shows "Error: HELLO WORLD" So it's working but no filesystem access. Calling from sieve script with: execute :input "myinput" "test.sh"; Also tried execute "test.sh";
> Hello, I was testing the extprograms plugin. I think I had it working > in the past, but many things have changed since then, so no use > trying to figure out where it broke - starting over again... > > Debug-enabled log give me: > Apr 27 04:11:36 mail dovecot: lmtp(test at example.com): Debug: > qOGyA0DePHVaOyHEM/SpMA: sieve: action execute: running > program: test.sh > Apr 27 04:11:36 mail dovecot: lmtp(test at example.com): Debug: > waiting for program `/usr/local/etc/dovecot/sieve_globals/test.sh' > to finish after 0 seconds > > So I guess it thinks it is running my script? But simple test script > does nothing. Here it is: > > #!/bin/sh > read INPUT > INPUT="Hello world: $INPUT" > echo "$INPUT" >> /tmp/hello > echo "---------------------------" >> /tmp/hello > > Permissions on this script file for now are rwxrwxrwx > But nothing goes to /tmp/hello at all. Script works when I run it > manually. I also tried without the "read" but I think that's required > isn't it? Anyway, what else can I do to debug this?Turns out this is a problem with systemd. I have PrivateTmp=true in the dovecot.service file so anything written to /tmp goes to lala land (is it anywhere I can see outside of the dovecot process?). Problem solved.
Seemingly Similar Threads
- Sieve extprograms ?not exexuting?
- Sieve extprograms ?not exexuting?
- Failed running extprograms execute via socket - fatal recv(MSG_PEEK) failed disconnected
- Sieve extprograms ?not exexuting?
- Failed running extprograms execute via socket - fatal recv(MSG_PEEK) failed disconnected