Discussion:
archiving rules
Nerijus Baliunas
2014-12-23 13:11:32 UTC
Permalink
Hello,

I have Non Spam Actions = %rules-dir%/archive-nonspam.rules
and archive-nonspam.rules is:

To: *@domain.lt deliver header "X-Spam-Status: No" forward ***@backup.domain.lt
From: *@domain.lt deliver header "X-Spam-Status: No" forward ***@backup.domain.lt
FromOrTo: default deliver header "X-Spam-Status: No"

Messages are archived correctly. The problem is, when the message is sent like this:
To: ***@externaldomain.lt
Cc: ***@domain.lt

The message is sent to both ***@backup.domain.lt and ***@backup.domain.lt.
Is it possible _TOUSER_ in above rule to be used only if recipient domain is local, i.e. domain.lt?

Regards,
Nerijus
--
MailScanner mailing list
***@lists.mailscanner.info
http://lists.mailscanner.info/mailman/listinfo/mailscanner

Before posting, read http://wiki.mailscanner.info/posting

Support MailScanner development - buy the book off the website!
Nerijus Baliunas
2014-12-23 14:23:22 UTC
Permalink
Is it possible TOUSER in above rule to be used only if recipient domain is local, i.e. domain.lt?
I use postfix and have in main.cf:
virtual_mailbox_domains = proxy:mysql:/etc/postfix/sql/mysql_virtual_domains_maps.cf, backup.domain.lt
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
backup_destination_recipient_limit = 1

transport:
backup.domain.lt backup:

master.cf:
dovecot unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/dovecot-lda -f ${sender} -d ${user}@${nexthop}

backup unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/dovecot-lda -f ${sender} -d ***@domain.lt -m ${user}

So all the backup email goes to ***@domain.lt mailbox and subdirs (named as
expanded _TOUSER_) are created because of -m ${user}. The problem is, that
subdirs are created even for external users, if a message is sent To: ***@externaldomain.lt
and Cc: ***@domain.lt.

Regards,
Nerijus
--
MailScanner mailing list
***@lists.mailscanner.info
http://lists.mailscanner.info/mailman/listinfo/mailscanner

Before posting, read http://wiki.mailscanner.info/posting

Support MailScanner development - buy the book off the website!
Glenn Steen
2015-01-21 08:51:10 UTC
Permalink
Problem is that MS cannot make a difference between To: and Cc: (or even
Bcc:) recipients... In the envelope (SMTP conversation) they are all RCPT
TO:... So you'd need something else to do t ge distinction... SpamAssassin
rule and the SA rule hit thing in MS should be sble to do the trick.

Cheers!
--
-- Glenn
Post by Nerijus Baliunas
Post by Nerijus Baliunas
Messages are archived correctly. The problem is, when the message is
Is it possible TOUSER in above rule to be used only if recipient domain
is local, i.e. domain.lt?
virtual_mailbox_domains = proxy:mysql:/etc/postfix/sql/
mysql_virtual_domains_maps.cf, backup.domain.lt
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
backup_destination_recipient_limit = 1
dovecot unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/dovecot-lda -f
backup unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/dovecot-lda -f
expanded _TOUSER_) are created because of -m ${user}. The problem is, that
Regards,
Nerijus
--
MailScanner mailing list
http://lists.mailscanner.info/mailman/listinfo/mailscanner
Before posting, read http://wiki.mailscanner.info/posting
Support MailScanner development - buy the book off the website!
Nerijus Baliunas
2015-01-21 22:20:56 UTC
Permalink
Post by Glenn Steen
Problem is that MS cannot make a difference between To: and Cc: (or even
Bcc:) recipients... In the envelope (SMTP conversation) they are all RCPT
TO:... So you'd need something else to do t ge distinction... SpamAssassin
rule and the SA rule hit thing in MS should be sble to do the trick.
My problem is not a difference between To or Cc, but "subdirs are created even for external users".
I don't want subdirs for external users.

Thanks,
Nerijus
Post by Glenn Steen
Post by Nerijus Baliunas
Post by Nerijus Baliunas
Messages are archived correctly. The problem is, when the message is
Is it possible TOUSER in above rule to be used only if recipient domain
is local, i.e. domain.lt?
virtual_mailbox_domains = proxy:mysql:/etc/postfix/sql/
mysql_virtual_domains_maps.cf, backup.domain.lt
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
backup_destination_recipient_limit = 1
dovecot unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/dovecot-lda -f
backup unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/dovecot-lda -f
expanded TOUSER) are created because of -m ${user}. The problem is, that
--
MailScanner mailing list
***@lists.mailscanner.info
http://lists.mailscanner.info/mailman/listinfo/mailscanner

Before posting, read http://wiki.mailscanner.info/posting

Support MailScanner development - buy the book off the website!
Continue reading on narkive:
Loading...