diff options
author | Charles Longeau <github@chl.be> | 2012-11-30 01:17:30 +0100 |
---|---|---|
committer | Charles Longeau <github@chl.be> | 2012-11-30 01:17:30 +0100 |
commit | 82e008e2ec9d53f9c83bc04041e9d4ba6121384c (patch) | |
tree | ef9b4e68cbc907b073d72533a983d5bd9dc9baa3 | |
parent | fix merge master conflicts (diff) | |
parent | Merge branch 'master' of ssh://ssh.poolp.org/git/opensmtpd (diff) | |
download | OpenSMTPD-82e008e2ec9d53f9c83bc04041e9d4ba6121384c.tar.xz OpenSMTPD-82e008e2ec9d53f9c83bc04041e9d4ba6121384c.zip |
fix merge master conflicts
-rw-r--r-- | README | 34 | ||||
-rwxr-xr-x[-rw-r--r--] | regress/smtp/test.base (renamed from regress/test.base) | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | regress/smtp/test.smtp0 (renamed from regress/test.smtp0) | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | regress/smtp/test.smtp1 (renamed from regress/test.smtp1) | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | regress/smtp/test.smtp2 (renamed from regress/test.smtp2) | 1 | ||||
-rwxr-xr-x | regress/smtp/test.smtp4 | 140 | ||||
-rw-r--r-- | smtpd/ruleset.c | 3 |
7 files changed, 180 insertions, 1 deletions
@@ -0,0 +1,34 @@ +Preliminary note +================ + +OpenSMTPD is a FREE implementation of the server-side SMTP protocol as defined +by RFC 5321, with some additional standart extensions. + +It allows ordinary machines to exchange e-mails with other systems speaking +the SMTP protocol. + +OpenSMTPD runs on top of the OpenBSD operating system but also has a portable +version that can build and run on several systems, including: + + - Linux + - FreeBSD + - NetBSD + - DragonFly + - MacOSX + +For more information: + + http://www.opensmtpd.org/portable.html + + +People interested about OpenSMTPD are encouraged to subscribe to our mailing +list: + + http://www.opensmtpd.org/list.html + + +and to join the IRC channel: + + #OpenSMTPD @ irc.freenode.net + +Cheers ! diff --git a/regress/test.base b/regress/smtp/test.base index d815b66b..02e76cdb 100644..100755 --- a/regress/test.base +++ b/regress/smtp/test.base @@ -1,3 +1,4 @@ +#! /usr/bin/smtpscript # # This file is simply used to test the grammar and the behaviour of # the scripting engine. Not SMTP related. diff --git a/regress/test.smtp0 b/regress/smtp/test.smtp0 index af5f7901..2f0162d6 100644..100755 --- a/regress/test.smtp0 +++ b/regress/smtp/test.smtp0 @@ -1,3 +1,4 @@ +#! /usr/bin/smtpscript # # Simple test cases for the SMTP server. # diff --git a/regress/test.smtp1 b/regress/smtp/test.smtp1 index af5f7901..2f0162d6 100644..100755 --- a/regress/test.smtp1 +++ b/regress/smtp/test.smtp1 @@ -1,3 +1,4 @@ +#! /usr/bin/smtpscript # # Simple test cases for the SMTP server. # diff --git a/regress/test.smtp2 b/regress/smtp/test.smtp2 index 091bb135..67df49fc 100644..100755 --- a/regress/test.smtp2 +++ b/regress/smtp/test.smtp2 @@ -1,3 +1,4 @@ +#! /usr/bin/smtpscript # # Make sure that the SMTP limits are ok # diff --git a/regress/smtp/test.smtp4 b/regress/smtp/test.smtp4 new file mode 100755 index 00000000..190c9eb7 --- /dev/null +++ b/regress/smtp/test.smtp4 @@ -0,0 +1,140 @@ +#! /usr/bin/smtpscript +# +# Make sure that broken sessions are handled as they should +# + +test-case { + expect smtp + writeln "EHLO" + expect smtp permfail +} + +test-case { + expect smtp + writeln "HELO" + expect smtp permfail +} + +test-case { + expect smtp + writeln "HELO " + expect smtp permfail +} + +test-case { + expect smtp + writeln " HELO " + expect smtp permfail +} + +test-case { + expect smtp + writeln "HELO l" + expect smtp helo +} + + +test-case { + expect smtp + writeln "HELO l" + expect smtp ok +} + +test-case { + expect smtp + writeln "EHLO l" + expect smtp helo +} + +test-case { + expect smtp + writeln "EHLO l" + expect smtp helo + writeln "RCPT TO:" + expect smtp permfail +} + +test-case { + expect smtp + writeln "EHLO l" + expect smtp helo + writeln "DATA" + expect smtp permfail +} + +test-case { + expect smtp + writeln "EHLO l" + expect smtp helo + writeln "MAIL FROM" + expect smtp permfail +} + +test-case { + expect smtp + writeln "EHLO l" + expect smtp helo + writeln "MAIL FROM:<opensmtpd@opensmtpd.org>" + expect smtp ok + writeln "DATA" + expect smtp permfail +} + +test-case { + expect smtp + writeln "EHLO l" + expect smtp helo + writeln "MAIL FROM:<opensmtpd@opensmtpd.org>" + expect smtp ok + writeln "RCPT TO:" + expect smtp permfail +} + +test-case { + expect smtp + writeln "EHLO l" + expect smtp helo + writeln "MAIL FROM:<opensmtpd@opensmtpd.org>" + expect smtp ok + writeln "RCPT TO:<root@localhost>" + expect smtp ok + writeln "RSET" + expect smtp ok + writeln "DATA" + expect smtp permfail +} + +test-case { + expect smtp + writeln "EHLO l" + expect smtp helo + writeln "MAIL FROM:<opensmtpd@opensmtpd.org>" + expect smtp ok + writeln "RCPT TO:<root@localhost>" + expect smtp ok + writeln "RSET" + expect smtp ok + writeln "MAIL FROM:<opensmtpd@opensmtpd.org>" + expect smtp ok + writeln "DATA" + expect smtp permfail +} + +test-case { + expect smtp + writeln "EHLO l" + expect smtp helo + writeln "MAIL FROM:<opensmtpd@opensmtpd.org>" + expect smtp ok + writeln "RCPT TO:<root@localhost>" + expect smtp ok + writeln "RSET" + expect smtp ok + writeln "MAIL FROM:<opensmtpd@opensmtpd.org>" + expect smtp ok + writeln "RCPT TO:<root@localhost>" + expect smtp ok + writeln "DATA" + expect smtp ok +} + diff --git a/smtpd/ruleset.c b/smtpd/ruleset.c index 7a4b31ce..5cf0bb40 100644 --- a/smtpd/ruleset.c +++ b/smtpd/ruleset.c @@ -42,7 +42,7 @@ static int ruleset_check_source(struct table *, struct rule * ruleset_match(const struct envelope *evp) { - const struct mailaddr *maddr = &evp->rcpt; + const struct mailaddr *maddr = &evp->dest; const struct sockaddr_storage *ss = &evp->ss; struct rule *r; int ret; @@ -111,6 +111,7 @@ ruleset_check_source(struct table *table, const struct sockaddr_storage *ss) case -1: log_warnx("warn: failure to perform a table lookup on table %s", table->t_name); + return -1; default: break; } |