Commit Graph

50 Commits

Author SHA1 Message Date
Robert
461dabc3e1 Revert "Spool body when $transaction->body_fh() is called"
This reverts commit a52660a646.

See http://www.nntp.perl.org/group/perl.qpsmtpd/2010/10/msg9453.html for discussion.
2010-10-29 22:23:58 -07:00
Jared Johnson
96aa5ba171 Shorten/clarify Connection and Transaction notes()
Update Qpsmtpd::Connection::notes() and Qpsmtpd::Transaction::notes()
with clearer, more brief syntax.  A previous patch used seemingly better
syntax, but did not evaluate the size of @_ in order to distinguish
between a call to notes('arg1',undef) and notes('arg1').  This corrects
this issue, and adds a comment to that effect.
2010-09-15 14:32:53 +08:00
jaredj
a52660a646 Spool body when $transaction->body_fh() is called
Qpsmtpd::Transaction::body_filename() calls $self->body_spool() if the
message body has not already been spool to disk.  This adds the same
check to Qpsmtpd::Transaction::body_fh()
2009-09-15 14:41:05 -07:00
Jared Johnson
16b4dbcd81 Add dup_body_fh to return a dup'd body FH
It wasn't suitable to dup the body FH returned by plain old
body_fh(), so here's a separate function to return that.

Signed-off-by: Ask Bjørn Hansen <ask@develooper.com>
2009-09-15 14:39:50 -07:00
jaredj
22a0da47d8 Change transaction->add_recipient to prevent adding undef/empty recipients
Improve Qpsmtpd::Transaction::add_recipient syntax

Update Qpsmtpd::Transaction::add_recipient to use slightly clearer
language, and add 'if $rcpt' to prevent undef recipients from
being added -- in this case, the '@_ and' syntax allowing this set
method to set undef is undesirable, since you shouldn't be adding undef as
a recipient.

Signed-off-by: Ask Bjørn Hansen <ask@develooper.com>
2009-03-02 12:52:10 -08:00
jaredj
2e552d2297 Add Qpsmtpd::Transaction::remove_recipient()
Add remove_recipient() to Qpsmtpd::Transaction, a counterpart to
add_recipient().

Signed-off-by: Ask Bjørn Hansen <ask@develooper.com>
2009-02-27 00:47:52 -08:00
Robert
01e2190a63 Revert "Add notes to Qpsmtpd::Address class"
This reverts commit ea86b9fdb2.

Jared said...
I originally considered these functionally identical, but they are
not. The new code, called with, say, $txn->notes('discard',undef),
would result in evaluation as if it were a 'get' method rather than
setting the 'discard' note to undef.  That seems quite dangerous.  I
suggest either reverting the language back to the '@_ and' model, or
else doing something like:
2009-02-12 21:00:16 -08:00
Jared Johnson
ea86b9fdb2 Add notes to Qpsmtpd::Address class
standardize other notes calls
2009-02-08 22:38:03 -08:00
Hanno Hecker
7d4605fdbc remove the connection / transaction id feature for 0.42 release
- add back in after 0.42 is out? if yes: start implementing in -prefork 


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@809 958fd67b-6ff1-0310-b445-bb7760255be9
2007-10-09 12:00:43 +00:00
Peter J. Holzer
af82701fff New id scheme: Start with a unique id for the Qpsmtpd::SMTP object,
then derive ids for connections and transactions from that via
simple counters.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@785 958fd67b-6ff1-0310-b445-bb7760255be9
2007-09-02 10:50:23 +00:00
Matt Sergeant
610672cb5f Switch rand() part of id to a sequence
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@782 958fd67b-6ff1-0310-b445-bb7760255be9
2007-08-30 20:50:39 +00:00
Peter J. Holzer
b57ee765de fixed assignment (=> instead of =).
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@779 958fd67b-6ff1-0310-b445-bb7760255be9
2007-08-30 20:18:42 +00:00
Matt Sergeant
e6113d586d More changes to the id generator
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@778 958fd67b-6ff1-0310-b445-bb7760255be9
2007-08-29 21:50:53 +00:00
Matt Sergeant
bf5d011d85 Update id generator again
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@777 958fd67b-6ff1-0310-b445-bb7760255be9
2007-08-29 21:37:33 +00:00
Matt Sergeant
3a85914315 Fixed local_port => remote_port
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@776 958fd67b-6ff1-0310-b445-bb7760255be9
2007-08-28 20:12:21 +00:00
Matt Sergeant
a7914ac0dc Support for $transaction->id to get a unique id for this transaction
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@775 958fd67b-6ff1-0310-b445-bb7760255be9
2007-08-28 18:42:01 +00:00
Hanno Hecker
ad541f6207 Qpsmtpd::Transaction: add body_fh(), body_length() and data_size(),
depreceated body_size()


git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@689 958fd67b-6ff1-0310-b445-bb7760255be9
2006-12-16 11:56:48 +00:00
John Peacock
e67bbed2ac * lib/Qpsmtpd/Transaction.pm
Doh!  I should flush() not close(), since other code assume the handle
    is still active.

git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.31@554 958fd67b-6ff1-0310-b445-bb7760255be9
2005-10-20 18:47:28 +00:00
John Peacock
a8b6956d81 * lib/Qpsmtpd/Transaction.pm
Fix fairly egregious error.  If the size_threashold is smaller than
    the body while writing, the file handle would be closed prematurely.
    Ouch.  I don't like it here from a stylistic point of view, but at 
    least it will actually work now.

git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.31@553 958fd67b-6ff1-0310-b445-bb7760255be9
2005-10-20 02:10:32 +00:00
John Peacock
b808a139cf * lib/Qpsmtpd/Transaction.pm
IO::File is buffering the message, so that the AV software doesn't get a
  a chance to scan anything when size_threshold > 0.

* qpsmtpd
  Apparently no one is running tcpserver any longer, since it wasn't loading
  the plugins anymore.

git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.31@550 958fd67b-6ff1-0310-b445-bb7760255be9
2005-09-23 19:16:37 +00:00
John Peacock
9cbf206a4a * lib/Qpsmtpd/TcpServer.pm
Don't try to load the plugins if they are already loaded.

* lib/Qpsmtpd/Transaction.pm
  Get the size_threshold by inheritance.
  Extract the spooling of the body as a new sub.
  Always spool the body when calling body_filename().
  Compare the body_size to the cached size_threshold.

* lib/Qpsmtpd.pm
  Cache the size_threshold and provide an accessor method.

* qpsmtpd-forkserver
  Initialize both the spool_dir and size_threshold caches before forking.

git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.31@547 958fd67b-6ff1-0310-b445-bb7760255be9
2005-09-22 17:14:20 +00:00
Matt Sergeant
26c40f989b Fix for in-memory code writing headers twice
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@423 958fd67b-6ff1-0310-b445-bb7760255be9
2005-05-20 12:39:29 +00:00
Matt Sergeant
6ecc991a20 body_write patches from Brian Grossman
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@394 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-10 18:18:28 +00:00
Matt Sergeant
321622f0aa Store mail in memory up to a certain threshold (default 10k).
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@385 958fd67b-6ff1-0310-b445-bb7760255be9
2005-03-08 18:09:49 +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
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
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
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
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
Robert Spier
bd8cfde4c1 From: John Peacock <jpeacock@rowman.com>
To: qpsmtpd@perl.org
Subject: [PATCH] Another helper function to Qsmtpd::Transaction
Message-ID: <20040714143407.32740.qmail@onion.perl.org>
Date: Wed, 14 Jul 2004 10:34:25 -0400

The AV scanner plugin I am currently using (uvscan) requires the
attached patch so that it can scan the existing temp file, rather than
making a copy just for the scan.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@267 958fd67b-6ff1-0310-b445-bb7760255be9
2004-07-16 05:04:25 +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
Devin Carraway
ae24115d06 When spool_dir has improper permissions, mention what spool_dir is set to.
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@250 958fd67b-6ff1-0310-b445-bb7760255be9
2004-06-28 00:00:51 +00:00
Devin Carraway
0f35f241b7 When creation of spool_dir fails, report what dir it was trying to make.
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@249 958fd67b-6ff1-0310-b445-bb7760255be9
2004-06-27 23:39:32 +00:00
Matt Sergeant
8d07a36fcc Add a relaying() method to the transaction
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@247 958fd67b-6ff1-0310-b445-bb7760255be9
2004-06-16 20:28:57 +00:00
Matt Sergeant
2892df687a Cleanup docs to look nicer under perldoc
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@238 958fd67b-6ff1-0310-b445-bb7760255be9
2004-06-07 18:48:52 +00:00
Ask Bjørn Hansen
bbc36670f7 + Create temp files with permissions 0600 (thanks to Robert James Kaes again)
+
+  Fix warning in check_badrcptto plugin (Thanks to Robert James Kaes)


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@230 958fd67b-6ff1-0310-b445-bb7760255be9
2004-04-21 12:42:45 +00:00
Matt Sergeant
3d2feb8953 Forgot to add in Constants here for logging
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@226 958fd67b-6ff1-0310-b445-bb7760255be9
2004-03-14 22:35:51 +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
8c52b83ab2 nuke the unused and incorrect add_header_line method
clarify when notes gets reset


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@152 958fd67b-6ff1-0310-b445-bb7760255be9
2003-06-10 10:15:42 +00:00
Matt Sergeant
2999d7cccd Added docs
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@147 958fd67b-6ff1-0310-b445-bb7760255be9
2003-06-09 13:45:29 +00:00
Ask Bjørn Hansen
c68e306d17 Don't break under taint mode on OpenBSD. (thanks to Frank Denis /
Jedi/Sector One)


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@141 958fd67b-6ff1-0310-b445-bb7760255be9
2003-04-21 08:23:35 +00:00
Ask Bjørn Hansen
806fcf25e8 Reorganize most of Qpsmtpd.pm into Qpsmtpd/SMTP.pm.
Add spool_dir option (thanks to Ross Mueller <ross@visual.com>)

  Add plugin name to the "hooks" data structure, so we can log plugin
  module had an error when we run a hook.


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@78 958fd67b-6ff1-0310-b445-bb7760255be9
2002-09-24 10:56:35 +00:00
Ask Bjørn Hansen
a1d52491bf blocked() is no longer supported in Qpsmtpd.pm; we can put it back
when qpsmtpd supports plugins accessing the message line by line as we
receive the data.


git-svn-id: https://svn.perl.org/qpsmtpd/branches/v010@51 958fd67b-6ff1-0310-b445-bb7760255be9
2002-09-08 10:05:36 +00:00
Ask Bjørn Hansen
be25aa03e6 delete the spool file when we are done with it
git-svn-id: https://svn.perl.org/qpsmtpd/branches/v010@44 958fd67b-6ff1-0310-b445-bb7760255be9
2002-08-06 13:04:51 +00:00
Ask Bjørn Hansen
2ee95fc3fc only send messages smaller than 500000 bytes to spamd
git-svn-id: https://svn.perl.org/qpsmtpd/branches/v010@42 958fd67b-6ff1-0310-b445-bb7760255be9
2002-08-06 12:57:59 +00:00
Ask Bjørn Hansen
8ce8427bf9 data_post hook
spamassassin plugin


git-svn-id: https://svn.perl.org/qpsmtpd/branches/v010@38 958fd67b-6ff1-0310-b445-bb7760255be9
2002-08-06 12:01:22 +00:00
Ask Bjørn Hansen
2fe35f1b8d yay, plugin support works! :-D
git-svn-id: https://svn.perl.org/qpsmtpd/branches/v010@34 958fd67b-6ff1-0310-b445-bb7760255be9
2002-07-08 02:30:11 +00:00
Ask Bjørn Hansen
3e5de3a0b3 separate queue method called from data.
store the header in a Mail::Header object for easier processing by the plugins


git-svn-id: https://svn.perl.org/qpsmtpd/branches/v010@29 958fd67b-6ff1-0310-b445-bb7760255be9
2002-07-06 02:09:01 +00:00
Ask Bjørn Hansen
bcd0d6d534 data method; we can now receive mails with this...
git-svn-id: https://svn.perl.org/qpsmtpd/branches/v010@28 958fd67b-6ff1-0310-b445-bb7760255be9
2002-07-04 01:45:19 +00:00
Ask Bjørn Hansen
6df92cd56e half baked version of the new object mail engine
(note the branch, v010)


git-svn-id: https://svn.perl.org/qpsmtpd/branches/v010@23 958fd67b-6ff1-0310-b445-bb7760255be9
2002-07-03 13:10:44 +00:00