Commit Graph

172 Commits

Author SHA1 Message Date
Matt Sergeant
726128aef6 Fixed typo in post_loop_callback name
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@414 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-09 13:49:40 +00:00
Matt Sergeant
8dad7435e5 Large number of patches from Brian Grossman to fix a number of bugs
Implement connection timeout


git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@413 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-09 13:43:40 +00:00
Matt Sergeant
46cda05112 Much improved config server, especially the stats
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@410 958fd67b-6ff1-0310-b445-bb7760255be9
2005-04-28 21:38:43 +00:00
Matt Sergeant
cefae57394 Call PostEventLoop at end of Epoll event loop (same as poll() and kqueue)
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@408 958fd67b-6ff1-0310-b445-bb7760255be9
2005-04-28 21:37:01 +00:00
Matt Sergeant
536e1723c1 Added rudimentary configuration server when running in non-forking poll mode
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@407 958fd67b-6ff1-0310-b445-bb7760255be9
2005-04-26 02:46:45 +00:00
Matt Sergeant
ed4e06bcd2 Fix timeout code kicking in when PTR result is blank domain
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@396 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-11 20:09:30 +00:00
Matt Sergeant
41e13e7454 body_write patches from Brian Grossman
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@395 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-10 18:19:27 +00:00
Ask Bjørn Hansen
58f03e5787 tweaks to make it work with tcpserver
the check_earlytalker fix was entirely wrong


git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@393 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-09 00:28:49 +00:00
Matt Sergeant
8588a066d2 Fix strictness
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@390 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-08 23:32:25 +00:00
Matt Sergeant
b5b3950ef9 Main initial work on poll server.
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@388 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-08 22:52:23 +00:00
Matt Sergeant
3922235bcf Import Danga libraries. This is a bit evil but we'll just have to track them
from the Danga project. This way we get something stable that we know works,
plus nobody has to go and track down other libraries.

Note that only Danga::Socket is (C) Danga. Everything else is original code
and (C) Matt Sergeant.


git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@387 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-08 19:59:45 +00:00
Matt Sergeant
12ae226ad7 high performance branch
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@386 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-08 19:56:15 +00:00
Ask Bjørn Hansen
db546fe91c prepare 0.29
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@379 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-03 02:30:16 +00:00
John Peacock
ec7aff1415 * lib/Qpsmtpd.pm
Use package lexical to cache spool dir location instead of storing in
    Transaction or other high level object


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@376 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-01 14:33:26 +00:00
John Peacock
f82dffe5ce * lib/Qpsmtpd/SMTP.pm
Copy all lines of incoming message to spool file and keep track of
    where the body lines started (ease use of inplace scanning for
    viruses).

*   lib/Qpsmtpd/Transaction.pm
    New function body_start() to get/set the body in spool file
    Tweak body_resetpos() and body_getline() to use body_start instead of 0


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@375 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-01 14:31:25 +00:00
John Peacock
e503c04ed2 * lib/Qpsmtpd/SMTP.pm
Require a domain/address be given in HELO or EHLO command


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@374 958fd67b-6ff1-0310-b445-bb7760255be9
2005-02-25 16:18:08 +00:00
John Peacock
bb36c60b6a Abstracted spool_dir creation and added temp_file() and temp_dir() subs to
make it easier for plugins to manage temporary workspace.  Also add POD and
tests for the new functions.  Still need to add tests to the temp_*() calls
from a plugin.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@369 958fd67b-6ff1-0310-b445-bb7760255be9
2005-02-22 02:47:39 +00:00
Ask Bjørn Hansen
d0b9558ce9 APR::Bucket API changed...
From: peter[at]boku.net (Peter Eisch)
Message-ID: <BE3F8D10.1C451%peter[at]boku.net>
Subject: Apache::Qpsmptd.pm patch
Date: Mon, 21 Feb 2005 13:05:20 -0600


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@367 958fd67b-6ff1-0310-b445-bb7760255be9
2005-02-21 21:48:45 +00:00
John Peacock
31a8e7d438 Lets the data hook handle missing envelope sender/recipient,
then falls back to the builtin 503 response (Brian Gross)


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@359 958fd67b-6ff1-0310-b445-bb7760255be9
2005-01-30 17:40:11 +00:00
Matt Sergeant
d26797c6d2 Make the original string available in the Connection notes
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@357 958fd67b-6ff1-0310-b445-bb7760255be9
2005-01-30 05:40:24 +00:00
John Peacock
c840a1d04f Changes by jpeacock@cpan.org (John Peacock)
o plugins/check_badmailfromto
    - New plugin in the style of check_badmailfrom, which matches a pair
      of FROM/TO and makes it seem like the recipient's address no longer
      exists (but only from the matching sender's point of view).  Useful
      for stalkers and other harassment cases.

o plugins/dns_whitelist_soft
    - New plugin to provide a DNS-based whitelist (good for distributed
      sites).

o various files
    - Replaced tab character with 8 spaces and adjusted line breaks for
      better readability.

Changes by mct@toren.net (Michael C. Toren)

o lib/Qpsmtpd/SMTP.pm

    - Assumes a MAIL FROM value of "<#@[]>" (utilized by qmail to
      indicate a null sender when generating a doublebounce message)
      is equivalent to "<>".  Previously qpsmtpd complained that the
      value could not be parsed.

    - Adds LOGIN to the default list of supported auth mechanisms.
      The documentation in Auth.pm indicated that auth-login was not
      currently supported due to lack of functionality, however I can
      confirm that LOGIN appears to work fine as tested by using msmtp
      (http://msmtp.sourceforge.net/).  Are there any indications that
      LOGIN support is actually broken in the current implementation?

    - Removes the "X-Qpsmtpd-Auth: True" header appended when a message
      has been sent by an authenticated user.  One problem with such a
      header is that it's impossible to say which SMTP hop added it,
      and it provides no information which could be used to backtrack
      the transaction.  I grepped through my mail archives a bit
      looking for how other MTAs handled the problem, and decided it
      would be best to place this information in the Received: header:

        Received: from remotehost (HELO remotehost) (192.168.42.42)
          (smtp-auth username foo, mechanism cram-md5)
          by mail.netisland.net (qpsmtpd/0.28) with ESMTP; <date>


o lib/Qpsmtpd/Auth.pm:

    - Documentation update for the arguments passed to an auth
      handler; previously the $mechanism argument was not mentioned,
      which threw off the argument offsets.

    - Documentation update for auth-login removing the warning
      that auth-login is not currently supported due to lack of
      functionality.

    - Fix to execute a generic auth hook when a more specific
      auth-$mechanism hook does not exist.  (Previously posted
      to the list last week.)

    - Upon authentication, sets $session->{_auth_user} and
      $session->{_auth_mechanism} so that SMTP.pm can include them
      in the Received: header.


o plugins/queue/qmail-queue

    - Added a timestamp and the qmail-queue qp identifier to the
      "Queued!" 250 message, for compatibility with qmail-smtpd, which
      can be very useful for tracking message delivery from machine to
      machine.  For example, the new 250 message might be:

        250 Queued! 1105927468 qp 3210 <1105927457@netisland.net>

      qmail-smtpd returns:

        250 ok 1106546213 qp 7129

      Additionally, for consistency angle brackets are placed around
      the Message-ID displayed in the 250 if they were missing in the
      message header.


o plugins/check_badmailfrom:

    - Changed the error message from "Mail from $bad not accepted
      here" to "sorry, your envelope sender is in my badmailfrom
      list", for compatibility with qmail-smtpd.  I didn't see any
      reason to share with the sender the value of $bad, especially
      for situations where the sender was rejected resulting from a
      wildcard.


o plugins/check_earlytalker:
o plugins/require_resolvable_fromhost:

    - No longer checks for earlytalkers or resolvable senders if the
      connection note "whitelistclient" is set, which is nice for
      helping backup MX hosts empty their queue faster.


o plugins/count_unrecognized_commands:

    - Return code changed from DENY_DISCONNECT, which isn't valid in
      an unrecognized_command hook, to DENY, which in this context
      drops the connection anyway.  (Previously posted to the list
      last week.)


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@356 958fd67b-6ff1-0310-b445-bb7760255be9
2005-01-28 03:30:50 +00:00
Robert Spier
0a2fc866de - logging tweaks..
- move some things to more appropriate levels
   - make 'running plugin' more interesting


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@348 958fd67b-6ff1-0310-b445-bb7760255be9
2004-11-27 06:46:21 +00:00
Robert Spier
1670530a1a more logging
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@347 958fd67b-6ff1-0310-b445-bb7760255be9
2004-11-27 06:41:06 +00:00
Robert Spier
e10bb78cd3 - modify some comments about timeouts
- remove extraneous pid's from log messages


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@346 958fd67b-6ff1-0310-b445-bb7760255be9
2004-11-27 06:38:32 +00:00
Robert Spier
ebcb01a54f Subject: [PATCH] Use timeoutsmtpd as well as timeout
from Justin Erenkrantz and John Peacock


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@344 958fd67b-6ff1-0310-b445-bb7760255be9
2004-11-25 19:50:18 +00:00
Matt Sergeant
09531ad70c To balance out with the rcpt logging diff'd against the CVS version
(peter@boku.net)


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@343 958fd67b-6ff1-0310-b445-bb7760255be9
2004-11-22 20:50:57 +00:00
Matt Sergeant
bfd609fb32 Fix timeout config warnings.
Fix alarm not being reset at end of while loop


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@342 958fd67b-6ff1-0310-b445-bb7760255be9
2004-11-19 08:44:24 +00:00
Matt Sergeant
4c44510191 Move plugin compile code into the Plugin module
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@341 958fd67b-6ff1-0310-b445-bb7760255be9
2004-11-18 19:47:10 +00:00
Matt Sergeant
e2bb53901d Connection handler for mod_perl/apache 2.0
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@334 958fd67b-6ff1-0310-b445-bb7760255be9
2004-10-12 07:39:04 +00:00
John Peacock
f6b01fb36b * lib/Qpsmtpd/Address.pm
Change subdomain regex to match single character subdomains
     (Robert Spier)


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@332 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-24 18:56:35 +00:00
John Peacock
b5ef3d3add Couple of minor cleanups
*    lib/Qpsmtpd/Transaction.pm
     Forgot to nuke POD for deprecated relaying()

*    plugins/auth/auth_vpopmail_sql
     Log who actually AUTHenticated

*    plugins/virus/uvscan
     Don't need to unlink the file (Qpsmtpd will take care of it)
     Log the machine that did the actual Antivirus scanning


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@329 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-23 18:54:58 +00:00
John Peacock
03455aff9a Add username for AUTH success/failure log entry
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@328 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-23 16:14:56 +00:00
John Peacock
b9646eef75 Remove the $transaction->relaying() code completely
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@327 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-23 13:51:09 +00:00
John Peacock
f92e99bd9c * plugins/check_relay
*   plugins/rcpt_ok
    Split check_relay into two plugins

*   config/plugins
    Reorder plugins to take advantage of the new check_relay

*   lib/Qpsmtpd/Connection.pm
    Add support for relay_client() method

*   lib/Qpsmtpd/SMTP.pm
    Copy connection relay settings to transaction object when created

*   lib/Qpsmtpd/Auth.pm
    Use the connection->relay_client() instead of setting an env var


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@326 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-22 16:01:16 +00:00
Matt Sergeant
11c12711ee Fix deny plugin which stopped working.
Call deny plugin for _DISCONNECT constants.
Make Plugin.pm %hooks a global rather than lexical so we can do evil things later.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@320 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-19 18:49:05 +00:00
Matt Sergeant
d86da9f944 Make recipients a setter too
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@319 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-16 10:46:38 +00:00
Matt Sergeant
8c37005161 Use a method for getting a line, so we can subclass it.
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@316 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-14 05:48:39 +00:00
Matt Sergeant
9224e436bb Plugin testing framework.
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@313 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-08 16:26:33 +00:00
Robert Spier
0b16ec9418 plugin wrapping:
replace wrap_plugin implementation with
  isa_plugin inheritance based implementation


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@312 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-08 05:14:10 +00:00
Robert Spier
fb3f0b4604 Matt says wipe it!
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@311 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-07 15:08:26 +00:00
Robert Spier
fd1cf0b9b0 Qpsmtpd::TCPServer will handle calling load_plugins. We *really* only
want to call it once per process.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@310 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-07 05:50:36 +00:00
Robert Spier
ec5e23a28a Allow for multiple instances of a single plugin by using plugin:0
notation


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@308 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-07 05:35:16 +00:00
Robert Spier
96d66b8d46 Add the wrap_plugin function to allow for plugin wrapping
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@307 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-07 05:07:20 +00:00
Robert Spier
4d4baac96e Nick Leverton noticed I left out a very important 'ref'. Thanks Nick!
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@306 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-06 17:36:57 +00:00
Matt Sergeant
606519b06c Fix for hooks not running with previous patch, caused by qpsmtpd objects not
asking each plugin to register. There is slightly more overhead this way,
but it feels more correct, and we can fix the overhead later in a more clean
way.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@300 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-05 16:28:08 +00:00
Robert Spier
ee1017a1a4 VRFY plugin support
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@298 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-05 04:30:21 +00:00
Robert Spier
5128bd0718 new plugin output tracking
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@296 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-04 03:16:10 +00:00
Robert Spier
bdd20fed4d indentation and whitespace cleanup
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@295 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-04 00:57:16 +00:00
Robert Spier
e8bf8286fc reindent undef check
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@294 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-04 00:51:02 +00:00
Matt Sergeant
9d94f4d96a Pass extra "stuff" to HELO/EHLO callbacks
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@293 958fd67b-6ff1-0310-b445-bb7760255be9
2004-09-01 05:56:52 +00:00