~ubuntu-dev/ubuntu/lucid/dovecot/lucid-201002101901

« back to all changes in this revision

Viewing changes to libsieve/examples/sanjay.sieve

  • Committer: Chuck Short
  • Date: 2010-01-21 20:21:25 UTC
  • mfrom: (4.1.11 squeeze)
  • Revision ID: zulcss@ubuntu.com-20100121202125-pme73o491kfwj5nc
* Merge from debian testing, remaining changes:
  + Add new binary pkg dovecot-postfix that integrates postfix and dovecot
    automatically: (LP: #164837)
  + debian/control:
    - add new binary with short description
    - set Architecture all for dovecot-postfix (LP: #329878)
  + debian/dovecot-postfix.postinst:
    - create initial certificate symlinks to snakeoil.
    - set up postfix with postconf to:
      - use Maildir/ as the default mailbox.
      - use dovecot as the sasl authentication server.
      - use dovecot LDA (deliver).
      - use tls for smtp{d} services.
    - fix certificates paths in postfix' main.cf
    - add reject_unauth_destination to postfix' recipient restrictions
    - add reject_unknown_sender_domain to postfix' sender restriction
    - rename configuration name on remove, delete on purge
    - restart dovecot after linking certificates
    - handle use case when postfix is unconfigurated
  + debian/dovecot-postfix.dirs: create backup directory for postfix's config
    configuration
  + restart postfix and dovecot.
  + debian/dovecot-postfix.postrm:
    - remove all dovecot related configuration from postfix.
    - restart postfix and dovecot.
  + debian/dovecot-common.init:
    - check if /etc/dovecot/dovecot-postfix.conf exists and use it
      as the configuration file if so.
  + debian/patches/warning-ubuntu-postfix.dpatch
    - add warning about dovecot-postfix.conf in dovecot default
      configuration file
  + debian/patches/dovecot-postfix.conf.diff:
    - Ubuntu server custom changes to the default dovecot configuration for
      better interfation with postfix.
    - enable sieve plugin.
    - Ubuntu server custom changes to the default dovecot configuration for
      better integration with postfix:
      - enable imap, pop3, imaps, pop3s and managesieve by default.
      - enable dovecot LDA (deliver).
      - enable SASL auth socket in postfix private directory
   + debian/rules:
     - copy, patch and install dovecot-postfix.conf in /etc/dovecot/.
     - build architecure independent packages too
   + Use Snakeoil SSL certificates by default.
     - debian/control: Depend on ssl-cert.
     - debian/patches/ssl-cert-snakeoil.dpatch: Change default SSL cert
       paths to snakeoil.
     - debian/dovecot-common.postinst: Relax grep for SSL_* a bit.
   + Add autopkgtest to debian/tests/*.
   + Fast TearDown: Update the lsb init header to not stop in level 6.
   + Add ufw integration:
     - Created debian/dovecot-common.ufw.profile.
     - debian/rules: install profile.
     - debian/control: suggest ufw.
   + debian/{control,rules}: enable PIE hardening.
   + dovecot-imapd, dovecot-pop3: Replaces dovecot-common (<< 1:1.1). (LP: #254721)
   + debian/control: Update Vcs-* headers.
   + Add SMTP-AUTH support for Outlook (login auth mechanism)
* New upstream release.
* debian/patches/gold-fix.patch: Removed. Fixed upstream.
* Moved libexec to lib corrections in dovecot-managesieve.patch and
  dovecot-managesieve-dist.patch to dovecot-example.patch
* debian/patches/dovecot-mboxlocking.patch: Regenerated to avoid FTBFS
  when quilt isn't installed.
* debian/patches/quota-mountpoint.patch: Removed. Not needed anymore.
* debian/patches/dovecot-quota.patch: Removed. Quotas aren't properly
  enabled unless mail_plugins = quota imap_quota.
* debian/patches/gold-fix.patch: Fixed configure script to build even
  with binutils-gold or --no-add-needed linker flag (Closes: #554306)
* debian/dovecot-common.init: fixed LSB headers. Thanks to Pascal Volk.
  (Closes: #558040)
* debian/changelog: added CVE references to previous changelog entry.
* debian/rules: checked up the build system. It's not fragile anymore.
  (Closes: 493803)
* debian/dovecot-common.postinst: Now invoking dpkg-reconfigure
  on dovecot-common is enough to generate new certificates
  if the previous ones were removed. (Closes: #545582)
* debian/rules: No longer install convert-tool in /usr/bin.
  It isn't an user utility and it should stay in /usr/lib/dovecot
  like all other similar tool.
* New upstream release. (Closes: #557601)
* [SECURITY] Fixes local information disclosure and denial of service.
  (see: http://www.dovecot.org/list/dovecot-news/2009-November/000143.html
  and CVE-2009-3897)
* Added myself to uploaders.
* Switched to the new source format "3.0 (quilt)":
  - removed dpatch from build-depends
  - removed debian/README.source because now we use only standard
    dpkg features
  - regenerated all patches
* Prepared to switch to multi-origin source:
  - recreated dovecot-libsieve.patch and dovecot-managesieve-dist.patch
    starting from the upstream tarball
  - removed all autotools related build-depends and build-conflict
  - renamed dovecot-libsieve and dovecot-managesieve directories
    to libsieve and managesieve.
* debian/rules: Moved the configuration of libsieve and managesieve from
  the build phase to the configuration phase
* Added dovecot-dbg package  with debugging symbols.  Thanks Stephan Bosch.
  (Closes: #554710)
* Fixed some stray libexec'isms in the default configuration.
* New upstream release.
* debian/dovecot-common.init:
  - use $CONF when starting the daemon. (Closes: #549944)
  - always output start/stop messages. (Closes: #523810)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Example Sieve Script
 
2
#   Author: SanjaySheth
 
3
#   URL: http://wiki.fastmail.fm/index.php?title=SanjaySieveSpamFilter
 
4
 
 
5
require "fileinto";
 
6
 
 
7
if anyof (
 
8
 
 
9
      # Blacklisted sender domains
 
10
      header :contains ["from", "Received", "X-Sender", "Sender",
 
11
                        "To","CC","Subject","X-Mail-from"]
 
12
             [ "123greetings", "allfreewebsite.com",
 
13
               "new-fields.com","atlasrewards","azogle.com",
 
14
               "bannerport.net","bettingextreme.com","bigemailoffers.com",
 
15
               "BlingMail.com",
 
16
               "beyondoffers.net", ".biz ", ".biz]",
 
17
               "cavalrymail.com","ciol.com","citywire.co.uk",
 
18
               "cosmicclick.com",
 
19
               "consumergamblingreport","creativemailoffers.com","creativeoffers.com",
 
20
               "daily-promotions.com",
 
21
               "dailypromo.","dailypromotions.",
 
22
               "dandyoffers","dlbdirect",
 
23
               "e54.org",  "email-specials.net","email-ware.com","emailoffersondemand",
 
24
               "emailbargain.com","emailofferz","emailrewardz","etoll.net","emailvalues.com",
 
25
               "evaluemarketing.com","exitrequest.com",
 
26
               "fantastic-bargain.com","fpsamplesmail.com","freelotto",
 
27
               "findtv.com", "freddysfabulousfinds.com",
 
28
               "genuinerewards.com",
 
29
               "hotdailydeal.com","hulamediamail","hy-e.net",
 
30
               "inboxbargains.com","idealemail.com",
 
31
               "jackpot.com","jpmailer.com",
 
32
               "lolita","lund.com.br",
 
33
               "mafgroup.com","mailasia.com","mailtonic.net","migada.com","ms83.com",
 
34
               "nationaloffers.com","nexdeals.com ",
 
35
               "offercatch.com","offermagnet.com","offerservice.net","offertime.com",
 
36
               "offersdaily.net","optnetwork.net",
 
37
               "ombramarketing.com","on-line-offers.com","outblaze.com",
 
38
               "permissionpass","primetimedirect.net","productsontheweb.net",
 
39
               "rapid-e.net","recessionspecials", "redmoss","remit2india",
 
40
               "sampleoffers.com","savingsmansion.com","sendoutmail.com","simpleoffers.com",
 
41
               "specialdailydeals4u.com","Select-Point.net",
 
42
               "speedyvalues.com","sportsoffers","sporttime.info","suntekglobal.com",
 
43
               "superstorespecials.com", "synapseconnect","sunsetterawnings.com",
 
44
               "thefreesamplenews","truemail.net",
 
45
               "ub-kool","ultimatesports.info","uniquemailoffers","utopiad.com",
 
46
               "unixlovers.net",
 
47
               "valuesdirect","virtualoffers.net",
 
48
               "wagerzine", "webdpoffrz",
 
49
               "yestshirt.com",
 
50
               "z-offer.com", "zipido.com"
 
51
             ],
 
52
 
 
53
      # Blacklisted ip subnets due to excessive spam from them
 
54
      header :contains "Received"
 
55
             [ "[4.63.221.224",
 
56
               "[24.244.141.112",
 
57
               "[61.171.253.177",
 
58
               "[63.123.149.", "[63.209.206.", "(63.233.30.73", "[63.251.200.",
 
59
               "[64.41.183.","[64.49.250.", "[64.57.188.", "[64.57.221.",
 
60
               "[64.62.204.",
 
61
               "[64.70.17.", "[64.70.44.", "[64.70.53.",
 
62
               "[64.39.27.6", "[64.39.27.7","[64.191.25.","[64.191.36.",
 
63
               "[64.191.9.",
 
64
               "[64.125.181.", "[64.191.123.", "[64.191.23.", "[64.239.182.",
 
65
               "[65.211.3.",
 
66
               "[66.46.150.", "[66.62.162.", "[66.118.170.", "[66.129.124.",
 
67
               "[66.205.217.", "[66.216.111.", "[66.239.204.",
 
68
               "[67.86.69.",
 
69
               "[80.34.206.", "[80.80.98.",
 
70
               "[81.72.233.13",
 
71
               "[128.242.120.",
 
72
               "[157.238.18",
 
73
               "[168.234.195.18]",
 
74
               "[193.253.198.57",
 
75
               "[194.25.83.1",
 
76
               "[200.24.129.", "[200.161.203.",
 
77
               "[202.164.182.76]","[202.57.69.116",
 
78
               "[203.19.220.","[203.22.104.","[203.22.105.",
 
79
               "[204.188.52.",
 
80
               "[205.153.154.203",
 
81
               "[206.26.195.", "[206.154.33.","[206.169.178",
 
82
               "[207.142.3.",
 
83
               "[208.46.5.","[208.187.",
 
84
               "[209.164.27.","[209.236.",
 
85
               "[210.90.75.129]",
 
86
               "[211.101.138.199","[211.185.7.125]","[211.239.231.",
 
87
               "[212.240.95.",
 
88
               "[213.47.250.139", "[213.225.61.",
 
89
               "[216.22.79.","[216.39.115.","[216.99.240.",
 
90
               "[216.126.32.", "[216.187.123.","[217.36.124.53",
 
91
               "[218.145.25","[218.52.71.103","[218.158.136.115",
 
92
               "[218.160.42.74", "[218.242.112.4]"
 
93
             ],
 
94
 
 
95
      # Blacklisted SpamAssassin flags
 
96
      header :contains ["SPAM", "X-Spam-hits"]
 
97
             ["ADDRESSES_ON_CD","ACT_NOW","ADULT_SITE", "ALL_CAP_PORN",
 
98
              "AMATEUR_PORN", "AS_SEEN_ON",
 
99
              "BAD_CREDIT", "BALANCE_FOR_LONG_20K", "BARELY_LEGAL", "BEEN_TURNED_DOWN",
 
100
              "BANG_GUARANTEE", "BANG_MONEY","BASE64_ENC_TEXT",
 
101
              "BAYES_99","BAYES_90",
 
102
              "BE_BOSS", "BEST_PORN", "BULK_EMAIL",
 
103
              "CASINO", "CONSOLIDATE_DEBT", "COPY_ACCURATELY", "COPY_DVD",
 
104
              "DIET", "DO_IT_TODAY","DOMAIN_4U2",
 
105
              "EMAIL_MARKETING","EMAIL_ROT13", "EXPECT_TO_EARN","EARN_MONEY",
 
106
              "FIND_ANYTHING", "FORGED_AOL_RCVD",
 
107
              "FORGED_HOTMAIL_RCVD", "FORGED_YAHOO_RCVD",
 
108
              "FORGED_RCVD_TRAIL", "FORGED_JUNO_RCVD",
 
109
              "FORGED_MUA_",
 
110
              "FREE_MONEY","FREE_PORN",
 
111
              "GENTLE_FEROCITY", "GET_PAID", "GUARANTEED_STUFF", "GUARANTEED_100_PERCENT",
 
112
              "HAIR_LOSS", "HIDDEN_ASSETS", "HGH,", "HOME_EMPLOYMENT","HOT_NASTY","HTTP_ESCAPED_HOST",
 
113
              "HTTP_USERNAME_USED","HTML_FONT_INVISIBLE",
 
114
              "IMPOTENCE","INVALID_MSGID","INVESTMENT",
 
115
              "LESBIAN","LIVE_PORN","LOSE_POUNDS",
 
116
              "MARKETING_PARTNERS", "MORTGAGE_OBFU", "MORTGAGE_RATES",
 
117
              "NIGERIAN_SCAM", "NIGERIAN_TRANSACTION_1", "NIGERIAN_BODY", "NUMERIC_HTTP_ADDR",
 
118
              "NO_MX_FOR_FROM","NO_DNS_FOR_FROM",
 
119
              "OBFUSCATING_COMMENT", "ONLINE_PHARMACY",
 
120
              "PENIS_ENLARGE",
 
121
              "PREST_NON_ACCREDITED", "PURE_PROFIT","PORN_4",
 
122
              "RCVD_IN_DSBL", "RCVD_IN_OSIRUSOFT_COM","RCVD_IN_BL_SPAMCOP_NET", "RCVD_IN_SBL",
 
123
              "RCVD_IN_MULTIHOP_DSBL", "RCVD_IN_RELAYS_ORDB_ORG", "RCVD_IN_UNCONFIRMED_DSBL",
 
124
              "RCVD_FAKE_HELO_DOTCOM", "RCVD_IN_RFCI", "RCVD_IN_NJABL","RCVD_IN_SORBS",
 
125
              "REFINANCE", "REVERSE_AGING",
 
126
              "SAVE_ON_INSURANCE","SPAM_REDIRECTOR", "STOCK_ALERT", "STOCK_PICK", "STRONG_BUY",
 
127
              "SEE_FOR_YOURSELF", "SUPPLIES_LIMITED",
 
128
              "THE_BEST_RATE","TONER",
 
129
              "UNSECURED_CREDIT",
 
130
              "VACATION_SCAM", "VIAGRA", "VJESTIKA",
 
131
              "WHILE_SUPPLIES", "WORK_AT_HOME",
 
132
              "X_OSIRU_DUL", "X_OSIRU_SPAMWARE_SITE", "X_OSIRU_SPAM_SRC"
 
133
             ],
 
134
 
 
135
 
 
136
      # Blacklisted subjects
 
137
 
 
138
      header :contains ["From","Subject"]
 
139
             [" penis ",
 
140
              "ADV:", "adult dvd", "adult movie", "adultdirect", "adultemail",
 
141
              "background check", "bankrupt", "boobs", "business opportunity","big@boss.com",
 
142
              "casino", "cash guarantee",
 
143
              "debt free", "diet bread", "ebay secrets", "erection",
 
144
              "financial freedom", "free credit",
 
145
              "gambl", "gov grants", "jackpot",
 
146
              "life insurance", "lottery", "lotto",
 
147
              "mortgage", "nude", "OTCBB",
 
148
              "penis", "porn", "promotion", "proven System",
 
149
              " rape ",
 
150
              " sex ", "skin resurfacing", "special offer",
 
151
              "ultimate software", "viagra", "V1AGRA", "vivatrim",
 
152
              "win money","work from home", "xxx"
 
153
             ],
 
154
 
 
155
      # often spam emails to multiple addresses with same name & different domain
 
156
      header :matches ["To","CC"]
 
157
             ["*fastmail*fastmail*fastmail*fastmail*fastmail*"],
 
158
 
 
159
      # Almost all emails from these domains is spam (at least for me)
 
160
      header :contains ["from", "received"]
 
161
                       [".ru ",".jp ", ".kr ", ".pt ",".pl ",".at ",".cz ",
 
162
                        ".ru>",".jp>", ".kr>", ".pt>", ".pl>",".at>",".cz>"],
 
163
 
 
164
      # Really high SpamAssassin scores (15.0+)
 
165
      header :matches ["X-Spam-score","X-Remote-Spam-score"] [
 
166
          "1?.?", "2?.?", "3?.?", "4?.?", "5?.?", "6?.?"     # 10.0 to 69.9
 
167
      ]
 
168
) {
 
169
      fileinto "INBOX.Spam.discard";
 
170
      stop;
 
171
}