Commit Graph

51 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
Matt Sergeant
e6e2091ee0 Attempt to clean up circular refs problems
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@292 958fd67b-6ff1-0310-b445-bb7760255be9
2004-08-31 01:58:57 +00:00
Ask Bjørn Hansen
42719a179f support NULL envelopes again (doh, typo of the week :-) )
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@278 958fd67b-6ff1-0310-b445-bb7760255be9
2004-07-20 12:46:20 +00:00
Ask Bjørn Hansen
b9dca51d2a fix minor warning introduced with the data hook
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@270 958fd67b-6ff1-0310-b445-bb7760255be9
2004-07-16 09:44:39 +00:00
Matt Sergeant
c60710e871 Add a hook for the DATA command
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@269 958fd67b-6ff1-0310-b445-bb7760255be9
2004-07-16 07:27:26 +00:00
Robert Spier
de9a7fa02a Message-ID: <40F6EB78.1010107@rowman.com>
From: John Peacock <jpeacock@rowman.com>

Yeah, I was just noticing how odd it was that FROM was always logged
but TO wasn't logged at all.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@268 958fd67b-6ff1-0310-b445-bb7760255be9
2004-07-16 05:06:43 +00:00
Ask Bjørn Hansen
86c887fd59 take out spurious warning
improve address parsing a bit to make it easier to add parsing of MAIL
FROM extensions


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@263 958fd67b-6ff1-0310-b445-bb7760255be9
2004-07-16 02:22:11 +00:00
Ask Bjørn Hansen
87323ed62e Mail::Address does RFC822 addresses, we need SMTP addresses.
Replace Mail::Address with Peter J. Holzer's Qpsmtpd::Address module.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@261 958fd67b-6ff1-0310-b445-bb7760255be9
2004-07-14 23:58:47 +00:00
Matt Sergeant
011f44e11d Auth changes (John Peacock with minor modifications by baud)
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@252 958fd67b-6ff1-0310-b445-bb7760255be9
2004-06-29 21:45:35 +00:00
Robert Spier
ac9dd50928 DENY_DISCONNECT and DENYSOFT_DISCONNECT instead of *HARD
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@245 958fd67b-6ff1-0310-b445-bb7760255be9
2004-06-14 22:25:52 +00:00
Robert Spier
971b696ffa forgot another place to put DENYSOFTHARD
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@241 958fd67b-6ff1-0310-b445-bb7760255be9
2004-06-11 06:11:27 +00:00
Robert Spier
48d753ca25 add DENYSOFTHARD status
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@240 958fd67b-6ff1-0310-b445-bb7760255be9
2004-06-11 06:06:30 +00:00
Matt Sergeant
9c700b18e1 New for 0.28: Log levels and $Include for config/plugins
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@217 958fd67b-6ff1-0310-b445-bb7760255be9
2004-03-05 12:46:24 +00:00
Ask Bjørn Hansen
22523ead2d reject bare carriage-returns in addition to the bare line-feeds
(based on a patch from Robert James Kaes, thanks!)


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@209 958fd67b-6ff1-0310-b445-bb7760255be9
2004-03-04 04:30:02 +00:00
Ask Bjørn Hansen
9523d55cd7 reset_transaction is called after disconnect plugins are called so
the Transaction objects DESTROY method is called. (Thanks to Robert
  James Kaes <rjkaes@flarenet.com>)


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@207 958fd67b-6ff1-0310-b445-bb7760255be9
2004-02-24 10:31:12 +00:00
Ask Bjørn Hansen
dfb763acdf don't call exit from the SMTP object, call the disconnect method instead
minor tweaks


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@203 958fd67b-6ff1-0310-b445-bb7760255be9
2004-02-13 13:10:18 +00:00
Matt Sergeant
c567f3726a Support DENYHARD as response to RCPT
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@198 958fd67b-6ff1-0310-b445-bb7760255be9
2003-12-03 20:58:30 +00:00
Matt Sergeant
c4903199ff DENYHARD - allows you to DENY with a disconnect
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@196 958fd67b-6ff1-0310-b445-bb7760255be9
2003-12-03 08:07:36 +00:00
Matt Sergeant
c2fb24c4e4 Split received header so it doesn't exceed 78 chars
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@191 958fd67b-6ff1-0310-b445-bb7760255be9
2003-11-04 22:52:49 +00:00
Matt Sergeant
b442d002f1 Don't unfold header lines.
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@178 958fd67b-6ff1-0310-b445-bb7760255be9
2003-11-01 10:05:23 +00:00
Ask Bjørn Hansen
2a76892570 don't use Data::Dumper
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@172 958fd67b-6ff1-0310-b445-bb7760255be9
2003-09-15 10:50:27 +00:00
Ask Bjørn Hansen
891778b175 Say Received: ... via ESMTP instead of via SMTP when the client
speaks ESMTP.  (Hoping this can be a useful SpamAssassin rule).

Take out the X-SMTPD header.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@171 958fd67b-6ff1-0310-b445-bb7760255be9
2003-09-05 05:10:40 +00:00
Matt Sergeant
f7790c75fd Removed DISCARD
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@165 958fd67b-6ff1-0310-b445-bb7760255be9
2003-07-24 12:43:02 +00:00
Matt Sergeant
1e86299bf8 Added DISCARD option to DATA (body) checks
Added documentation to Constants.pm


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@158 958fd67b-6ff1-0310-b445-bb7760255be9
2003-06-24 07:42:38 +00:00
Ask Bjørn Hansen
c2b8e8aa19 Add not even halfbaked saslauth plugin. Hopefully it'll give us
SMTP AUTH some day.  :-)

  If a plugin running the ehlo hook add something to the ARRAY
  reference $self->transaction->notes('capabilities') then it will be
  added to the EHLO response.

  Add command_counter method to the SMTP object.  Plugins can use this
  to catch (or not) consecutive commands.  In particular useful with
  the unrecognized_command hook.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@144 958fd67b-6ff1-0310-b445-bb7760255be9
2003-04-21 09:42:01 +00:00
Ask Bjørn Hansen
933d76ecf9 Fixed timeout bug when the client sent DATA and then stopped before
sending the next line. (Gergely Risko <risko@risko.hu>)


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@138 958fd67b-6ff1-0310-b445-bb7760255be9
2003-04-15 18:10:44 +00:00
Ask Bjørn Hansen
f27b77ae61 unrecognized_command hook and a count_unrecognized_commands
plugin. (Rasjid Wilcox)


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@134 958fd67b-6ff1-0310-b445-bb7760255be9
2003-04-15 17:39:03 +00:00
Ask Bjørn Hansen
22ca786bac check_earlytalker plugin. Deny the connection if the client talks
before we show our SMTP banner.  (From Devin Carraway)

  Patch Qpsmtpd::SMTP to allow connect plugins to give DENY and
  DENYSOFT return codes.  Based on patch from Devin Carraway.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@133 958fd67b-6ff1-0310-b445-bb7760255be9
2003-04-15 17:01:43 +00:00
Ask Bjørn Hansen
5d34bad178 Date: Thu, 13 Mar 2003 00:57:39 -0800
From: Devin Carraway <qpsmtpd-list@devin.com>
To: qpsmtpd@perl.org
Subject: HELO hook and check plugin

Speaking of direct-to-MX spam, both AOL and Yahoo are large companies
with whole walls-full of servers devoted to mail delivery.  None of them
announce themselves with "HELO yahoo.com" or "HELO aol.com."  Spammers
certainly do, though.

Here's a patch to SMTP.pm to add hooks for HELO and EHLO, and a plugin
to use them.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@119 958fd67b-6ff1-0310-b445-bb7760255be9
2003-03-18 09:43:22 +00:00
Ask Bjørn Hansen
883b184a80 Use the proper RFC2822 date format in the Received headers. (Somehow
I had convinced myself that ISO8601 dates were okay). Thanks to
Kee Hinckley <nazgul@somewhere.com>.

Print the date in the local timezone instead of in -0000. (Not
entirely convinced this is a good idea)


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@116 958fd67b-6ff1-0310-b445-bb7760255be9
2003-02-06 05:17:28 +00:00
Ask Bjørn Hansen
efeb19129f Fix the "too many dots in the beginning of the line" bug.
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@105 958fd67b-6ff1-0310-b445-bb7760255be9
2002-12-09 09:08:09 +00:00
Ask Bjørn Hansen
2001523033 don't log the max size stuff at trace level 6
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@94 958fd67b-6ff1-0310-b445-bb7760255be9
2002-11-06 06:39:32 +00:00
Ask Bjørn Hansen
b556af398e Default DENYSOFT for the rcpt hook gave 550 code
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@92 958fd67b-6ff1-0310-b445-bb7760255be9
2002-10-25 00:24:54 +00:00
Ask Bjørn Hansen
208a0cd54c fix NOOP
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@88 958fd67b-6ff1-0310-b445-bb7760255be9
2002-10-14 05:47:25 +00:00
Ask Bjørn Hansen
97610b6840 Better installation instructions and error message when no plugin
allowed or denied relaying (thanks to Lars Rander
<lrNOSPAM@rander.dk>).


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@87 958fd67b-6ff1-0310-b445-bb7760255be9
2002-10-14 01:59:04 +00:00
Ask Bjørn Hansen
253eeee879 move the queue code to a plugin; document the queue plugin hook.
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@80 958fd67b-6ff1-0310-b445-bb7760255be9
2002-10-10 01:49:34 +00:00