Re: DKIM plugin

2007-07-30 Thread Ask Bjørn Hansen


On Jul 25, 2007, at 13:59, Matthew Harrell wrote:


Okay, here's a working version of the plugin I have.


Awesome!

Any chance you can add them to the Google Issue tracker?

http://code.google.com/p/smtpd/issues/list


 - ask

--
http://develooper.com/ - http://askask.com/




Re: DKIM plugin

2007-07-30 Thread Matthew Harrell
 Awesome!

 Any chance you can add them to the Google Issue tracker?

   http://code.google.com/p/smtpd/issues/list

Does it work alright for you?  I have slightly updated versions here

http://alecto.bittwiddlers.com/files/qpsmtpd/dkimsign
http://alecto.bittwiddlers.com/files/qpsmtpd/dkimcheck

which have a size check since it put a seriously high load on my computer
when I sent a 12 MB message.  Those are the latest versions I'm running

I didn't even know about the Issue Tracker but I'll check into it this 
afternoon and see what I have to do.  I know there are a number of 
improvements that could be made to the programs

-- 
  Matthew Harrell  I don't suffer from insanity - 
  Bit Twiddlers, Inc.   I enjoy every minute of it.
  [EMAIL PROTECTED] 


Correcting $self-config('me')?

2007-07-30 Thread Peter Eisch

If this is changed in 0.40 this might be my reason to migrate from 0.32...

I'd like the $self-config('me') value to change to match the the in-addr
resolution of the local IP on the session.

I'm looking at hacking this into place and I'm wondering the proper way to
update away from `hostname`.  One change includes the parameter to the
Qpsmtpd::STMP-start() and then store it in a local var.  If that var is
undef, then use $self-config{'me') as default.

The end goal is to reflect the right hostname in the 220 opening banner on
systems which have multiple IPs.

Ideas?

peter



Re: Correcting $self-config('me')?

2007-07-30 Thread Peter Eisch

Thanks for the comments off-list so far.  I built a patch:

  http://peter.boku.net/hostname.patch

That isn't as pretty as it could be to do morph the hostname based on the
local IP.

I really don't like the 'use Socket;' in the lib/Apace/Qpsmtpd.pm -- never
mind my bad form for using it where I do -- but I can't see an equivalent
mod_perl kind of call.  Even with HostnameLookups On it never returns me
the hostname.

I'm open to comments before making a formal patch...

peter



Re: Correcting $self-config('me')?

2007-07-30 Thread Peter J. Holzer
On 2007-07-30 14:56:47 -0500, Peter Eisch wrote:
 Thanks for the comments off-list so far.  I built a patch:
 
   http://peter.boku.net/hostname.patch
 
 That isn't as pretty as it could be to do morph the hostname based on the
 local IP.

Have a look at
http://svn.perl.org/viewcvs/qpsmtpd/contrib/hjp/config_me_localaddr/config_me_localaddr?view=markuprev=716

Does this do what you want?

If it does, and nobody objects, I could move it from contrib to the
regular plugins directory.

hp

-- 
   _  | Peter J. Holzer| I know I'd be respectful of a pirate 
|_|_) | Sysadmin WSR   | with an emu on his shoulder.
| |   | [EMAIL PROTECTED] |
__/   | http://www.hjp.at/ |-- Sam in Freefall


signature.asc
Description: Digital signature


Re: Correcting $self-config('me')?

2007-07-30 Thread Ask Bjørn Hansen

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On Jul 30, 2007, at 3:11 PM, Peter J. Holzer wrote:


Have a look at
http://svn.perl.org/viewcvs/qpsmtpd/contrib/hjp/config_me_localaddr/ 
config_me_localaddr?view=markuprev=716


Does this do what you want?

If it does, and nobody objects, I could move it from contrib to the
regular plugins directory.


Into plugins/config/  I think  ...

You should update it so it'd fallback to use the IP address if it  
can't get a name or the regular config(me) if it can't get an IP  
address or name.  ... Or some variation of that.



 - ask

- --
http://develooper.com/ - http://askask.com/


-BEGIN PGP SIGNATURE-

iQCVAwUBRq5kcPkoKP1ixIspAQJ6KwQAgVLhOHrLPvi4V4PaEKn+U8jtN47452Jz
yf1Emq6dMe+3N7840vQFgnf28fGLEApRFqVwEsElKZOsXuVMcW7rYQrUh11GZDJb
MunGFkJ8h81k615QthAQte5Ozjj9CcA+CYiLTnGl0S+/4kVUpXwyOmlxkWSdorCg
oesKCQa322w=
=plkf
-END PGP SIGNATURE-


Re: Correcting $self-config('me')?

2007-07-30 Thread Peter Eisch
On 7/30/07 5:11 PM, Peter J. Holzer [EMAIL PROTECTED] wrote:

 Have a look at
 http://svn.perl.org/viewcvs/qpsmtpd/contrib/hjp/config_me_localaddr/config_me_
 localaddr?view=markuprev=716
 
 Does this do what you want?
 

It does.  I have to patch lib/Apache/Qpsmtpd.pm with:

--- qpsmtpd.orig/lib/Apache/Qpsmtpd.pm  2006-02-26 06:22:16.0 -0600
+++ qpsmtpd/lib/Apache/Qpsmtpd.pm   2007-07-30 18:00:17.0 -0500
@@ -62,6 +62,7 @@ sub start_connection {
 remote_info = $remote_info,
 remote_ip   = $remote_ip,
 remote_host = $remote_host,
+local_ip= $opts{conn}-local_ip,
 @_);
 }
 

Then, in your plugin using Ask's suggestion:

--- config_me_localaddr.orig2007-07-30 18:03:10.0 -0500
+++ config_me_localaddr 2007-07-30 17:56:59.0 -0500
@@ -35,7 +35,7 @@ sub hook_config {
 my $local_ip;
 unless ($self-connection  $self-connection-local_ip) {
$self-log(LOGNOTICE, cannot determnine locak IP address of
connection);
-   return DECLINED;
+   return(DECLINED, `hostname`);
 }
 $local_ip =  $self-connection-local_ip;
 my $local_name = gethostbyaddr(inet_aton($local_ip), AF_INET);

Life is good, thank you!

peter




Re: Correcting $self-config('me')?

2007-07-30 Thread Ask Bjørn Hansen


On Jul 30, 2007, at 4:18 PM, Peter Eisch wrote:


It does.  I have to patch lib/Apache/Qpsmtpd.pm with:


I don't think I agree entirely with the plugin -- It'd be better to  
fallback to config(me) than to hostname (oh, and doing that with  
backticks is just evil - there's a module for that).


The Apache::Qpsmtpd patch looks good though - applied to trunk r761.


  - ask

--
http://develooper.com/ - http://askask.com/




shutdown hook for plugins?

2007-07-30 Thread Matthew Harrell

When writing a plugin I can do initialization stuff in the register method.
Is there a method I can use that will be called when qpsmtpd is shutting
down?  There's an RRD plugin I'm fiddling with and I would prefer ending
the DB connection when everything shuts down rather than opening and
closing it each time

-- 
  Matthew Harrell  Dogs have masters,
  Bit Twiddlers, Inc.   cats have staff
  [EMAIL PROTECTED]


Re: Correcting $self-config('me')?

2007-07-30 Thread Robert Spier
 +   return(DECLINED, `hostname`);

Do not do this.

-R


Re: Correcting $self-config('me')?

2007-07-30 Thread Peter Eisch
On 7/30/07 9:14 PM, Robert Spier [EMAIL PROTECTED] wrote:

 +   return(DECLINED, `hostname`);
 
 Do not do this.
 

Ah, I appreciate the most excellent here's how to do this suggestion you
contribute here.

So, drop the backticks and call hostname like Qpsmtpd.pm does?

Duly noted.