1Mail::MIMEDefang(3) Mail::MIMEDefang Documentation Mail::MIMEDefang(3)
2
3
4
6 Mail::MIMEDefang - email filtering milter
7
9 Mail::MIMEDefang is a framework for filtering e-mail. It uses
10 Sendmail's "Milter" API, some C glue code, and some Perl code to let
11 you write high-performance mail filters in Perl.
12
13 People use MIMEDefang to:
14
15 Block viruses
16 Block or tag spam
17 Remove HTML mail parts
18 Add boilerplate disclaimers to outgoing mail
19 Remove or alter attachments
20 Replace attachments with URL's
21 Implement sophisticated access controls.
22
23 You're limited only by your imagination. If you can think of it and
24 code it in Perl, you can do it with MIMEDefang.
25
27 init_globals
28 Initialize global variables used across MIMEDefang instance and
29 filter.
30
31 print_and_flush(text)
32 Prints to stdout and flush buffer.
33
34 md_openlog(tag, facility)
35 Initialize e syslog object using Sys::Syslog or Unix::Syslog as
36 appropriate.
37
38 md_syslog(facility, msg)
39 Prints a message to syslog(3) using the specified facility
40
41 md_graphdefang_log
42 This is called to log events that occur during mimedefang
43 processing. It should be called from mimedefang-filter with
44 appropriate event names and values.
45
46 Possible examples:
47
48 "md_graphdefang_log('virus',$VirusName,$filename);"
49
50 "md_graphdefang_log('spam',$hits);"
51
52 "md_graphdefang_log('bad_filename',$filename,$extension);"
53
54 If you need to log UTF-8 strings you can call the sub as:
55
56 "md_graphdefang_log('spam',$hits, undef, 1);"
57
58 detect_and_load_perl_modules
59 Automatically detect and load Perl modules needed for some features
60 like SpamAssassin, rbl checks, zip file listing and HTML parsing.
61
62 detect_antivirus_support
63 Check if antivirus support should be loaded by looking at %Features
64
65 init_status_tag
66 Open the status file descriptor
67
68 set_status_tag(depth, tag)
69 Sets the status tag for this worker inside the multiplexor.
70
71 push_status_tag(tag)
72 Updates status tag inside multiplexor and pushes onto stack.
73
74 pop_status_tag
75 Pops previous status of stack and sets tag in multiplexor.
76
77 percent_encode(str)
78 Encode a string with unsafe chars as "%XY" where X and Y are hex
79 digits.
80
81 percent_encode_for_graphdefang(str)
82 Encode a string with unsafe chars as "%XY" where X and Y are hex
83 digits.
84
85 Quotes or spaces are not encoded but commas are encoded.
86
87 percent_decode(str)
88 Decode a string previously encoded by percent_encode().
89
90 write_result_line ( $cmd, @args )
91 Writes a result line to the RESULTS file.
92
93 $cmd should be a one-letter command for the RESULTS file
94
95 @args are the arguments for $cmd, if any. They will be
96 percent_encode()'ed before being written to the file.
97
98 Returns 0 or 1 and an optional warning message.
99
100 signal_unchanged
101 Tells mimedefang C program message has not been altered.
102
103 signal_changed
104 Tells mimedefang C program message has been altered.
105
106 in_message_context(name)
107 Returns 1 if we are processing a message; 0 otherwise.
108
109 in_filter_wrapup(name)
110 Returns 1 if we are not in filter wrapup; 0 otherwise.
111
112 in_filter_context
113 Returns 1 if we are inside filter or filter_multipart, 0 otherwise.
114
115 in_filter_end(name)
116 Returns 1 if we are inside filter_end 0 otherwise.
117
118 send_quarantine_notifications
119 Sends quarantine notification message, if anything was quarantined.
120
121 signal_complete
122 Tells mimedefang C program Perl filter has finished successfully.
123
124 Also mails any quarantine notifications and sender notifications.
125
126 send_mail(fromAddr, fromFull, recipient, body, deliverymode)
127 Sends a mail message using Sendmail.
128
129 Invokes Sendmail without involving the shell, so that shell
130 metacharacters won't cause security problems.
131
132 Delivery mode parameter is the optional sendmail delivery mode arg
133 (default "-odd").
134
135 send_admin_mail(subject, body)
136 Sends a mail message to the administrator
137
138 SEE ALSO
139 Mail::MIMEDefang::Actions(3)
140
141 Mail::MIMEDefang::Antispam(3)
142
143 Mail::MIMEDefang::Antivirus(3)
144
145 Mail::MIMEDefang::DKIM(3)
146
147 Mail::MIMEDefang::DKIM::ARC(3)
148
149 Mail::MIMEDefang::DKIM::Authres(3)
150
151 Mail::MIMEDefang::Mail(3)
152
153 Mail::MIMEDefang::MIME(3)
154
155 Mail::MIMEDefang::Net(3)
156
157 Mail::MIMEDefang::RFC2822(3)
158
159 Mail::MIMEDefang::Unit(3)
160
161 Mail::MIMEDefang::Utils(3)
162
163
164
1653.3 2023-01-18 Mail::MIMEDefang(3)