Sieve Loops Tony Hansen

Slides:



Advertisements
Similar presentations
JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Advertisements

Java Script Session1 INTRODUCTION.
Chapter 7 User-Defined Methods. Chapter Objectives  Understand how methods are used in Java programming  Learn about standard (predefined) methods and.
Introduction to C Programming
Linux+ Guide to Linux Certification, Second Edition
TCP/IP Protocol Suite 1 Chapter 20 Upon completion you will be able to: Electronic Mail: SMTP, POP, and IMAP Understand four configurations of architecture.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
CIS 101: Computer Programming and Problem Solving Lecture 5 Usman Roshan Department of Computer Science NJIT.
Loops Repetition Statements. Repetition statements allow us to execute a statement multiple times Often they are referred to as loops Like conditional.
© 2004 Pearson Addison-Wesley. All rights reserved5-1 Iterations/ Loops The while Statement Other Repetition Statements.
Architecture of SMTP, POP, IMAP, MIME.
By Hassan Abu daqen & montaser elsabe3 & Nidal Abu saif.
Electronic Mail (SMTP, POP, IMAP, MIME)
Shell Scripting Awk (part1) Awk Programming Language standard unix language that is geared for text processing and creating formatted reports but it.
PHP: Hypertext Processor Fred Durao
JSP Standard Tag Library
Comp2513 Forms and CGI Server Applications Daniel L. Silver, Ph.D.
Week 7 Working with the BASH Shell. Objectives  Redirect the input and output of a command  Identify and manipulate common shell environment variables.
BLENDED ATTACKS EXPLOITS, VULNERABILITIES AND BUFFER-OVERFLOW TECHNIQUES IN COMPUTER VIRUSES By: Eric Chien and Peter Szor Presented by: Jesus Morales.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
CIS 218 Advanced UNIX1 CIS 218 – Advanced UNIX (g)awk.
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
CPS120 Introduction to Computer Science Iteration (Looping)
Linux+ Guide to Linux Certification, Third Edition
The C# language fundamentals ( II ) Po Feng, Tsai.
CPS120: Introduction to Computer Science Decision Making in Programs.
Sed, awk, & perl CS 2204 Class meeting 13 *Notes by Mir Farooq Ali and other members of the CS faculty at Virginia Tech. Copyright 2003.
JavaScript Syntax and Semantics. Slide 2 Lecture Overview Core JavaScript Syntax (I will not review every nuance of the language)
 2008 Pearson Education, Inc. All rights reserved JavaScript: Control Statements I.
Chapter 3 Functions, Events, and Control Structures JavaScript, Third Edition.
GATEWAY WITH PER-USER SPAM BLOCKING AND VIRUS SCANNING Greg Woods National Center for Atmospheric Research Scientific Computing Division Boulder,
JavaScript, Fourth Edition
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 10 - JavaScript/JScript: Control Structures II Outline 10.1Introduction 10.2Essentials of.
Chapter Twelve sed, awk & perl1 System Programming sed, awk & perl.
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
CPS120 Introduction to Computer Science Iteration (Looping)
Digital Image Processing Lecture 6: Introduction to M- function Programming.
Digital Image Processing Introduction to M-function Programming.
Sieve Loops Tony Hansen Cyrus Daboo
 Control Flow statements ◦ Selection statements ◦ Iteration statements ◦ Jump statements.
Linux+ Guide to Linux Certification, Second Edition
COMP Loop Statements Yi Hong May 21, 2015.
PHP Reusing Code and Writing Functions 1. Function = a self-contained module of code that: Declares a calling interface – prototype! Performs some task.
Repetition Statements b Repetition statements allow us to execute a statement multiple times repetitively b They are often simply referred to as loops.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 9 - JavaScript: Control Structures II Outline 9.1 Introduction 9.2 Essentials of Counter-Controlled.
Loops causes program to execute the certain block of code repeatedly until some conditions are satisfied. Suppose you want to execute some code/s 10 times.
Core Java Statements in Java.
Review 1.
TMG Client Protection 6NPS – Session 7.
Chapter 4 Repetition Statements (loops)
Warm-up Program Use the same method as your first fortune cookie project and write a program that reads in a string from the user and, at random, will.
Miscellaneous Items Loop control, block labels, unless/until, backwards syntax for “if” statements, split, join, substring, length, logical operators,
JavaScript Syntax and Semantics
Scripts & Functions Scripts and functions are contained in .m-files
Chapter 6: Conditional Statements and Loops
Expressions and Control Flow in JavaScript
JavaScript: Control Statements.
Chapter 5 Structures.
Functions BIS1523 – Lecture 17.
Python Primer 2: Functions and Control Flow
Outline Altering flow of control Boolean expressions
MATLAB – Basic For Loops
More Looping Structures
LabVIEW.
Using Decision Structures
1-6 Midterm Review.
Introduction to Computer Science
awk- An Advanced Filter
More Looping Structures
Corresponds with Chapter 5
Presentation transcript:

Sieve Loops Tony Hansen

for.every.part –Syntax: for.every.part block Walks though every MIME part of a message, including nested parts, and applies the specified block to each of them. The iterator will start with the first MIME part (as its current context) and will execute a command block (Sieve commands enclosed by {...}). Upon completion of this command block, the iterator advances to the next MIME part (as its current context) and will execute the same command block again. The iterator can be terminated prematurely by a new sieve command, "break". –Syntax: break;

Mime test For Sieve tests on MIME parts, a new Sieve test (mime) is defined. –Syntax: mime [COMPARATOR] [MATCH-TYPE] [ ] Two uses: in an iterator context and outside of an iterator context Within an iterator context: –The "mime" test will examine the current MIME part context (as set by the "for.every.part" iterator). –Similar in concept to the Sieve "address" test, it will parse the MIME header lines so that tests can be performed on specific elements. Outside an iterator context: –it applies the test against all MIME body parts and returns true if any of them satisfies the test.

Body part replacement A new sieve action command is defined to allow the MIME part to be replaced by a text message. –Syntax: replace string –The "replace" command causes a MIME part to be removed and replaced with a text/plain part with the text supplied by the command. When used in the context of a "for.every.part" loop, the MIME part to be replaced is the "current" MIME part. –If this is a multipart MIME part, the entire multipart MIME part is replaced. –(Replacing a non-multipart MIME part within a "for.every.part" loop context does not alter the overall message structure.) When used outside the context of a "for.every.part" loop, the MIME part to be replaced is the entire message.

Enclose The "enclose" action will enclose the original message as an attachment with the text specified. –This enclose action takes precedance over all other message modifications, such as "replace". –If multiple "enclose" actions are executed by a script, only the text specified on the last one is used when creating the enclosed message. This action does not affect messages that are forwarded via "redirect" action.

Sieve Capability Strings A Sieve implementation that defines the "for.every.part", "break" actions and the "part" test will advertise the capability string "for.every.part". A Sieve implementation that defines the "replace" action will advertise the capability string "replace". A Sieve implementation that defines the "enclose" action will advertise the capability string "enclose".

Example 1 require [ "for.every.part", "replace" ]; for.every.part { if ( anyof ( mime :subtype :is "jpeg", part :filename :matches "*.jpg" ) { replace "JPEG attachment removed by user filter"; } }

Example 2 require [ "for.every.part", "enclose" ]; for.every.part { if mime :filename :matches ["*.com", "*.exe", "*.vbs", "*.scr", "*.pif", "*.hta", "*.bat", "*.zip" ] { # these attachment types are executable enclose “ WARNING! The enclosed message contains executable attachments. These attachments types may contain a computer virus program that can infect your computer and potentently damage your data Before clicking on these message attachments, you should verify with the sender that this message was sent by them and not a computer virus. "; break; } }