I still cannot work this out. I already changed the local deliver to dovecots LDA and use SIEVE filters. The sieve filter works fine for other rules but not for this one which I need. I think there is something really important what I miss. I need to do this:
My users are whit mydomain.com:
user1@mydomain.com
user2@mydomain.com
External users are with externaldomain.com
user1@externaldomain.com
user2@externaldomain.com
With sieve filter I use the next script:
Quote:
# 2012-8-27
#
require "fileinto";
if header :contains ["from"] "user1@mydomain.com" {
fileinto "outbox-all";
}
|
As far as
user1@mydomain.com sends email to (for example)
user2@mydomain.com the SIEVE filter works.
But when
user1@mydomain.com sends email to an external user
user1@externaldomain.com it doesn't work.
I am trying to get over this problem long time and I tested procmail, maildrop, dovecots LDA. It looks like that all those delivery agents (procmail, maildrop, dovecot-lda) are working only if the email is processed as local-users email.
This means when the SMTP receives a message it decides weather the message is for a local-email-user or the message is forwarded to another SMTP server.
In this last case the MDA filters just doesn't work. I can see now that it is exactly how it should work. But it is possible to get this work some other way??
The problem is that the sent email is placed directly into a sent box by mail-user-agent and so it is not handled by the mail-delivery-agent again.