Merge commit 'rspier/master'
Conflicts: docs/plugins.pod
This commit is contained in:
commit
bb47d93eb4
2
STATUS
2
STATUS
@ -12,8 +12,6 @@ Roadmap
|
|||||||
|
|
||||||
- http://code.google.com/p/smtpd/issues
|
- http://code.google.com/p/smtpd/issues
|
||||||
|
|
||||||
- move repository to git?
|
|
||||||
|
|
||||||
- Bugfixes - qpsmtpd is extremely stable (in production since 2001), but
|
- Bugfixes - qpsmtpd is extremely stable (in production since 2001), but
|
||||||
there are always more things to fix.
|
there are always more things to fix.
|
||||||
|
|
||||||
|
81
docs/development.pod
Normal file
81
docs/development.pod
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
|
||||||
|
=head1 Developing Qpsmtpd
|
||||||
|
|
||||||
|
=head2 Mailing List
|
||||||
|
|
||||||
|
All qpsmtpd development happens on the qpsmtpd mailing list.
|
||||||
|
|
||||||
|
Subscribe by sending mail to qpsmtpd-subscribe@perl.org
|
||||||
|
|
||||||
|
=head2 Git
|
||||||
|
|
||||||
|
We use git for version control.
|
||||||
|
|
||||||
|
Ask owns the master repository at git://github.com/abh/qpsmtpd.git
|
||||||
|
|
||||||
|
We suggest using github to host your repository -- it makes your
|
||||||
|
changes easily accessible for pulling into the master. After you
|
||||||
|
create a github account, go to
|
||||||
|
http://github.com/abh/qpsmtpd/tree/master and click on the "fork"
|
||||||
|
button to get your own repository.
|
||||||
|
|
||||||
|
=head3 Making a working Copy
|
||||||
|
|
||||||
|
git clone git@github.com:username/qpsmtpd qpsmtpd
|
||||||
|
|
||||||
|
will check out your copy into a directory called qpsmtpd
|
||||||
|
|
||||||
|
=head3 Committing a change
|
||||||
|
|
||||||
|
Edit the appropriate files, and be sure to run the test suite.
|
||||||
|
|
||||||
|
emacs lib/Qpsmtpd.pm # for example
|
||||||
|
perl Makefile.PL
|
||||||
|
make test
|
||||||
|
|
||||||
|
When you're ready to check it in...
|
||||||
|
|
||||||
|
git add lib/Qpsmtpd.pm # to let git know you changed the file
|
||||||
|
git commit
|
||||||
|
git push origin # to send to github
|
||||||
|
|
||||||
|
=head3 Merging changes back in from the master repository
|
||||||
|
|
||||||
|
Tell git about the master repository. We're going to call it 'abh'
|
||||||
|
for now, but you could call it anything you want. You only have to do
|
||||||
|
this once.
|
||||||
|
|
||||||
|
git remote add abh git://github.com/abh/qpsmtpd.git
|
||||||
|
|
||||||
|
Pull in data from all remote branches
|
||||||
|
|
||||||
|
git remote update
|
||||||
|
|
||||||
|
Forward-port local commits to the updated upstream head
|
||||||
|
|
||||||
|
git rebase abh/master
|
||||||
|
|
||||||
|
If you have a change that conflicts with an upstream change (git will
|
||||||
|
let you know) you have two options. You can merge it and then commit
|
||||||
|
the merge, or you can skip it entirely:
|
||||||
|
|
||||||
|
git rebase --skip
|
||||||
|
|
||||||
|
Be sure to decide whether you're going to skip before you merge, or
|
||||||
|
you might get yourself into an odd situation.
|
||||||
|
|
||||||
|
Conflicts happen because upstream committers may make minor tweaks to
|
||||||
|
your change before applying it.
|
||||||
|
|
||||||
|
=head3 Throwing away changes
|
||||||
|
|
||||||
|
If you get your working copy into a state you don't like, you can
|
||||||
|
always revert to the last commit:
|
||||||
|
|
||||||
|
git reset --hard HEAD
|
||||||
|
|
||||||
|
=head3 Applying other peoples changes
|
||||||
|
|
||||||
|
One easy way to apply other peoples changes is to use C<git am>. That
|
||||||
|
will go ahead and commit the change. To modify it, you can use C<git
|
||||||
|
commit --amend>.
|
@ -368,6 +368,8 @@ B<NOTE:> BE CAREFUL! If you drop the connection legal MTAs will retry again
|
|||||||
and again, spammers will probably not. This is not RFC compliant and can lead
|
and again, spammers will probably not. This is not RFC compliant and can lead
|
||||||
to an unpredictable mess. Use with caution.
|
to an unpredictable mess. Use with caution.
|
||||||
|
|
||||||
|
B<NOTE:> This hook does not currently work in async mode.
|
||||||
|
|
||||||
Why this hook may be useful for you, see
|
Why this hook may be useful for you, see
|
||||||
L<http://www.nntp.perl.org/group/perl.qpsmtpd/2009/02/msg8502.html>, ff.
|
L<http://www.nntp.perl.org/group/perl.qpsmtpd/2009/02/msg8502.html>, ff.
|
||||||
|
|
||||||
|
@ -666,6 +666,8 @@ sub data_respond {
|
|||||||
|
|
||||||
$self->transaction->header($header);
|
$self->transaction->header($header);
|
||||||
|
|
||||||
|
# NOTE: This will not work properly under async. A
|
||||||
|
# data_headers_end_respond needs to be created.
|
||||||
my ($rc, $msg) = $self->run_hooks('data_headers_end');
|
my ($rc, $msg) = $self->run_hooks('data_headers_end');
|
||||||
if ($rc == DENY_DISCONNECT) {
|
if ($rc == DENY_DISCONNECT) {
|
||||||
$self->respond(554, $msg || "Message denied");
|
$self->respond(554, $msg || "Message denied");
|
||||||
|
70
plugins/random_error
Normal file
70
plugins/random_error
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
=head1 NAME
|
||||||
|
|
||||||
|
random_error
|
||||||
|
|
||||||
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
|
This plugin randomly disconnects and issues DENYSOFTs.
|
||||||
|
|
||||||
|
=head1 CONFIG
|
||||||
|
|
||||||
|
one parameter is allowed, which is how often to error, as a percentage
|
||||||
|
of messages. The default is 1. Use a negative number to disable.
|
||||||
|
|
||||||
|
2/5 of failures are DENYSOFT_DISOCNNECT, 3/5 simply DENYSOFT.
|
||||||
|
|
||||||
|
For use with other plugins, scribble the revised failure rate to
|
||||||
|
|
||||||
|
$self->qp->connection->notes('random_fail_%');
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub register {
|
||||||
|
my ($self, $qp, @args) = @_;
|
||||||
|
|
||||||
|
die "Invalid args: '@args'" unless @args < 2;
|
||||||
|
($self->{__PACKAGE__.'_how'}) = $args[0] || 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
sub NEXT() { DECLINED }
|
||||||
|
|
||||||
|
sub random_fail {
|
||||||
|
my $self = shift;
|
||||||
|
my $fpct = $self->qp->connection->notes('random_fail_%');
|
||||||
|
rand(100) > ($fpct / 6) and return NEXT;
|
||||||
|
rand(5) < 2 and return (DENYSOFT_DISCONNECT, "random failure");
|
||||||
|
return (DENYSOFT, "random failure");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub hook_connect {
|
||||||
|
$self->qp->connection->notes('random_fail_%', $self->{__PACKAGE__.'_how'});
|
||||||
|
goto &random_fail
|
||||||
|
}
|
||||||
|
|
||||||
|
sub hook_helo {
|
||||||
|
goto &random_fail
|
||||||
|
}
|
||||||
|
|
||||||
|
sub hook_ehlo {
|
||||||
|
goto &random_fail
|
||||||
|
}
|
||||||
|
|
||||||
|
sub hook_mail {
|
||||||
|
goto &random_fail
|
||||||
|
}
|
||||||
|
|
||||||
|
sub hook_rcpt {
|
||||||
|
goto &random_fail
|
||||||
|
}
|
||||||
|
|
||||||
|
sub hook_data {
|
||||||
|
goto &random_fail
|
||||||
|
}
|
||||||
|
|
||||||
|
sub hook_data_post {
|
||||||
|
goto &random_fail
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user