maildiode 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README +5 -5
- data/bin/maildiode +4 -4
- data/doc/index.html +15 -9
- data/lib/engine.rb +1 -1
- data/lib/{plugins → maildiode-plugins}/alias.rb +0 -0
- data/lib/{plugins → maildiode-plugins}/blacklist.rb +0 -0
- data/lib/{plugins → maildiode-plugins}/delay.rb +0 -0
- data/lib/server.rb +4 -2
- data/lib/util.rb +1 -1
- data/maildiode.conf.sample +13 -2
- metadata +6 -6
data/README
CHANGED
@@ -5,7 +5,7 @@ Released under the GNU GPL v3
|
|
5
5
|
|
6
6
|
*** NOTE ***
|
7
7
|
This code is NOT ready for production use.
|
8
|
-
You
|
8
|
+
You mightlose email if you use it on a real server!!
|
9
9
|
************
|
10
10
|
|
11
11
|
PROJECT GOALS:
|
@@ -71,15 +71,15 @@ INSTALLATION AND CONFIGURATION
|
|
71
71
|
|
72
72
|
|
73
73
|
TODO
|
74
|
-
-
|
74
|
+
- Allow integrating milters and/or other external filters
|
75
|
+
- Blacklist: Should allow filtering on from, subject, etc
|
75
76
|
- Add debounce filter to reject bounces for mail we didn't send
|
76
|
-
- Implement
|
77
|
-
- Periodically clear out old
|
77
|
+
- Greylist: Implement greylisting IP exemptions
|
78
|
+
- Greylist: Periodically clear out old database entries
|
78
79
|
- Properly handle multiple recipients where some work and some fail
|
79
80
|
(Reply OK but send bounces to the failures)
|
80
81
|
- Add a return path header?
|
81
82
|
- Create SPF filter?
|
82
|
-
- Allow integrating milters and/or other external filters
|
83
83
|
|
84
84
|
|
85
85
|
SEE ALSO
|
data/bin/maildiode
CHANGED
@@ -81,16 +81,16 @@ module MailDiode
|
|
81
81
|
MailDiode::log_info("Initializing plugin: [#{plugin_name}]")
|
82
82
|
case plugin_name
|
83
83
|
when 'blacklist'
|
84
|
-
require 'plugins/blacklist'
|
84
|
+
require 'maildiode-plugins/blacklist'
|
85
85
|
return BlacklistFilter.new(settings)
|
86
86
|
when 'delay'
|
87
|
-
require 'plugins/delay'
|
87
|
+
require 'maildiode-plugins/delay'
|
88
88
|
return DelayFilter.new(settings)
|
89
89
|
when 'alias'
|
90
|
-
require 'plugins/alias'
|
90
|
+
require 'maildiode-plugins/alias'
|
91
91
|
return AliasFilter.new(settings)
|
92
92
|
when 'greylist'
|
93
|
-
require 'plugins/greylist'
|
93
|
+
require 'maildiode-plugins/greylist'
|
94
94
|
return GreylistFilter.new(settings)
|
95
95
|
else
|
96
96
|
raise "Unrecognized plugin: #{plugin_name}"
|
data/doc/index.html
CHANGED
@@ -7,6 +7,10 @@
|
|
7
7
|
<h2>What is it?</h2>
|
8
8
|
MailDiode is an SMTP daemon that accepts incoming email and delivers
|
9
9
|
it to maildirs.
|
10
|
+
<h2>Where can I get it?</h2>
|
11
|
+
<p>A gem is available: <code>gem install maildiode</code>,
|
12
|
+
or you can download it from
|
13
|
+
<a href='http://rubyforge.org/projects/maildiode/'>RubyForge</a>.</p>
|
10
14
|
<h2>Why another SMTP server?</h2>
|
11
15
|
<p>Because all the others I have found are either too hard to configure,
|
12
16
|
or are written in insecure languages (C).
|
@@ -30,11 +34,10 @@ but realizes that allowing each daemon to handle one specific task
|
|
30
34
|
is simpler and (hopefully) more secure than having one service try
|
31
35
|
to handle both.
|
32
36
|
<h2>What is the status of MailDiode?</h2>
|
33
|
-
As of 2008-12-
|
34
|
-
That is, I am
|
35
|
-
|
36
|
-
|
37
|
-
After that feature works, I'll probably publish a gem.
|
37
|
+
As of 2008-12-08 it is in late alpha/early beta test.
|
38
|
+
That is, I am using it for some of my own production email,
|
39
|
+
and amd interested in feedback from other people.
|
40
|
+
There are no known bugs, but I'm sure there are some in there.
|
38
41
|
<h2>When you say "simple", what do you mean?</h2>
|
39
42
|
MailDiode supports virtual domains, aliasing, and greylisting.
|
40
43
|
Here is a sample config file demonstrating all those features:
|
@@ -45,14 +48,17 @@ server hostname localhost
|
|
45
48
|
server ip 0.0.0.0
|
46
49
|
server port 10025
|
47
50
|
server maxconnections 20
|
51
|
+
#server user maildiode
|
48
52
|
|
49
|
-
maildir
|
50
|
-
maildir
|
53
|
+
maildir bob@example.com /home/bob/mail
|
54
|
+
maildir kevin /home/kevins/TestMail/main/
|
55
|
+
maildir catchall /home/kevins/TestMail/other/
|
51
56
|
|
52
57
|
plugin alias
|
53
58
|
alias kevin ^kevin@qualitycode.com$
|
54
|
-
alias
|
55
|
-
alias
|
59
|
+
alias kevin ^kevins@qualitycode.com$
|
60
|
+
alias catchall @qualitycode.com$
|
61
|
+
alias catchall @example.com$
|
56
62
|
|
57
63
|
plugin blacklist
|
58
64
|
blacklist to \d{6,}.*@qualitycode.com$
|
data/lib/engine.rb
CHANGED
@@ -197,7 +197,7 @@ module MailDiode
|
|
197
197
|
end
|
198
198
|
filterable_data = apply_filters(@envelope.sender, recipient)
|
199
199
|
if !@mail_handler.valid_recipient?(filterable_data.recipient)
|
200
|
-
raise_smtp_error(SMTPError::UNKNOWN_RECIPIENT)
|
200
|
+
raise_smtp_error(SMTPError::UNKNOWN_RECIPIENT + filterable_data.recipient)
|
201
201
|
end
|
202
202
|
@envelope.add_recipient(recipient)
|
203
203
|
return RESULT_OK
|
File without changes
|
File without changes
|
File without changes
|
data/lib/server.rb
CHANGED
@@ -29,12 +29,14 @@ module MailDiode
|
|
29
29
|
def serve(client)
|
30
30
|
begin
|
31
31
|
MailDiode::log_debug("Accepting client")
|
32
|
-
|
32
|
+
if(connections > 1)
|
33
|
+
MailDiode::log_info("Connections: #{connections}")
|
34
|
+
end
|
33
35
|
client.binmode
|
34
36
|
engine = @factory.create_engine(@hostname)
|
35
37
|
family, port, hostname, ip = client.addr
|
36
38
|
greeting = engine.start(ip)
|
37
|
-
MailDiode::
|
39
|
+
MailDiode::log_debug("Greeting: #{greeting}")
|
38
40
|
client << response(greeting)
|
39
41
|
while !engine.terminate?
|
40
42
|
line = get_line(client, TIMEOUT_SECONDS)
|
data/lib/util.rb
CHANGED
data/maildiode.conf.sample
CHANGED
@@ -1,28 +1,39 @@
|
|
1
1
|
#debug warn # error warn info debug
|
2
2
|
|
3
|
+
# Basic server info
|
3
4
|
server hostname localhost
|
4
5
|
server ip 0.0.0.0
|
5
6
|
server port 10025
|
6
7
|
server maxconnections 20
|
7
8
|
#server user maildiode
|
8
9
|
|
10
|
+
# Define some maildirs: name and location
|
9
11
|
maildir bob@example.com /home/bob/mail
|
10
|
-
maildir kevin
|
11
|
-
maildir catchall
|
12
|
+
maildir kevin /home/kevins/TestMail/main/
|
13
|
+
maildir catchall /home/kevins/TestMail/other/
|
12
14
|
|
15
|
+
# Aliases have maildir name and matching regexp
|
16
|
+
# (Stops as soon as the first match is hit, so put catchall last)
|
13
17
|
plugin alias
|
14
18
|
alias kevin ^kevin@qualitycode.com$
|
15
19
|
alias kevin ^kevins@qualitycode.com$
|
16
20
|
alias catchall @qualitycode.com$
|
17
21
|
alias catchall @example.com$
|
18
22
|
|
23
|
+
# Blacklist only supports filtering on "to" for now
|
24
|
+
# (handy to limit catchall spam)
|
25
|
+
# Each entry is the field to check, and a regexp
|
26
|
+
# Any match here causes the email to be rejected
|
19
27
|
plugin blacklist
|
20
28
|
blacklist to \d{6,}.*@qualitycode.com$
|
21
29
|
|
30
|
+
# Delay responses so impatient spammers will give up
|
31
|
+
# Specify delay in seconds
|
22
32
|
plugin delay
|
23
33
|
delay helo 5
|
24
34
|
delay mail 6
|
25
35
|
delay rcpt 7
|
26
36
|
|
37
|
+
# NOTE: Greylist plugin is not well tested yet!
|
27
38
|
plugin greylist
|
28
39
|
greylist delayminutes 5
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maildiode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Smith
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-12-
|
12
|
+
date: 2008-12-12 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -43,15 +43,15 @@ extra_rdoc_files:
|
|
43
43
|
- doc/index.html
|
44
44
|
files:
|
45
45
|
- bin/maildiode
|
46
|
-
- lib/plugins
|
46
|
+
- lib/maildiode-plugins
|
47
47
|
- lib/engine.rb
|
48
48
|
- lib/maildir.rb
|
49
49
|
- lib/server.rb
|
50
50
|
- lib/util.rb
|
51
51
|
- lib/settings.rb
|
52
|
-
- lib/plugins/alias.rb
|
53
|
-
- lib/plugins/blacklist.rb
|
54
|
-
- lib/plugins/delay.rb
|
52
|
+
- lib/maildiode-plugins/alias.rb
|
53
|
+
- lib/maildiode-plugins/blacklist.rb
|
54
|
+
- lib/maildiode-plugins/delay.rb
|
55
55
|
- test/test_engine.rb
|
56
56
|
- test/test_suite.rb
|
57
57
|
- maildiode.conf.sample
|