John Wang | 1 Apr 2006 21:06
Picon

How to configure qpsmtpd with pperl

I'm trying to get qpsmtpd working with pperl and was wondering how to do it.

I tried following the README instructions by commenting out the
softlimit/tcpserver line and replacing it with the pperl line:

  pperl -Tw -- --prefork=$MAXCLIENTS --maxclients=$MAXCLIENTS \
    --no-cleanup ./qpsmtpd 2>&1

However, when I do this the TCPREMOTE* environment variables are no longer
set (b/c tcpserver isn't used) and Qpsmtpd::TcpServer dies with:

  Qpsmtpd::TcpServer must be started by tcpserver

Am I missing something?

My current setup is to edit the qpsmtpd script's shebang line to use pperl
instead of perl as described at:
http://www.pycs.net/lateral/stories/11.html. Then I patch
Qpsmtpd::TcpServer so it can use the socket to populate
$remote_(host|ip|info) and use xinetd as described by the patch set at:
http://www.hjp.at/(en)/projekte/qpsmtpd/tutorial.rxml

It works but it doesn't use the README syntax. What's the recommended way to
use qpsmtpd with pperl?

Thanks,
John
Robin Bowes | 1 Apr 2006 21:56
Favicon

Re: How to configure qpsmtpd with pperl

John Wang wrote:
> I'm trying to get qpsmtpd working with pperl and was wondering how to do it.
> 
> I tried following the README instructions by commenting out the
> softlimit/tcpserver line and replacing it with the pperl line:
> 
>   pperl -Tw -- --prefork=$MAXCLIENTS --maxclients=$MAXCLIENTS \
>     --no-cleanup ./qpsmtpd 2>&1
> 
> However, when I do this the TCPREMOTE* environment variables are no longer
> set (b/c tcpserver isn't used) and Qpsmtpd::TcpServer dies with:
> 
>   Qpsmtpd::TcpServer must be started by tcpserver
> 
> Am I missing something?
> 
> My current setup is to edit the qpsmtpd script's shebang line to use pperl
> instead of perl as described at:
> http://www.pycs.net/lateral/stories/11.html. Then I patch
> Qpsmtpd::TcpServer so it can use the socket to populate
> $remote_(host|ip|info) and use xinetd as described by the patch set at:
> http://www.hjp.at/(en)/projekte/qpsmtpd/tutorial.rxml
> 
> It works but it doesn't use the README syntax. What's the recommended way to
> use qpsmtpd with pperl?

Why would you want to use xinetd instead of tcpserver?

Also, I've found that qpsmtpd-forkserver works better than qpsmtpd with
pperl or speedy-cgi.
(Continue reading)

Charlie Brady | 1 Apr 2006 21:58
Picon
Picon

Re: How to configure qpsmtpd with pperl


On Sat, 1 Apr 2006, John Wang wrote:

> I'm trying to get qpsmtpd working with pperl and was wondering how to do it.

Why? Do you have a particular reason to not use forkserver?

Sorry if my question doesn't seem helpful, but it seems as though you are 
doing it the hard way, perhaps because you have only read old 
documentation.

---
Charlie

John Wang | 1 Apr 2006 23:51
Picon

Re: How to configure qpsmtpd with pperl

On 4/1/06, Robin Bowes wrote:
>
> Why would you want to use xinetd instead of tcpserver?

I'm using xinetd as a round about way to use pperl because the 0.32 README
recommends pperl for better performance (it mentions forkserver but seems to
recommend it as a backup choice when pperl is unstable). It says to change
the run script to use a pperl line provided. I'm assuming it means to use
pperl line instead of tcpserver since they both lines call the qpsmtpd
script, however if tcpserver isn't used, the TCPREMOTE* variables dont get
populated and Qpsmtpd::TcpServer dies. So something else is needed to
populate the $remote_(ip|host|info) variables in Qpsmtpd::TcpServer or it
won't run. Using the TcpServer socket patch, those variables can be
populated using xinetd.

For better performance, should one avoid tcpserver? Or have I read it wrong?

Also, I've found that qpsmtpd-forkserver works better than qpsmtpd with
> pperl or speedy-cgi.

What do you mean by works better? The README mentions in some environments
pperl is unstable but seems to imply pperl is faster than forkserver and
preferred when it's not unstable.

Should pperl ever be used over forkserver? The 0.32 README seems to say so
but perhaps that's not the case?

John
Ask Bjørn Hansen | 2 Apr 2006 00:13
Gravatar

Re: How to configure qpsmtpd with pperl


On Apr 1, 2006, at 1:51 PM, John Wang wrote:

> Should pperl ever be used over forkserver? The 0.32 README seems to  
> say so
> but perhaps that's not the case?

No, the README apparently needs updating. :-)  (Specifically it needs  
links to the wiki)

  - ask

--

-- 
http://www.askbjoernhansen.com/

John Wang | 2 Apr 2006 00:38
Picon

Danga based high performance version?

The qpsmtpd wiki's homepage mentions the following in the "Getting qpsmtpd"
section, however the link no longer exists:

> If you want to implement the Danga based high
> performance version checkout a copy of the
> high performance branch<http://svn.perl.org/viewcvs/qpsmtpd/branches/high_perf/>
.

Is there still a "Danga based high performance version", has this been
merged into the trunk, or has something else happened?

Thanks,
John
Ask Bjørn Hansen | 2 Apr 2006 01:02
Gravatar

Re: Danga based high performance version?


On Apr 1, 2006, at 2:38 PM, John Wang wrote:

> Is there still a "Danga based high performance version", has this been
> merged into the trunk, or has something else happened?

Hi John,

The Danga version is indeed in the trunk now.

The 0.3x releases are from the 0.3x branch[1].

The danga version isn't entirely stable yet.   We might move it back  
to a branch and the 0.3x code back to the trunk.

  - ask

[1] http://svn.perl.org/qpsmtpd/branches/0.3x/

--

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

John Wang | 2 Apr 2006 07:55
Picon

Apache::Qpsmtpd

I'm attempting to get qpsmtpd 0.32 Apache::Qpsmtpd working with Apache
2.0.55, mod_perl 2.0.2, and Postfix 2.2.9. When I configure httpd.conf as
shown in the SYNOPSIS, Apache will start and qpsmtpd will listen on port 25,
however, when I attempt to send an email it gets rejected with an error 450
("No plugin decided if relaying is allowed"). The Apache error_log shows the
from and to addresses. I believe the error is generated in Qpsmtpd::SMTP's
rcpt method on line 363.

The error in my client /var/log/maillog is:

Apr  1 21:26:13 www postfix/smtp[19425]: 608685B840A:
to=<john <at> www.mytodomain.com>, \
    relay=www.mytodomain.com[192.168.1.2], delay=0, status=deferred \
    (host www.mytodomain.com[192.168.1.2] said: 450 No plugin decided \
    if relaying is allowed (in reply to RCPT TO command))

A successful email using forkserver results in a client /var/log/maillog
entry:

Apr  1 22:33:50 www postfix/smtp[19717]: 2A7DE5B8412:
to=<john <at> www.mytodomain.com>, \
    relay=www.mytodomain.com[192.168.1.2], delay=3, status=sent \
    (250 Queued! <Pine.LNX.4.64.0604012233400.19711 <at> www.myfromdomain.com> \
    (Queue-Id: 94871220055))

What am I missing? Is there a fix for this?

Also, are there any known problems with Apache::Qpsmtpd aside from not
working with check_earlytalker. I've read that apache.org uses
Apache::Qpsmtpd so I assume it's reasonably stable. Is this true?
(Continue reading)

John Wang | 2 Apr 2006 08:13
Picon

Re: Apache::Qpsmtpd

On 4/1/06, John Wang <johncwang <at> gmail.com> wrote:
>
> I'm attempting to get qpsmtpd 0.32 Apache::Qpsmtpd working with Apache
> 2.0.55, mod_perl 2.0.2, and Postfix 2.2.9.
>
> What am I missing? Is there a fix for this?
>

I got this working after finding the Peter Eisch's post:

http://www.nntp.perl.org/group/perl.qpsmtpd/4650

Also, are there any known problems with Apache::Qpsmtpd aside from not
> working with check_earlytalker. I've read that apache.org uses
> Apache::Qpsmtpd so I assume it's reasonably stable. Is this true?
>

The post also indicates that Apache::Qpsmtpd won't be materially faster than
forkserver. If so, what's the primary motivation to use Apache::Qpsmtpd if
it won't work with check_earlytalker.

John
Hanno Hecker | 2 Apr 2006 10:34
Picon

Re: [perl #38747] RCPT TO addresses with spaces are not correctly parsed

On Fri, 17 Mar 2006 14:07:35 -0800
Ask Bjørn Hansen <ask <at> develooper.com> wrote:
> I'd like to see a patch that makes a better API for reading the  
> command and the command parameters.  The default can still be having  
> it space separated and provided in  <at> _, but the hacks in mail() and  
> rcpt() to read the rest aren't very nice so we should have an API to  
> make it neater.

Ok, here we go. 
The Qpsmtpd::Command module provides a parse() which does 3 things:
 - by default returning the line split()ed by space, as before.
 - on MAIL FROM:/RCPT TO: it parses the line by RFC 1869 (SMTP Service
   Extensions) rules
 - a plugin can do the parsing on it's own (...read: for all other
   plugins/the core) by supplying a parsing routine when returning from
   a _parse hook, see EXAMPLE in perldoc lib/Qpsmtpd/Command.pm

The rcpt and mail hooks now get a %param where all parameters from the
client are listed in lower case, i.e.
  sub hook_mail {
    my ($self, $transaction, $sender, %params) =  <at> _;
    if ($params{'body'} && uc($params{'body'}) eq 'BINARYMIME') {
    ...

> To add to the bikeshedding, I don't think it should be configurable  
> -- it'd be fun to require them and see how it goes.  If it doesn't  
> work well, then just make them optional again and a rcpt_pre plugin  
> can make them required for those who want that.  Options in the core  
> are bad, generally speaking.
This [accepting addresses without <>] is now a plugin
(Continue reading)


Gmane