Sieve Rule on domain

Hello,
I want to implement some sieve rules on domain basis.
The attribute for that is mailDomainSieveRuleSource but when i put a simple sieve rule in it, it does not work!
The same rule in mailSieveRuleSource in user entry work fine.
What have i missed?
The rule is:
#RULE: $Name="Test" $Order=1 $Type="DEFAULT_TYPE" require ["fileinto"]; #BEGINFILTER if allof ( header :matches ["From","Sender","Resent-from","Resent-sender","Return-path"] "testtest*" ){         fileinto "Spam";                 } #ENDFILTER
Messaging server version:
Sun Java(tm) System Messaging Server 7.0-3.01 64bit (built Dec 9 2008)
libimta.so 7.0-3.01 64bit (built 09:57:35, Dec 9 2008)
Using /opt/sun/comms/messaging64/config/imta.cnf
SunOS sunpp2 5.10 Generic_141414-09 sun4v sparc SUNW,Sun-Fire-T200
Regards
Daniel

Joe, your HRs look ok for me in FF 3.6.  But your text is overlapping big time. See screenshot.
You have this in your CSS:
.copy {
    float: left;
    height: 238px;
    width: 350px;
    margin-left: 1.5em;
Height is a restriction in all but IE browsers.  You should remove height limitations and I think your float should be right; not left.
.copy {
    float: right;
    width: 350px;
    margin-left: 1.5em;
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media  Specialists
http://alt-web.com/
http://twitter.com/altweb
http://alt-web.blogspot.com

Similar Messages

  • How do I let the sieve rules match on non-standard header fields in iMS 5.0p3?

    I am able to create a per-user rule that matches on standard header lines, but if I am using a non-standard line, such as X-Spam-Flag, the rule won't apply. Is there any way to make this work properly?

    On a site running 5.2 hf 0.9, I have the following sieve rule:
    mailSieveRuleSource: require "fileinto"; if header :contains "X-Spam-Status" "Yes" { fileinto "SPAM"; }
    and it works fine for me

  • Can there be several Sieve rules for the same match?

    Following up with my other question, here's a more specific one: can I have several working Sieve rules matching the same attribute values? Or does processing stop on the first match?
    Also, is there supposed to be a toggle/flag that specifies whether a certain rule should be the "last" (if it matches, whether to abort processing or to do whatever action specified in this rule and go on to the next rule).
    I believe it is possible to write up complex Sieve scripts and save tehm to LDAP, but that's not so user-frienfly for just anybody to do ;)
    So the main usecase for this question concerns the Sieve rules defined by a user in his or her Options tab.

    JimKlimov wrote:
    And how exactly does fileinto work? Does it happen once or more?Multiple fileinto actions to different folders results in a "copy" of the email in each folder, e.g. if I use a filter which has fileinto "Inbox", fileinto "Sent", fileinto "Trash", I get the following logged:
    24-Jul-2008 09:49:42.67 ims-ms                    D 1  rfc822;[email protected] shjorth+Inbox@ims-ms-daemon mailsrv  ''
    24-Jul-2008 09:49:42.67 ims-ms                    D 1  rfc822;[email protected] shjorth+Sent@ims-ms-daemon mailsrv  ''
    24-Jul-2008 09:49:42.67 ims-ms                    D 1  rfc822;[email protected] shjorth+Trash@ims-ms-daemon mailsrv  ''I say "copy" because each email is actually a hard-link so the storage usage from the 3 copies is actually the email size + size of two hard-links. So for the email above, these were the messages on disk:
    Inbox:     613067 -rw-------   3 mailsrv  mail         591 Jul 24 09:49 124.msg
    Sent:      613067 -rw-------   3 mailsrv  mail         591 Jul 24 09:49 11.msg
    Trash:     613067 -rw-------   3 mailsrv  mail         591 Jul 24 09:49 122.msg613067 is the inode number which as you will note is identical across the messages on disk.
    From the RFC I infer that it should happen once for any one folder, but that probably doesn't mean one filing for the whole mailbox, right?Correct.
    If I have "rule1" which files some messages into a folder (without a "stop;"), "rule2" which forwards emails, and "rule3" which files all messages to the inbox, am I supposed to still get cloned messages (inbox and subfolder)?If all three actions are performed, yes.
    Regards,
    Shane.

  • Missing .db file for email (sieve) rules

    I have a problem - I have accidentally deleted a .db file from /Library/Server/Mail/Data/rules and sieve has stopped functioning. I'm not 100% sure if this was the exact directory as it was a few days ago, but it was somewhere close.
    Can someone please give me the location and contents of this file? Otherwise I am going to have to install a copy of OSX Server 10.8 somewhere else to take the copy over - something that will take hours.
    Thanks in advance!

    I guess you might be getting 1019038 error for db file missing, you can check the Essbase logs and Essbase Application logs for more information, It will tell you last action performed before you started getting this error. That might give you a clue.
    There can be many reason for the same, like:
    1. you have deleted log file while Essbase is up,
    2. During data export,
    3. Service stop accidently,
    4. Killing the ESSSVR etc.
    Best of luck!
    Cheers..!!
    Rahul S.

  • URL Boundary Rules/Include Domain

    Hi,
    I would like to restrict Ultra Search to get result only within the URL http://www.myWeb.com. So I set the starting address to http://www.myWeb.com, and I added a Domain rule to Include myWeb.com. This should limits the Ultra Search crawler to hosts belonging to myWeb.com.
    But the results page lists a lot of other links such as crri.rutgers.edu/post/03/photos1.htm...
    In the log file, these links seem to be rejected "WKG-30027: Not allowed URL: ...", but nevertheless processed !!
    What am I doing wrong ?
    Thanks for help.

    Hi Dominique & Chris,
    I'm having the similar problem - trying to limit the crawler to a specific website. I did set the crawler's source to www.x.com and set the URL Boundary Rule to Include host x.com. The crawler is only caching the first page and nothing else. If I dont include any rule it goes out the x.com website. I cant use depth cos' the leaf pages are at variable depth. Any suggestions??
    thx!
    ornov

  • Rewrite Rules with Domain Alias

    Version:
    iPlanet Messaging Server 5.2 HotFix 2.03 (built Nov 22 2004)
    libimta.so 5.2 HotFix 2.03 (built 13:20:08, Nov 22 2004)
    I am hosting 1 domain with an domain alias for the same hosted domain.
    I would like all mail coming in as domain A to be rewritten as domain B. Same for all outgoing mail outgoing as domain A to rewritten as domain B
    What should my rewrite rules look like?
    domain.a $U%domain.b

    That makes senses. I am using mailequivalentaddress with a domain alias. I also have the following rule in my imta.cnf:
    domain.A $R$U%domain.B
    domain.A $U%domain.B
    There rewrites all of the mailheaders but I noticed the the envelope headers are not rewritten. Is it a good idea to rewrite the envelope headers although the domain beinging rewritten to is an alias? The mail headers on the to: and from: address are rewritten as domain.B but envelope headers show [email protected] for delivery.

  • Creation of MTA wide SIEVE filtering Rule (i.e. SSR)

    If I create a MTA wide rule that files into trash anything with a keyword on the subject line, will a pop/imap server still retreive messages that were filed into trash (of Messenger Express)?
    ======example MTA wide sieve rule ========
    #RULE: $Template="File To Folder" $Name="P" $Order=3
    require "fileinto";
    if header :contains ["Subject","Comments","Keywords"] # Q1
    "notice" # Q2
    fileinto "trash" # Q3
    #PRE: "This rule files messages into a folder."
    #PRE: "Choose the header line to search on"
    #PRE: "And specify the phrase you wish to search for"
    #Q1: header "If the header line"
    #Q2: value "Contains the phrase"
    #Q3: folder "Then file into the folder"
    =========end of example========

    Yes, any client should be able to retreive messages from a trash folder.
    Many sites use such rules to file into a "spam" folder, rather than a trash folder. They go onto an automatic expiration rule that removes messages over a couple weeks old, too. This works well for many.
    You may have to change ACL for the folder you're filing into, to allow the system to file into there. test.

  • Best Approach for a partial domain migration?

    The company is splitting and needs to migrate about half of their users from a.com to b.com. Current users are in a 6.3 environment and we are building a completely independent new environment for the migrated users using the latest messaging 7x release.
    My plan is to create both domains for a.com and b.com in the new environment.
    Use imsbackup / imsrestore to migrate the users to a.com in the new environment.
    Use MoveUser to migrate the users in the new environment from a.com to b.com.
    Delete domain a.com from new environment
    Add mailrouting to the a.com entries of the migrated users in the old environment.
    Does this sound like a sane approach?
    -Ray

    Ray_Cormier wrote:
    The company is splitting and needs to migrate about half of their users from a.com to b.com. Current users are in a 6.3 environment and we are building a completely independent new environment for the migrated users using the latest messaging 7x release.
    My plan is to create both domains for a.com and b.com in the new environment.I wouldn't. The new environment should have no knowledge about a.com except for perhaps a custom MTA rewrite rule/channel so you can direct all a.com bound email to the a.com MTA directly.
    The question you need to address is how are users going to deal with the change given that client-side setting will need to change.
    Use imsbackup / imsrestore to migrate the users to a.com in the new environment.Is a.com a "hosted" domain or the "default" domain in Messaging Server i.e. are the store accounts in "user/uid/mailbox" or "user/[email protected]/mailbox" format:
    -bash-3.00# ./mboxutil -lp user/shjorth/INBOX
      msgs  Kbytes last msg         partition   quotaroot mailbox
        30    3087 2010/05/17 15:50 primary          9766 user/shjorth/INBOX 
    Use MoveUser to migrate the users in the new environment from a.com to b.com.MoveUser also migrates the email and using this tool with non-replicated directories is tricky.
    Does this sound like a sane approach?Another approach is:
    => Create brand new accounts in the new system for all the to-be-migrated b.com users.
    => At a specific date, advise the user that they are going to be migrated along with instructions on how to change client settings to access the new system and what their new email address is going to be. The old email address will be forwarded for X time.
    => Script the migration of the users LDAP settings e.g. sieve rules, address-book entries, email signatures, password then redirect email for [email protected] to [email protected] on the a.com system (mailroutingaddress: [email protected])
    => Disable client access on the a.com system (e.g. mailallowedserviceaccess: -ALL:ALL) for the user to stop them accessing their old account.
    => Use imsbackup -> imsrestore on the a.com -> b.com system to migrate the old email.
    => At some point down the track remove the users old email from a.com system once you are happy the migration has succeeded and also remove the users LDAP entry (to stop forwarding of the old a.com email address).
    The advantage of this approach is that you can migrate users one-at-a-time (starting with the more technical users to iron out any bugs) and test the migration yourself to ensure you have everything working. You may also want to use this as an opportunity to switch to Convergence for the webmail client (assuming you are using Messenger Express or UWC/CE now).
    Regards,
    Shane.

  • Multiple "FromAddressContainsWords" Conditions in One Rule via PowerShell?

    My organization recently moved to Exchange Online and I am looking at trying to convert the old mail rules from our old system (Sieve rules from Zimbra) to something that will work in Exchange Online.  My plan is to massage the Sieve output into New-InboxRule
    statements.  The massaging part is the easy part.  What I'm having difficult with is using PowerShell to recreate a rule that should have multiple -FromAddressContainsWords parameters.  Here's what I started off with:
    New-InboxRule -Name "Annoyances" -FromAddressContainsWords roxioemail.com -FromAddressContainsWords "Covalent Technologies" -FromAddressContainsWords process.con -FromAddressContainsWords [email protected] -DeleteMessage $true -StopProcessingRules -Mailbox George.Lenzer
    This didn't work as the -FromAddressContainsWords option can only be used once.  The error also suggested trying to do an array if the parameter would accept one.  I don't know, because that isn't documented anywhere.  The only thing mentioned
    in the help is that it will take a "MultivaluedProperty" which I assume means some sort of string or array that has multiple values in it.
    I then tried this:
    New-InboxRule -Name "Junk Mail" -FromAddressContainsWords {roxioemail.com; Covalent Technologies; process.com; [email protected]} -DeleteMessage $true -StopProcessingRules $true -Mailbox George.Lenzer
    While this worked, when I went into OWA to look at the rule and check the list of words, instead of each word on it's own line, had a single entry containing everything between { and }.  This doesn't look right, and I don't expect it would do what I
    want.  So how does one go about creating an Inbox rule from PowerShell that needs to check multiple conditions, some of the identical type?  It can be done from the GUI, so there must be a way to do it from PowerShell.  Any suggestions?

    Hi George.  Thanks for posting in the forums.  Looking at both of your code snippets, I can see where the problem is.  MultivaluedProperties in PowerShell are exactly as you describe: a set of properties presented as a single argument to a
    parameter.  The mistake you made was attempting to use the semicolon to separate the items in your multivalued property and then trying to present them as a single string.  This is why you get the whole blob of text between the squiggly braces.
    Before I give you the solution, let me say that what you want is to pass an array to -FromAddressContainsWords.  In PowerShell. the comma along with multiple quoted strings is what defines an array.  See here for a better explanation than I can
    give:
     http://theessentialexchange.com/blogs/michael/archive/2008/02/08/Multivalued-Parameters-.aspx
    With that said, here's the solution to your issue:
    New-InboxRule -Name "Junk Mail" -FromAddressContainsWords ("roxioemail.com", "Covalent Technologies", "process.com", "[email protected]") -DeleteMessage $true -StopProcessingRules
    $true -Mailbox George.Lenzer
    Hope this helps!

  • How do I define server-side spam rules with Yosemite & Server 4

    Really surprised that this isn't functionality available in the server UI. Poking around in the dovecot/spamassassin docs imply this is possible using sieve, but the configuration looks more complex than I'd like to have to figure out on my own. It seems that sieve might be possible to use. In /Library/Server/Mail/Config/dovecot/conf.d, the option sieve_dir is uncommented, pointing to /Library/Server/Mail/Data/rules/%u. That seems to imply I could create user directories there and apply some sieve rules, has anyone tried this?
    I'd rather not do user-specific rules, I'd prefer to use the default and attempt to move all spam into a spam folder for each user.
    I've seen notes that the webmail client Roundcube provided server-side rules, but I really don't need the web mail client, and various search results seem to raise questions about whether Roundcube is compatible with Sever 4 / Yosemite.
    Any help would be appreciated...

    Was able to get it working with some digging. The basic summary is that you need to create a rules directory for each mail user, and then add a sieve rule in each of the directories you create. I did this manually, which is manageable because I'm using OS X server for my household, and we don't add members to my household that often... :-). Summary of the steps:
    1) Each user has a directory in /Library/Server/Mail/Data/mail that is in UUID format (long hex string with sections broken by - characters).
    2) For each of the users you identify in (1), create an equivalent UUID directory in /Library/Server/Mail/Data/rules
    3) Create a file named "dovecot.sieve" in each of the directories you created in (2). For a basic rule that moves mail marked by SpamAssassin as spam to the Junk folder that Mail.app should create by default, you can use the following:
         require ["fileinto"];
         # rule:[SPAM]
         if header :contains "X-Spam-Flag" "YES" {
                 fileinto "Junk";
    4) Ensure that all of the directories/files are owned by _dovecot. I marked dovecot.sieve as executable, but I'm not sure that was necessary.
    5) Once you've done steps 1-4, you should start to see evidence that sieve is being used for delivery of mail in /Library/Logs/Mail/mailinfo.log. Grep for "sieve" in that to see activity. If there are errors, you'll likely see notices that there are sieve logs being created in the rules directories you set up in (2). I ran into errors for at least one account that didn't have a Junk folder created; if you hit that just have the user create a folder named Junk to clear it up.
    Hope this helps others...

  • Sieve: fileinto and addheader/tag

    I'm having a problem with a spam sieve script and fileinto. I'm not sure if there's something about sieve, fileinto or how it's implemented that I don't understand, but it seems like it doesn't work like I'd hope.
    imta.cnf has this line:
    ims-ms master_debug defragment subdirs 20 notices 1 7 14 21 28 backoff "pt5m" "pt10m" "pt30m" "pt1h" "pt2h" "pt4h" maxjobs 2 pool IMS_POOL fileinto $U+$S@$D destinationspamfilter1optin spam
    spamassassin.opt:
    host=127.0.0.1
    port=783
    mode=2
    field=
    debug=1
    option.dat:
    ! SpamAssassin
    spamfilter1_config_file=/opt/sun/comms/messaging64/config/spamassassin.opt
    spamfilter1_library=/opt/sun/comms/messaging64/lib/libspamass.so
    spamfilter1_optional=1
    spamfilter1_string_action=data:, \
    require ["spamtest","relational","comparator-i;ascii-numeric","fileinto","addheader"]; \
    spamadjust "$U"; \
    addheader "Spam-test: $U"; \
    if spamtest :value "ge" :comparator "i;ascii-numeric" "6" { \
    addtag "[SPAM_HI: $U]"; \
    } elsif spamtest :value "ge" :comparator "i;ascii-numeric" "4" { \
    addtag "[SPAM_LOW: $U]"; \
    Basically, if the spamscore is < 6, add SPAM_HI to the subject. If between 6 and 4, add SPAM_LOW to the subject, otherwise, leave it alone. Always add a 'Spam-test:' header to the message. The above works fine.
    Now what I really want to do is file the bad spam straight into the users mailbox. But I want to leave the tags and headers:
    ... same ...
    if spamtest :value "ge" :comparator "i;ascii-numeric" "6" { \
    addtag "[SPAM_HI: $U]"; \
    fileinto "spam"; \
    addtag "[SPAM_HI2: $U]"; \
    } elsif spamtest :value "ge" :comparator "i;ascii-numeric" "4" { \
    ... same ...
    And if the spamscore is 6 or higher, it's delivered to <user>+spam. If it's between 6 and 4, it gets a SPAM_LO tag, and if it's less than 6, it gets a header.
    The problem is, the messages that are 6 or higher, and delivered to the spam subfolder have neither tags added or headers added. Obviously the if/then worked, or it wouldn't have been send to spam. The other parts of the if statement are working.
    The problems seems to be that if you use fileinto, it's like it files the original message, before any addtag, or addheader commands. Anything you do to the message ends up being thrown away. In this case, I'd like to have the Spam-test: header on every message, so I can check what the score was on each message.
    So, is fileinto supposed to work this way? I've tried reading the docs and RFCs, but I can't find anything that explicitly says it should work this way.
    Thanks,
    John
    bash-3.2# ./imsimta version
    Sun Java(tm) System Messaging Server 7.0-3.01 64bit (built Dec 9 2008)
    libimta.so 7.0-3.01 64bit (built 09:24:13, Dec 9 2008)
    Using /opt/sun/comms/messaging64/config/imta.cnf
    SunOS mail 5.11 snv_104 i86pc i386 i86pc

    shane_hjorth wrote:
    jandrusiak wrote:
    I'm having a problem with a spam sieve script and fileinto. I'm not sure if there's something about sieve, fileinto or how it's implemented that I don't understand, but it seems like it doesn't work like I'd hope.I'm checking with the MTA developer to see whether this behaviour is by design or due to a coding issue.The behaviour that you are observing is due to a legacy restriction from the implementation of sieve filter processing in MS6.3 and below. Sieve filter processing was reworked in MS7.0 and above but the legacy restriction was not removed.
    Background on the implementation change here: http://msg.wikidoc.info/index.php/Sieve_Implementation
    A bug has been logged for this behaviour to remove the legacy restriction:
    bug #6807254 - "Editheader actions don't attach to fileintos in system-level sieves"
    With regards to your spamfilter1_string_action sieve rule I should also point out two syntactical errors which aren't causing a problem at this time but are likely to cause the sieve rule to break when future versions of Messaging Server remove "legacy" use of keywords:
    require ["spamtest","relational","comparator-i;ascii-numeric","fileinto","addheader"];There is no "addheader" capability string -- this should be "editheader" as per RFC 5293 (http://www.faqs.org/rfcs/rfc5293.html)
    addheader "Spam-test: $U";The format for addheader is "addheader" <field-name: string> <value: string>, so this should be:
    addheader "Spam-test" "$U";
    You can workaround bug #6807254 by moving the fileinto action into a channel level sieve e.g.
    <snip option.dat>
    spamfilter1_string_action=data:,\
    require ["spamtest","relational","comparator-i;ascii-numeric","editheader"];\
    spamadjust "$U"; \
    addheader "Spam-test" "$U"; \
    if spamtest :value "ge" :comparator "i;ascii-numeric" "6" { \
    addtag "[SPAM_HI: $U]"; \
    } elsif spamtest :value "ge" :comparator "i;ascii-numeric" "4" { \
    addtag "[SPAM_LOW: $U]"; \
    </snip option.dat>
    bash-3.00# cat config/spam.test
    require ["spamtest","relational","comparator-i;ascii-numeric","fileinto"];
    if spamtest :value "ge" :comparator "i;ascii-numeric" "6" {
            fileinto "spam";
    <snip imta.cnf>
    ! ims-ms
    ims-ms defragment subdirs 20 notices 1 7 14 21 28 backoff "pt5m" "pt10m" "pt30m" "pt1h" "pt2h" "pt4h" \
    maxjobs 2 pool IMS_POOL fileinto $U+$S@$D filter file:IMTA_TABLE:spam.test destinationspamfilter1
    ims-ms-daemon
    </snip>Regards,
    Shane.

  • Rewrite rule in mappings file

    hi all,
    in iMS 5.2, can any one suggest me how to write a rule in mapping file so that any mail sent from a particular user (say [email protected]) is also sent (i.e. Bcc 'd ) to [email protected] in addition to the "To:" address which the mail actually goes.
    this is required to monitor all mails originating from the address [email protected]
    regards,
    rajesh.

    Yeah, no.
    1. there is no such thing as a "rewrite rule" in the mappings file.
    2. Likely, what you want is a sieve rule, or a "capture" rule.
    3. Or, perhaps save the files to disk, like this:
    for capturing all messages to disk files (this doesn't mail the messages, just saves 'em on disk, invisibly)
    Add to your mappings file like this:
    MESSAGE-SAVE-COPY
    tcp_local|*@your_domain|D|/usr/ip lanet/server5/msg-dusty/imta/queue/tcp
    local/*/* $Y/usr/iplanet/server5/msgsave/$1/$2
    Add more lines to capture both inbound and outbound. The above line captures mails sent to the internet.
    files get written to the desination directory, for your examination. Since there's no "message" sent, if the destination account gets full, no message gets sent back to give you away. Less performance impact, too.
    I have 4 lines in my MESSAGE_SAVE_COPY area, to capture messages for specific people. . You may need fewer or more, depending on your exact needs.

  • Vacation messages / server side mail rules

    With WebMail depreciated in OS X Server, is there a recommended (incorporated) way for users to configure vacation messages and other server side rules?

    The seive rules are referenced by the imap server on OS X and it is responsible for the mail sort. The old webmail (SquirrelMail) and the newer webmail on Lion (Roundcube) were only writing the rules that the sieve engine of the server were reading.  In other words, the webmail doesn't handle the sorting of the incoming messages, its built in filter settings write the rules that the server uses to sort them.
    In Roundcube, that is the managesieve plugin. By default, the rules get saved in /Library/Server/Mail/Data/rules/[user UniqueID]/dovecot.sieve with the new Roundcube and older rules are default.sieve. Dovecot seems to look for one or the other and uses it.
    So, and I still have to read (and if anyone can answer!) since I've not looked at this since 10.8 server has first come out:  They moved the mailstor moved in ML, but does Dovecot still have sieve rules ENABLED or does that require a .conf change?
    To answer your configuration question:
    if you're comfortable with editing a text file, Roundrube is VERY simple to configure in my opinion. Everything is well commented in the settings files. Almost all of the settings are having it connect to your IMAP and SMTP server, same as an email client's settings.  And that's it, you don't need to compile anything to use it.
    You will need to setup MySQL or ProtegeSQL with it, but they have scripts that setup the tables for you, again, pretty simple.  PERSONALLY, I chose to install MySQL (they have a Mac .pkg install and a System Preference Pane for it).  I did not want to use the ProtegeSQL Apple supplies with OS X because we've all learned this lesson: who knows when they'll abandon THAT and leave us all scrambling for a solution again.
    This way, my SQL install is indepenent, ready for the next OS upgrade without wondering if Apple will take it away, or even transportable to another platform.

  • SA/Sieve Woes

    Hi all,
    We have MS 2005Q6 core patch -58 installed. Below is the story and problems that we have encountered when setting up Spam Assassin.
    SA is setup to label spam with addtag [SPAM] so that every spam email is tagged in the tcp_local channel. The spamfilter1_string_action looks like this:
    require ["addheader","fileinto"];
    addtag "[SPAM]";
    addheader "$U";
    fileinto "Spam";
    stop;Problem 1. In a user level sieve script, the (header :matches "Subject"
    "[SPAM]*") did match nothing even though the [SPAM] tag did appear in the
    final subject line. It looks as if the addtag processing is only done
    after the header match operations, or the header match uses the "original"
    subject line for the match. Is there anything wrong with the sieve script?
    After some time, we modified the script with the intention to give every scanned email detailed sa results even for non-spams, and at the same time add a new header for user leve sieve scripts.
    #mode=2,field= in spamassassin.opt
    require ["spamtest","relational","comparator-i;ascii-numeric","fileinto","addheader"];
    spamadjust "$U";
    addheader "Spam-Test: $U";
    if spamtest :value "ge" :comparator "i;ascii-numeric" "5"{
      addheader "Spam: Y";
      addtag "[SPAM]";
      fileinto "Spam";
    }else{
      keep;
    }Problem 2. The above script runs well, except one thing that cost me a full day debugging. Note the 2nd addheader line, which reads addheader "Spam: Y". The problem is, it seems that we cannot have a 2nd addheader in one single script, which is longer than 7 characters in length including the space in between. If you say addheader "ABCDE: Y", you are busted. The filter will just refuse to run. Is this a bug or something?
    OK, never mind, who care about a 7 byte header. We want to have a fine-grain control over the traditional email forwarding feature that uses mailForwardingAddress attribute. I suppose Sieve is more flexible when it comes to filtering and redirecting mail. So we disable the mailForwardingAddress, and use Sieve. So now, we try to setup a user level sieve to redirect important emails, even it is identified as spam like this:
    require ["fileinto","copy"];
    if header :match "Spam" "Y" {
      fileinto :copy "Spam";
    if header :match "Priority" "Urgent" {
      redirect "[email protected]";
    }Problem 3. When SA identifies a spam, it is marked as such with addtag [SPAM] (see code above). The tag should appear once. It is the case for the email left in the Spam folder of the server. But the email received by "[email protected]" contains 2 tags [SPAM] [SPAM] in the subject line. Clearly, SA is run twice, one for the incoming message, and one for the redirected message, and the log file confirms this. It seems that the redirect action cause the mail to be queued in the tcp_local channel, which causes SA to run. But it is interesting that the traditional emailForwardingAddress attribute kind of forwarding doesn't have this kind of behavior. Is there a way we can prevent SA from running twice in sieve to save resources and not to duplicate the tag?
    Anyone can shed some lights on these matters?
    Thanks in advance.
    PY

    Hi,
    SA is setup to label spam with addtag [SPAM] so
    that every spam email is tagged in the tcp_local
    channel. The spamfilter1_string_action looks like
    this:
    require ["addheader","fileinto"];
    addtag "[SPAM]";
    addheader "$U";
    fileinto "Spam";
    stop;Problem 1. In a user level sieve script, the (header
    :matches "Subject"
    [SPAM]*") did match nothing even though the [SPAM]
    tag did appear in the
    final subject line. It looks as if the addtag
    processing is only done
    after the header match operations, or the header
    match uses the "original"
    subject line for the match. Is there anything wrong
    with the sieve script?Please provide the actual spamfilter1_string_action you used - not just the 'cleaned' version.
    Also I should point out that matching on a modified subject header can lead to unexpected behaviour e.g. forwarded spam emails getting filtered to spam folder because [SPAM] appears in the subject line. It is much better to use the spamadjust/spamtest if possible.
    After some time, we modified the script with the
    intention to give every scanned email detailed sa
    results even for non-spams, and at the same time add
    a new header for user leve sieve scripts.
    #mode=2,field= in spamassassin.opt
    require
    ["spamtest","relational","comparator-i;ascii-numeric",
    "fileinto","addheader"];
    spamadjust "$U";
    addheader "Spam-Test: $U";
    if spamtest :value "ge" :comparator "i;ascii-numeric"
    "5"{
    addheader "Spam: Y";
    addtag "[SPAM]";
    fileinto "Spam";
    lse{
    keep;Problem 2. The above script runs well, except one
    thing that cost me a full day debugging. Note the
    2nd addheader line, which reads addheader "Spam:
    Y". The problem is, it seems that we cannot have a
    2nd addheader in one single script, which is longer
    than 7 characters in length including the space in
    between. If you say addheader "ABCDE: Y", you are
    busted. The filter will just refuse to run. Is this
    a bug or something?There is one limit you may be hitting (I found this one yesterday) and that is that spamfilterX_string_action is currently limited to a maximum of 256 characters - that is AFTER the expansion of the $U btw. Please log a support call (if you haven't already) and ask to be added to bug #6485247.
    There is a workaround to this limit and that is to use channel-level filtering, refer to my last reply in a forum question yesterday:
    http://forum.sun.com/jive/thread.jspa?threadID=109607
    OK, never mind, who care about a 7 byte header. We
    want to have a fine-grain control over the
    traditional email forwarding feature that uses
    mailForwardingAddress attribute. I suppose Sieve is
    more flexible when it comes to filtering and
    redirecting mail. So we disable the
    mailForwardingAddress, and use Sieve. So now, we try
    to setup a user level sieve to redirect important
    emails, even it is identified as spam like this:
    require ["fileinto","copy"];
    if header :match "Spam" "Y" {
    fileinto :copy "Spam";
    if header :match "Priority" "Urgent" {
    redirect "[email protected]";Problem 3. When SA identifies a spam, it is marked
    as such with addtag [SPAM] (see code above). The tag
    should appear once. It is the case for the email
    left in the Spam folder of the server. But the email
    received by "[email protected]" contains 2 tags
    [SPAM] [SPAM] in the subject line. Clearly, SA is
    run twice, one for the incoming message, and one for
    the redirected message, and the log file confirms
    this. It seems that the redirect action cause the
    mail to be queued in the tcp_local channel, which
    causes SA to run. But it is interesting that the
    traditional emailForwardingAddress attribute kind of
    forwarding doesn't have this kind of behavior. Is
    there a way we can prevent SA from running twice in
    sieve to save resources and not to duplicate the
    tag?
    Anyone can shed some lights on these matters?
    Thanks in advance.Well I'm not going to troubleshoot each of your issues as that will take me a ages - sieve scripts can be tricky. What is your overall goal of the filtering? From what you have mentioned so far it is:
    At the system level:
    -> add the [SPAM] tag to all spam emails
    -> add the X-Spam: Y to all spam emails emails (you should use X- for custom headers btw.)
    -> add the Spam-test: <score> to all scanned emails
    At the user level:
    -> filter all Spam emails to a spam folder
    -> forward non-spam high priority emails to another address
    Are you using separate front-end MTA/back-end store configuration and not using LMTP between the two? This will change whether spamadjust/spamtest can be used for the user level sieve rules.
    Regards,
    Shane.

  • Store.expirerule - how to combine 2 rules?

    Hello all,
    I am running Sun Java(tm) System Messaging Server 6.3-4.01 (built Aug 3 2007; 32bit).
    I want to expire/discard messages from store that are received from certain e-mail address ([email protected]) AND are older then 120 days.
    This is my rule:
    Rule1.regexp: 1
    Rule1.folderpattern: user/.*
    Rule1.messageheader.From: [email protected]
    Rule1.messagedays: 120
    However, this will erase ALL messages older that 3 months (and I want to erase only those originated from [email protected])
    If I use this rule:
    Rule1.regexp: 1
    Rule1.folderpattern: user/.*
    Rule1.messageheader.From: [email protected]
    it removes only messages from this address.
    Is there any good way to combine these 2 rules?
    Thanks,
    Maria

    Open a support case and request to be added to RFE 6696473 : Add the ability to combine multiple imexpire tests with AND instead of OR.
    Also, you may be able to accomplish what you want using a sieve rule in the expire rule. eg:
    bash-3.00# cat /tmp/expire.test.1
    Rule2.folderpattern: user/%/INBOX
    Rule2.sieve: allof(header :contains "Subject" "test",header :contains "From" "Super");
    Rule2.exclusive: 1
    Rule2.action: discard
    bash-3.00# ./imexpire -n -v 3 -d -u shjorth -f /tmp/expire.test.1
    loading ExpireRule: Rule2
             FolderPattern: user/%/INBOX
             Exclusive: true
             Sieve: allof(header :contains "Subject" "test",header :contains "From" "Super");
             Action: discard
    user/shjorth/INBOX: exists (34) largest (248087) oldest (1208970607)
    qused (896622)
    applying ExpireRule: Rule2
             FolderPattern: user/%/INBOX
             Exclusive: true
             Sieve: allof(header :contains "Subject" "test",header :contains "From" "Super");
             Action: discard
    deleting user/shjorth/INBOX UID 109
    deleting user/shjorth/INBOX UID 110
    But you will also need the fix for bug 6687201, which was fixed in Messaging Server 7u3 (aka patch 11) or later.

Maybe you are looking for

  • Using Time Capsule to backup external hard drives

    Has anyone tried backing up external hard drive to TC? I've only been able to tell TC to NOT backup my drives, not TO back them up. Any help? Thanks

  • My Iphone 4 wont show pictures or video using composite original cable

    Im using the latest software and it still wont work! I have a LG 2011 model TV and I have tried diffrent other TV`s. But it wont work! And yes,  the colours match and I am using the right connections. The sound is workin though. The setting are set t

  • Web Deployment - a few questions

    Hi, I have followed all the steps in the guide for application deployment. In point #10 of the steps for web deployment it states "take the resulting MSO from the deployment project and copy it to the deployment server". Is this a typo? I only see a

  • Country not listed, account not upgraded

    We tried purchasing the plus account on formscentral to create unlimitted amount of forums for our employees, clients and managers can fill in. To our surprise South Africa were not listed in the country selection for purchase, what must we do, can w

  • Extract DDL from an exp dmp file

    One feature I would find handy is the ability to read an exp dmp file to extract DDL statements from it. Are there any plans to include such a tool?