1 /* -*- Mode: idl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
3 /* ***** BEGIN LICENSE BLOCK *****
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at
9 * http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * The Original Code is mozilla.org code.
17 *
18 * The Initial Developer of the Original Code is
19 * Netscape Communications Corp.
20 * Portions created by the Initial Developer are Copyright (C) 2002
21 * the Initial Developer. All Rights Reserved.
22 *
23 * Contributor(s):
24 * Seth Spitzer <sspitzer@netscape.com>
25 * Dan Mosedale <dmose@netscape.com>
26 *
27 * Alternatively, the contents of this file may be used under the terms of
28 * either the GNU General Public License Version 2 or later (the "GPL"), or
29 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30 * in which case the provisions of the GPL or the LGPL are applicable instead
31 * of those above. If you wish to allow use of your version of this file only
32 * under the terms of either the GPL or the LGPL, and not to allow others to
33 * use your version of this file under the terms of the MPL, indicate your
34 * decision by deleting the provisions above and replace them with the notice
35 * and other provisions required by the GPL or the LGPL. If you do not delete
36 * the provisions above, a recipient may use your version of this file under
37 * the terms of any one of the MPL, the GPL or the LGPL.
38 *
39 * ***** END LICENSE BLOCK ***** */
40
41
42 #include "nsISupports.idl"
43
44 interface nsIOutputStream;
45 interface nsIMsgIncomingServer;
46 interface nsIMsgDBHdr;
47 interface nsIFile;
48
49 [scriptable, uuid(60BF2B22-AA8C-4cb2-80C8-ADC8B508E425)]
50 interface nsISpamSettings: nsISupports {
51 /**
52 * 0 for nothing, 100 for highest
53 */
54 attribute long level;
55
56 attribute boolean moveOnSpam;
57 readonly attribute boolean markAsReadOnSpam;
58
59 /**
60 * Most consumers will just use spamFolderURI rather than accessing any of
61 * target attributes directly.
62 */
63 attribute long moveTargetMode;
64 const long MOVE_TARGET_MODE_ACCOUNT = 0;
65 const long MOVE_TARGET_MODE_FOLDER = 1;
66 attribute string actionTargetAccount;
67 attribute string actionTargetFolder;
68
69 /**
70 * built from moveTargetMode, actionTargetAccount, actionTargetFolder
71 */
72 readonly attribute string spamFolderURI;
73
74 attribute boolean purge;
75 /**
76 * interval, in days
77 */
78 attribute long purgeInterval;
79
80 attribute boolean useWhiteList;
81 attribute string whiteListAbURI;
82
83 /**
84 * should we do something (move or delete)
85 * when the user manually marks a message as junk?
86 */
87 readonly attribute boolean manualMark;
88 readonly attribute long manualMarkMode;
89 const long MANUAL_MARK_MODE_MOVE = 0;
90 const long MANUAL_MARK_MODE_DELETE = 1;
91
92 /**
93 * integrate with server-side spam detection programs
94 */
95 attribute boolean useServerFilter;
96 attribute ACString serverFilterName;
97 readonly attribute nsIFile serverFilterFile;
98 const long TRUST_POSITIVES = 1;
99 const long TRUST_NEGATIVES = 2;
100 attribute long serverFilterTrustFlags;
101
102 // for logging
103 readonly attribute boolean loggingEnabled;
104 attribute nsIOutputStream logStream;
105 void logJunkHit(in nsIMsgDBHdr aMsgHdr, in boolean aMoveMessage);
106 void logJunkString(in string aLogText);
107 void clone(in nsISpamSettings aSpamSettings);
108
109 // aServer -> spam settings are associated with a particular server
110 void initialize(in nsIMsgIncomingServer aServer);
111 };