Running a script with cyradm throwing ReadLine errors

ellie timoney ellie at
Mon Dec 17 17:57:59 EST 2018

Hi Binarus,

> Could anybody please tell me what I might do wrong here?

This kind of smells like maybe your system has two versions of perl installed (or two versions of Term::ReadLine, or maybe even two versions of Cyrus::IMAP::Shell), and they're getting in each other's way?

I'm having a quick glance at the (2.5.10) source of Cyrus::IMAP::Shell and this caught my eye:

> # ugh.  ugh.  suck.  aieee.
> my $use_rl = 'Cyrus::IMAP::DummyReadline';
> {
>   if (eval { require Term::ReadLine; }) {
>     $use_rl = 'Term::ReadLine';
>   }
> }

Which... fills me with confidence.  Looks like a workaround for missing (broken?) Term::Readline but that comment isn't super enlightening.  I wonder if it will Just Work if you uninstall Term::Readline?

I haven't really used cyradm at all myself, so take all this with a grain of salt.  Hopefully someone who has can chime in!



On Sun, Dec 16, 2018, at 8:04 PM, Binarus wrote:
> Dear all,
> I was just trying to explore cyradm a little bit further and hence was 
> experimenting with its scripting capabilities. Having cyradm run a 
> script should be pretty easy. man cyradm tells us:
>   perl -MCyrus::IMAP::Shell -e 'run("myscript")'
> So I created the simplest possible script (that means an empty one) and 
> tried to run it:
>   touch 000
>   chmod a+x 000 (just in case ...)
>   perl -MCyrus::IMAP::Shell -e 'run("000")'
> The only thing I got was:
>   Use of uninitialized value within @layers in string eq at /usr/local/
> lib/x86_64-linux-gnu/perl/5.24.1/Term/ReadLine/ line 280.
>   Bad filehandle: __DATA__ at /usr/local/lib/x86_64-linux-gnu/perl/
> 5.24.1/Term/ReadLine/ line 769.
> Putting something meaningful into the script did not change the situation.
> I have googled and read documentation (mainly on for 
> several hours, but could not find the reason for the problem.
> I even have put allowplaintext=yes into imapd.conf and restarted imapd 
> (knowing that this probably wasn't very smart, but the term "layers" in 
> the error message made me mistrustful because there are authentication 
> "layers", and I don't have any problems with Term::ReadLine::Gnu in 
> general). As expected, this didn't change the situation either.
> This happened with 2.4.16 as well as with 2.5.10.
> Could anybody please tell me what I might do wrong here?
> Thank you very much in advance,
> Binarus
> ----
> Cyrus Home Page:
> List Archives/Info:
> To Unsubscribe:

More information about the Info-cyrus mailing list