[OGo-Users] Problems with multi-line vacation messages

Samuli Seppänen users@opengroupware.org
Tue, 13 Mar 2007 12:18:39 +0200


I'm having problems with vacation notices and I hope some of you would
have stumbled upon this same problem and perhaps even fixed it somehow.

The problem is that if vacation notice is over one line long, Cyrus does
not send it at all. I've already pinpointed where the problem lies: I
noticed that OGo stores vacation notices in
/var/lib/opengroupware.org/documents in file named
"$USERNAME.imap-filter" (e.g. 104040.imap-filter). These files looks
like this:

(
   {
       emails = (
           joakim.hirvi@domain.com
       );
       kind = vacation;
       repeatInterval = 1;
       subject = "I am on vacation";
       text = "Testing^M\nTesting";
   }
)

As you can see, these files have CR (^M) and LF line terminators,
instead of plain LF's as it should(?) on a Linux system. The file
utility confirms this:

[root@ogo-template documents]# file 104040.imap-filter
104040.imap-filter: ASCII text, with CR, LF line terminators

The extra CR's cause Cyrus to barf when it tries to send a vacation
notice. If I don't use any linefeed when writing the vacation message
text, Cyrus will happily send the vacation notices. Also, if I fix this
file manually (remove the CR) and then create a new filter, all will be
ok. Cyrus will send the vacation notice as it should.

As Cyrus filters are installed by "sky_install_sieve" program, I was
considering creating a wrapper for it to fix the Defaults file on the
fly and then call the actual sky_install_sieve to install the filter
using the fixed Defaults file. The problem with this approach is that
the command line parameters OGo gives to "sky_install_sieve" are rather
painful to parse with Bash/Python. I'd rather not go this route, if it's
not required. I'd rather have real-time fix, not just plain cron +
dos2unix/sed hack, which might break some user's Defaults, which is not
acceptable in a production system.

I did not find any bug reports regarding this in OGo Bugzilla, nor any
information from mailing list archives.

So is this a known problem, and is it possible to fix this somehow from
within OGo? I would rather fix the problem at the source rather than
tweak Cyrus.

Btw. is there a reason why OGo adds CR's to the vacation notice?

Samuli Seppänen