Author Topic: managesieve/sieverules fails on "vacation"  (Read 16009 times)

Offline kondybas

  • Jr. Member
  • **
  • Posts: 36
managesieve/sieverules fails on "vacation"
« on: May 31, 2010, 01:51:34 PM »
User's sieve contains next:
Code: [Select]
require ["vacation"];
# rule:[Autoreply]
if anyof (true)
{
        vacation :days 1 "Nobody home";
}


When I've send message to user, dovecot sieve logs such strings:
Code: [Select]
May 31 20:28:15 abox73 dovecot: deliver(kondybas@abox73.home.lan): sieve: mail from test@abox73.home.lan: discarded vacation reply to <>
May 31 20:28:15 abox73 dovecot: deliver(kondybas@abox73.home.lan): sieve: mail from test@abox73.home.lan: stored mail into mailbox 'INBOX'

No matter is managesieve or sieverules plugin used - result is the same:
... discarded vacation reply to <>

I'm sure that this behaviour caused NOT by RC and/or plugins, but rather dovecot/sieve itself. But I've spent a week tryin' to localize the cause  - with no result.

If anybody have any suggestions about that - please let me know.

Thanks beforehand!

Offline dziobak

  • Full Member
  • ***
  • Posts: 184
managesieve/sieverules fails on "vacation"
« Reply #1 on: May 31, 2010, 02:45:17 PM »
you must specify your address which will be used to answer vacation...

Offline kondybas

  • Jr. Member
  • **
  • Posts: 36
managesieve/sieverules fails on "vacation"
« Reply #2 on: May 31, 2010, 03:06:36 PM »
Quote from: dziobak;27781
you must specify your address which will be used to answer vacation...

I've change sieve like this:

Code: [Select]
require [&quot;vacation&quot;];
# rule:[Autoreply]
if anyof (true)
{
        vacation
                :days 7
                :addresses [&quot;kondybas@abox73.home.lan&quot;]
                :subject &quot;Nobody home&quot;
                &quot;At all&quot;;
}


and get the same message. Seems that sieve can't determine recipient for an autoreply, not a sender...

Offline dziobak

  • Full Member
  • ***
  • Posts: 184
managesieve/sieverules fails on "vacation"
« Reply #3 on: May 31, 2010, 03:27:41 PM »
what imap server are you using?

Offline kondybas

  • Jr. Member
  • **
  • Posts: 36
managesieve/sieverules fails on "vacation"
« Reply #4 on: May 31, 2010, 03:46:01 PM »
Quote from: dziobak;27783
what imap server are you using?


I've use exim/dovecot and with your advice about addresses I've just realize what happens!

Dovecot sieve use envelope addresses for autoreply, not ones mentioned in the headers...

When I've change exim's transport config from
dovecot_lda:
 driver = pipe
 command = /usr/local/libexec/dovecot/deliver -d $local_part@$domain

to
dovecot_lda:
 driver = pipe
 command = /usr/local/libexec/dovecot/deliver -d $local_part@$domain -f $sender_address

everything become to work!

Offline cyc

  • Newbie
  • *
  • Posts: 5
managesieve/sieverules fails on "vacation"
« Reply #5 on: August 20, 2010, 02:22:43 PM »
Hi there,

I also have a problem with managesieve plugin. My setup is Postfix + Cyrus 2.2 + MySQL + Web-cyradm + Roundcube 2.4 (on Ubuntu 10.04 LTS). My problem is that the system does not send the vacation e-mail, but I don't think I have a Sieve problem, because Web-cyradm has its own interface for setting vacation messages and if I use that, I do get the vacation e-mail. But users cannot use Web-cyradm, of course.

I have checked in sieveshell what actually gets in Sieve. Web-cyradm creates an entry like this one:

> get sieve
require "vacation"; vacation :days 1 :addresses ["my email"] :subject "Test" "Test (web-cyradm).";

The script managesieve creates, on the other hand, looks like this:

require ["fileinto","vacation"];
# rule:[Test]
if anyof (true)
{
        fileinto "INBOX.Test";
        vacation :days 1 "Test.";
}

For testing purposes, I have also configured moving e-mails to Test folder, to see it anything works at all. Well, the moving part works fine, but I do not get any vacation reply at all. :(

What am I missing, has anyone a clue what is wrong?
« Last Edit: August 20, 2010, 02:25:23 PM by cyc »

Offline kondybas

  • Jr. Member
  • **
  • Posts: 36
managesieve/sieverules fails on "vacation"
« Reply #6 on: August 20, 2010, 04:16:21 PM »
Quote
I also have a problem with managesieve plugin. My setup is Postfix + Cyrus 2.2 + MySQL + Web-cyradm + Roundcube 2.4 (on Ubuntu 10.04 LTS).

Current RC version is 0.4-beta, what do you mean with "Roundcube 2.4"?

Quote
My problem is that the system does not send the vacation e-mail
AFAIK "vacation" functionality relies on the "envelope-from" address, not address mentioned in the "From:" header in the message. When I've send message from exim to the dovecot deliver for LDA, I've send the "envelope-from" address apparently via option -f $sender_address.

May be your sieve engine can't define recipient for autoreply because of lack of that envelope-from address. In my case that was shown in the logs in such way:
sieve: mail from test@abox73.home.lan: discarded vacation reply to <>
Trailing angle brackets with empty content means that sieve engine has no valid address to send autoreply to.

You have to check for:
- sieve engine logs to figure out what happens during autoreply processing
- configs for apparent sending an "envelope-from" address from MTA to LDA.

Sorry, I'm not familiar enough with Postfix/Cyrus to show the right configuration, but suppose that search by words "envelope-from" and "delivery" may help you.

Quote
require "vacation"; vacation :days 1 :addresses ["my email"] :subject "Test" "Test (web-cyradm).";

The script managesieve creates, on the other hand, looks like this:

require ["fileinto","vacation"];
# rule:[Test]
if anyof (true)
{
        fileinto "INBOX.Test";
        vacation :days 1 "Test.";
}
Both sieves looks syntactically correct, except that first script only send an autoreply, when second also stores message into inbox. But that can't be a matter.
« Last Edit: August 20, 2010, 04:20:37 PM by kondybas »

Offline cyc

  • Newbie
  • *
  • Posts: 5
managesieve/sieverules fails on "vacation"
« Reply #7 on: August 20, 2010, 06:25:20 PM »
Quote from: kondybas;29544
Current RC version is 0.4-beta, what do you mean with "Roundcube 2.4"?

Ups ... :idiot: I meant 0.4 - and it is not a beta anymore. ;)

Offline kondybas

  • Jr. Member
  • **
  • Posts: 36
managesieve/sieverules fails on "vacation"
« Reply #8 on: August 20, 2010, 06:40:27 PM »
Quote from: cyc;29545
Ups ... :idiot: I meant 0.4 - and it is not a beta anymore. ;)

FreeBSD ports tree still use beta :)

One important addition.
If your problem is what I think, you already have another bug: mailbox quotas don't send messages like "User mailbox is full, try again later" or something like that. If you already step in it - you have a hint. Both problems have the same nature.

Cheers

Offline cyc

  • Newbie
  • *
  • Posts: 5
managesieve/sieverules fails on "vacation"
« Reply #9 on: August 21, 2010, 03:37:06 AM »
Quote from: kondybas;29547

If your problem is what I think, you already have another bug: mailbox quotas don't send messages like "User mailbox is full, try again later" or something like that. If you already step in it - you have a hint. Both problems have the same nature.


I remember that once I had a problem that the mail server did not send even Web-cyradmin's vacation messages - until I fixed a line in master.cf, I believe I had to add "-r ${sender}". Now I have:

cyrus     unix  -       n       n       -       -       pipe  user=cyrus argv=/usr/sbin/cyrdeliver -e -r ${sender} -m ${extension} ${user}

I will test what happens if a user mailbox is full, but what I don't understand is why the sieve script from Web-cyradm works? Could it be that in managesieve's script ":addresses ["my email"]" is missing? If both two scripts are syntactically correct the missing e-mail looks like the only important difference? By the way - that "my email" was the e-mail address of the account with the vacation setting.

Offline kondybas

  • Jr. Member
  • **
  • Posts: 36
managesieve/sieverules fails on "vacation"
« Reply #10 on: August 21, 2010, 05:48:22 AM »
Quote
why the sieve script from Web-cyradm works? Could it be that in managesieve's script ":addresses ["my email"]" is missing?

Possible reason is that web-cyradm compile sieve into binary form after creation and managesieve - doesn't.

Does any other sieve script created via managesieve works anyway? Or you stuck with vacations only?

Offline cyc

  • Newbie
  • *
  • Posts: 5
managesieve/sieverules fails on "vacation"
« Reply #11 on: August 21, 2010, 06:11:37 AM »
Quote from: kondybas;29553
Does any other sieve script created via managesieve works anyway? Or you stuck with vacations only?

I don't know if everything what can be done with sieve works, but like I mentioned filtering e-mail messages to folders works, and I've just successfully tested a filter that if conditions are met, it redirects message to another e-mail address. And the filter *was* created with managesieve.
So as far as I know, only the vacation fails ... and frankly, that is everything I'm trying to achieve here. ;)
« Last Edit: August 21, 2010, 06:24:21 AM by cyc »

Offline raphead

  • Newbie
  • *
  • Posts: 1
Re: managesieve/sieverules fails on "vacation"
« Reply #12 on: October 20, 2012, 07:18:19 AM »
Hello Cyc and others,

want to pick up this old thread because I have a similar issue.
My setup is also Cyrus + Postfix + Roundcube 0.8.2 (in my case) + MySQL.
I'm failing to get vacation messages set with filters through either managesieve or sieverules plugins.
In detail: I just don't get any vacation Mail out of my setup (I did not test other filters).
Then I saw this post and just tried to set this filter manually via the advanced filter editor:

require "vacation"; vacation :days 1 :addresses ["my email"] :subject "Test" "Test (web-cyradm).";

This worked instantly!
So my question is, how did you solve your issue? To me it looks like a filter syntax problem.
Thanks, Thomas