Dear all,

we have the following situation:

Our SMTP server is run by a provider, but we have our own internal IMAP server 
(Cyrus imapd of course, version 3.2.6). We use fetchmail to pull new messages 
from the provider into our internal systems and to deliver them via cyrdeliver 
to Cyrus imapd.

Since fetchmail does not provide serious filtering, we use sieve scripts to 
process incoming messages. Now we would like to use sieve to copy a message for 
user A to user B without the need to re-send it via SMTP.

I have put a day or so into trying to make this work, but to no avail. So I'd 
like to know whether it is possible at all, and if yes, how to achieve it.

Some details:

fetchmailrc:

poll server.provider.com
proto pop3
user "user_A"
mda "/usr/sbin/cyrdeliver user_A"
....

poll server.provider.com
proto pop3
user "user_B"
mda "/usr/sbin/cyrdeliver user_B"
....

So there are POP3 accounts for users A and B at the provider. fetchmail pulls 
messages for user A from there and delivers them to user A's mailbox in Cyrus 
imapd, using cyrdeliver as MDA. The same goes for user B.

User A's mailbox has a sieve script attached that sorts certain incoming 
messages into folders; this works so far. Now we would like to extend the 
script so that messages to user A are put into user B's mailbox (INBOX or 
subfolder thereof) *in addition*, provided they originated from a certain 
sender. More generally, we would like to duplicate certain incoming messages 
for a certain user to another user's mailbox *on the same imapd server 
instance*.

We would like to do that without setting up a local SMTP server for delivery to Cyrus 
imapd, and without the messages in question leaving our internal systems again. As far as 
I have understood, the "redirect" action in sieve, with or without the :copy 
modifier, will make a message being sent via SMTP to the intended recipient; therefore it 
is not an option here.

We have made an extremely simple sieve test script:

if envelope :is "to" "[email protected]"
{
  fileinto "user/user_B/INBOX/folder_A";
}

Using sieveshell, we have activated that script *for user_A*. Before doing so, 
we have

- created "folder_A" in user B's INBOX;
- granted user A all IMAP permissions to user B's mailbox (recursively).

I now would have expected that all messages that are delivered to user A get filed into 
user B's mailbox; to be precise, into folder "folder_A" in user B's INBOX. But 
this is not the case. All incoming messages for user A still arrive in user A's INBOX.

This leads to some questions:

- I am quite sure that sieve in the Cyrus package can be used to duplicate 
messages *into public* IMAP folders. At least, I have seen quite a few examples 
on the net which make that impression. However, I don't know whether sieve can 
be used to duplicate messages into *another user's mailbox*. Does anybody know 
whether that is possible?

- If it is possible, what would be the correct syntax to set another user's mailbox as destination 
in a "fileinto" statement? (You may have noticed that the personal namespace on our 
server is "user" and that we have opted for the alternate hierarchy separator (/)).

I also have tried "fileinto "other/user_B/INBOX/folder_A"" (that is, other/ instead of user/ 
because the namespace for "other users" on our server is "other" and I thought that sieve might 
expect folder and mailbox names in the same form as MUAs do), but that didn't change anything.

Best regards, and thank you very much in advance,

Binarus

------------------------------------------
Cyrus: Info
Permalink: 
https://cyrus.topicbox.com/groups/info/Tcc7e409b06bc9bfd-M5d8d997a0dd590efce09aac5
Delivery options: https://cyrus.topicbox.com/groups/info/subscription

Reply via email to