Sieve vacation script?

2015-12-26 Thread Patrick Goetz via Info-cyrus
I've been struggling with figuring out how to set up a sieve vacation 
reply script.  The documentation on this is pretty sparse, and the stuff 
I do find doesn't work.  For example,


[cyrus@www ~]$ sieveshell --user=resea...@episcopalarchives.org 
--authname=cyrus localhost

connecting to localhost
unable to connect to server at /usr/bin/sieveshell line 191.
[cyrus@www ~]$ sieveshell --user=resea...@episcopalarchives.org 
--authname=cyrus episcopalarchives.org

connecting to episcopalarchives.org
unable to connect to server at /usr/bin/sieveshell line 191.

I'm also not sure what the point is of sieveshell is if I'm running it 
on the mail server and not remotely; similarly for timsieved.


First question:  is there step by step explanation for manually creating 
and invoking a cyrus sieve script for a particular user?


Second question:  Ancient unix/linux users will recall a simple vacation 
program that any user could run to throw up or take down an automated 
vacation reply.  The age of sieve has made this process considerably 
more complicated, but I would like to write (or obtain) a script that 
performs a similar function for cyrus sieve; i.e. the user runs vacation 
and it automatically sets up an automated vacation reply message. 
Anyone have something like this already?


I've been beating my head against google for many hours at this point 
looking for information on how this all works, particularly with cyrus 
and haven't found anything.




Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


sieve vacation script problem

2002-09-27 Thread Vittorio Manfredini


I use :
cyrus-imapd 2.1.9
cyrus-sasl 2.1.7
postfix 1.1.11

All work fine, but now I would use sieve vacation script.

I put the vacation script on the user directory (/usr/sieve/.../user),

When I send mail to this user, the mail arrive correctly, but when the system
try to send back the vacation message I have some strange behaviour.

I include part of the log file and the vacation message.

Log:
Sep 25 11:25:17 host postfix/qmgr[1290]: EBE1455F1: from=<[EMAIL PROTECTED]>,
size=1414, nrcpt=1 (queue active)
Sep 25 11:25:17 host postfix/pipe[11891]: BB5B155EB: to=<[EMAIL PROTECTED]>,
relay=vscan, delay=3, status=sent (host.dotalia.com)
Sep 25 11:25:19 host postfix/pickup[11870]: 06A6455EE: uid=96 from=<>
Sep 25 11:25:19 host postfix/cleanup[11883]: 06A6455EE:
message-id=
Sep 25 11:25:19 host postfix/qmgr[1290]: 06A6455EE: from=<>, size=469, nrcpt=1
(queue active)
Sep 25 11:25:19 host postfix/pipe[11902]: EBE1455F1: to=<[EMAIL PROTECTED]>,
relay=cyrus, delay=3, status=sent (host.domain.com)
Sep 25 11:25:20 host amavis[11910]: starting.  amavis 0.3.12pre5 Mon Mar 25
21:00:43 UTC 2002
Sep 25 11:25:20 host postfix/smtpd[11896]: connect from localhost[127.0.0.1]
Sep 25 11:25:20 host postfix/smtpd[11896]: B754555F2: client=localhost[127.0.0.1]
Sep 25 11:25:20 host postfix/cleanup[11883]: B754555F2:
message-id=
Sep 25 11:25:20 host postfix/smtpd[11896]: disconnect from localhost[127.0.0.1]
Sep 25 11:25:20 host amavis[11910]: do_exit:899 - ending execution with 0
Sep 25 11:25:20 host postfix/qmgr[1290]: B754555F2: from=<>, size=698, nrcpt=1
(queue active)
Sep 25 11:25:20 host postfix/pipe[11891]: 06A6455EE:
to=<[EMAIL PROTECTED]>, relay=vscan, delay=2, status=sent
(host.domain.com)
Sep 25 11:25:21 host postfix/smtp[11913]: B754555F2:
to=<[EMAIL PROTECTED]>, relay=none, delay=1, status=bounced
(Name service error for name=unspecified-domain.domain.com type=A: Host not found)

vacation script
# Mail rules for user lcorini
# Created by Websieve version 0.61h
require ["fileinto","vacation"];


vacation :days 1 :addresses ["[EMAIL PROTECTED]"] text:
Autogenerated Message:
On vacation for the next week



Re: Sieve vacation script?

2015-12-26 Thread Sebastian Hagedorn via Info-cyrus

Hi,


I've been struggling with figuring out how to set up a sieve vacation
reply script.  The documentation on this is pretty sparse, and the stuff
I do find doesn't work.  For example,

[cyrus@www ~]$ sieveshell --user=resea...@episcopalarchives.org
--authname=cyrus localhost
connecting to localhost
unable to connect to server at /usr/bin/sieveshell line 191.
[cyrus@www ~]$ sieveshell --user=resea...@episcopalarchives.org
--authname=cyrus episcopalarchives.org
connecting to episcopalarchives.org
unable to connect to server at /usr/bin/sieveshell line 191.


first of all you have to add lines to /etc/cyrus.conf to make the server 
listen to the right ports:


At least in our /etc/services file, "sieve" is still port 2000 even though 
that's been superseded by RFC 5804. We listen on both ports:


 sieve cmd="timsieved" listen="cyrus.rrz.uni-koeln.de:sieve" 
prefork=0
 managesieve   cmd="timsieved" listen="cyrus.rrz.uni-koeln.de:4190" 
prefork=0



I'm also not sure what the point is of sieveshell is if I'm running it on
the mail server and not remotely; similarly for timsieved.


You can run sieveshell on any computer you like. Just make sure the port 
mentioned above are reachable.



First question:  is there step by step explanation for manually creating
and invoking a cyrus sieve script for a particular user?


Not really. I prefer to use a GUI. We offer Smartsieve to our clients:



There's also an Add-On for Thunderbird:


--
Sebastian Hagedorn - Weyertal 121, Zimmer 2.02
Regionales Rechenzentrum (RRZK)
Universität zu Köln / Cologne University - Tel. +49-221-470-89578

pgpcMwNkJNLSS.pgp
Description: PGP signature

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Sieve vacation script?

2015-12-27 Thread Shawn Bakhtiar via Info-cyrus

> On Dec 26, 2015, at 1:14 PM, Sebastian Hagedorn via Info-cyrus 
>  wrote:
> 
> Hi,
> 
>> I've been struggling with figuring out how to set up a sieve vacation
>> reply script.  The documentation on this is pretty sparse, and the stuff
>> I do find doesn't work.  For example,
>> 
>> [cyrus@www ~]$ sieveshell --user=resea...@episcopalarchives.org
>> --authname=cyrus localhost
>> connecting to localhost
>> unable to connect to server at /usr/bin/sieveshell line 191.
>> [cyrus@www ~]$ sieveshell --user=resea...@episcopalarchives.org
>> --authname=cyrus episcopalarchives.org
>> connecting to episcopalarchives.org
>> unable to connect to server at /usr/bin/sieveshell line 191.
> 
> first of all you have to add lines to /etc/cyrus.conf to make the server 
> listen to the right ports:
> 
> At least in our /etc/services file, "sieve" is still port 2000 even though 
> that's been superseded by RFC 5804. We listen on both ports:
> 
> sieve cmd="timsieved" listen="cyrus.rrz.uni-koeln.de:sieve" prefork=0
> managesieve   cmd="timsieved" listen="cyrus.rrz.uni-koeln.de:4190" prefork=0
> 
>> I'm also not sure what the point is of sieveshell is if I'm running it on
>> the mail server and not remotely; similarly for timsieved.
> 
> You can run sieveshell on any computer you like. Just make sure the port 
> mentioned above are reachable.
> 
>> First question:  is there step by step explanation for manually creating
>> and invoking a cyrus sieve script for a particular user?
> 
> Not really. I prefer to use a GUI. We offer Smartsieve to our clients:
> 
I would agree… most users will not be tech savvy enough to create sieve 
scripts. We provide RoundCube webmail, with a manage sieve plugging where users 
can manage their filters (including vacation).

If you install it on the IMAP server itself, you simply need to have the 
service running as mentioned above. If you have it running on a separate 
server, make sure to check your firewall rules to allow the remote RoundCube 
(as a client) to connect to the local timseived service.

> 
> 
> There's also an Add-On for Thunderbird:
> 
> 
> --
> Sebastian Hagedorn - Weyertal 121, Zimmer 2.02
> Regionales Rechenzentrum (RRZK)
> Universität zu Köln / Cologne University - Tel. +49-221-470-89578
> Cyrus Home Page: http://www.cyrusimap.org/
> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
> To Unsubscribe:
> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Sieve vacation script?

2016-01-21 Thread Leena Heino via Info-cyrus

On Sat, 26 Dec 2015, Patrick Goetz via Info-cyrus wrote:

I've been struggling with figuring out how to set up a sieve vacation reply 
script.  The documentation on this is pretty sparse, and the stuff I do find 
doesn't work.  For example,


I have a script that kind of does that. We needed in our organization a 
script that would convert old $HOME/.vacation.msg files to sieve script. 
The script would then install and activate the script on the mail server 
using the mail server admin rights.


The script uses Cyrus::SIEVE::managesieve and blocks of code borrowed from 
sieveshell.


Attached is a perl script that install two files to server: common.script 
and vacation.script. The common.script is just a script that includes 
vacation.script and ingo.script among others.


First question:  is there step by step explanation for manually creating and 
invoking a cyrus sieve script for a particular user?


I think there is no documentation to do it, but all the bits are there in 
sieveshell code.


--
  Leena Heino  University of Tampere / Computer Centre
  ( liinu at uta.fi )  ( http://www.uta.fi/laitokset/tkk )#!/usr/bin/perl

use Cyrus::SIEVE::managesieve;

my $rc = 0;
my $commonrc = 0;
my $horderc = 0;
my $vacationrc = 0;
my $realm = "";
my $server = "";
my $user = "";
my $authz = "";
my $pass = "";

$realm = "";
$server = "imapserver.example.com";
$user = "exampleuser";
$authz = "cyrusadm";
$pass = "adminpassword";

sub prompt {
my($type, $prompt) = @_ ;

if (($type eq "username") && (defined $user)) {
return $user;
} elsif (($type eq "authname") && (defined $authz)) {
return $authz;
} elsif (($type eq "realm") && (defined $realm)) {
return $realm;
}

if (($type eq "password") && (defined $pass)) {
return $pass;
} elsif ($type eq "password") {
my $ostty;
my $str = "";
chomp($ostty = `stty -g`);

system "stty -echo -icanon min 1 time 0 2>/dev/null || " .
   "stty -echo cbreak";
$str = "\n";

print "$prompt: ";

$b = ;
chop($b);

print $str;
system "stty $ostty";

return $b;
}
}

sub list_cb {

my($name, $isactive) = @_ ;

print "$name ";
if ($isactive == 1) {
  print " <- active script\n";
} else {
  print "\n";
}
}

my $obj = sieve_get_handle($server, "prompt", "prompt", "prompt", "prompt");

if (!defined $obj) {
die "unable to connect to server";
}

$rc = sieve_activate($obj, "");
if ($rc != 0) {
my $errstr = sieve_get_error($obj);
$errstr = "unknown error" if(!defined($errstr));
#print "deactivate failed: $errstr\n";
}

$rc = sieve_delete($obj, "common");
if ($rc != 0) {
my $errstr = sieve_get_error($obj);
$errstr = "unknown error" if(!defined($errstr));
#print "delete failed: $errstr\n";
}

$rc = sieve_put_file($obj, 
"/tmp/cyrus_sieve.181426.21062.tmpdir/common.script");
if ($rc != 0) {
my $errstr = sieve_get_error($obj);
$errstr = "unknown error" if(!defined($errstr));
print "upload failed: $errstr\n";
}
$commonrc += $rc;

$rc = sieve_activate($obj, "common");
if ($rc != 0) {
my $errstr = sieve_get_error($obj);
$errstr = "unknown error" if(!defined($errstr));
print "activate failed: $errstr\n";
}
$commonrc += $rc;

$rc = sieve_delete($obj, "vacation");
if ($rc != 0) {
my $errstr = sieve_get_error($obj);
$errstr = "unknown error" if(!defined($errstr));
#print "delete failed: $errstr\n";
}

$rc = sieve_put_file($obj, 
"/tmp/cyrus_sieve.181426.21062.tmpdir/vacation.script");
if ($rc != 0) {
my $errstr = sieve_get_error($obj);
$errstr = "unknown error" if(!defined($errstr));
print "upload failed: $errstr\n";
}
$vacationrc += $rc;

my $listrc = sieve_list($obj, "list_cb");
if ($listrc != 0) {
my $errstr = sieve_get_error($obj);
$errstr = "unknown error" if(!defined($errstr));
print "list failed: $errstr\n";
}

$scriptrc = $commonrc + $horderc + $vacationrc;
exit $scriptrc;

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: sieve vacation script problem

2002-09-27 Thread Scott Russell

On Fri, Sep 27, 2002 at 11:19:54AM +0200, Vittorio Manfredini wrote:
> 
> I use :
> cyrus-imapd 2.1.9
> cyrus-sasl 2.1.7
> postfix 1.1.11
> 
> All work fine, but now I would use sieve vacation script.
> 
> I put the vacation script on the user directory (/usr/sieve/.../user),
> 
> When I send mail to this user, the mail arrive correctly, but when the system
> try to send back the vacation message I have some strange behaviour.
> 

In your /etc/imapd.conf try setting the postmaster value. See man
imapd.conf for info on postmaster.

-- 
  Scott Russell ([EMAIL PROTECTED])
  Linux Technology Center, System Admin, RHCE.
  Dial 877-735-8200 then ask for 919-543-9289 (TTY)




Re: sieve vacation script problem

2002-09-27 Thread Vittorio Manfredini

I put it :
postmaster: user 
or
postmaster: user@domain

but now the system is not more trying to send the back the answer.




Citazione Scott Russell <[EMAIL PROTECTED]>:

> On Fri, Sep 27, 2002 at 11:19:54AM +0200, Vittorio Manfredini wrote:
> >
> > I use :
> > cyrus-imapd 2.1.9
> > cyrus-sasl 2.1.7
> > postfix 1.1.11
> >
> > All work fine, but now I would use sieve vacation script.
> >
> > I put the vacation script on the user directory (/usr/sieve/.../user),
> >
> > When I send mail to this user, the mail arrive correctly, but when the
> system
> > try to send back the vacation message I have some strange behaviour.
> >
> 
> In your /etc/imapd.conf try setting the postmaster value. See man
> imapd.conf for info on postmaster.
> 
> --
>   Scott Russell ([EMAIL PROTECTED])
>   Linux Technology Center, System Admin, RHCE.
>   Dial 877-735-8200 then ask for 919-543-9289 (TTY)


-- 
Vittorio Manfredini
Technical Manager
Vitsoft S.r.l.
Via platone 15/F
20096 Pioltello (MI) Italy

-



Re: sieve vacation script problem

2002-09-27 Thread Wernig Markus

On Fri, 2002-09-27 at 21:42, Vittorio Manfredini wrote:
> I put it :
> postmaster: user 
> or
> postmaster: user@domain
> 
> but now the system is not more trying to send the back the answer.

Ciao Vittorio

As far as I understand it, you really should set this to 
"postmaster: postmaster", as this is the address you would want replies
to. Just think of another filter or vacation software on the other end
replying to the sender, thus creating a potential infinite loop.
The "postmaster" alias is used by sieve as From: header for _rejected_
mails. The _vacation_ replies are headed by "From: ". (AFAIR)

So I would look into /var/log/mail (if that is the mail.* syslog target)
for MTA messages concerning the outgoing mail, as this looks like a MTA
problem to me. You might want to turn up the MTA debug level if
necessary.

hth /m