Re: *sigh* performance issues again. Please help!

1999-07-28 Thread Tommi Virtanen

On Wed, Jul 28, 1999 at 10:32:00AM -0400, [EMAIL PROTECTED] wrote:
 This my friend so far seems to be the answer.  I'm using Bruce Guentner's
 qlogtools, qfilelog and this is the first time I've seen my

Where can I find these? qmail.org doesn't mention
either Guentner nor qlog.
-- 
Havoc Consulting | unix, linux, perl, mail, www, internet, security consulting
+358 50 5486010  | software development, unix administration, training



Re: All this talk about maximum speed

1999-07-14 Thread Tommi Virtanen

On Wed, Jul 14, 1999 at 12:53:03PM -0700, Mylo wrote:
   In the case of sending 250,000+ emails, this seems farely ugly in how many
   processes it'll be forking.  I guess qmail-inject is designed to be farely
   small, but our current process involes writing directly to disk qf and df
   files in sendmail.
  
  So call qmail-queue directly.
 I thought they were the same thing.  What's the difference?

You probably didn't understand what I was trying to say.
Inject say a thousand recipients in one qmail-queue
(or inject, or sendmail, if you wish) call. Make sure
you are not injecting them individually, if you can.
That way, the queue system has less work managing them.

The difference between sendmail-clone/qmail-inject/
qmail-queue is just the interface and the number of
execs needed. qmail-queue is closest to the raw
performance your IO subsystem is capable of.
-- 
Havoc Consulting | unix, linux, perl, mail, www, internet, security consulting
+358 50 5486010  | software development, unix administration, training



Re: All this talk about maximum speed

1999-07-14 Thread Tommi Virtanen

On Wed, Jul 14, 1999 at 01:08:20PM -0700, Mylo wrote:
 unfortunately each message is customized for each recipient with their account
 information, so I can't clone the same message to multiple recipients.  Which,
 as I understand it,  would require one qmail-inject (or qmail-queue) per 
 recipient.  Which is 250,000+ processes coming outta my perl script.  Although
 this machine is dedicated to this task,  that still seems like a nasty thing
 to do.  I'm just looking if there is any smooth way of stacking messages into
 a single pipe of qmail-inject or anything tricky like that to save the ammount
 of processes.  Thanks for your help :)

You can always open a pipe to qmail-smtpd, or qmail-qmtpd.
They'll happily eat all the messages from a pipe, but you
can't avoid the exec per queue injection. There just is no
way.

Are you sure the qmail-VERH patches won't solve your problem?
They allow you to embed the recipient address in the
message body without creating multiple queue messages.

-- 
Havoc Consulting | unix, linux, perl, mail, www, internet, security consulting
+358 50 5486010  | software development, unix administration, training



Re: Is qmail's log method inefficient?

1999-05-19 Thread Tommi Virtanen

On Tue, May 18, 1999 at 04:29:07PM +0200, Balazs Nagy wrote:
  If you run under tcpserver it's no problem to log to stderr. Everthing
  you print to stderr will appear in tcpserver's logfile. In fact I'm
  implementing that right now for qmail-smptd and qmail-pop3d.
 Yeah, but you *should* give a non-sensitive solution. If you use stderr for
 logging, you should remove the dup2ing fd 1 to fd 2 line, but it's for
 compatibility reasons among various inetd's.  By the way inetd (from
 netkit-base) actually dup2s fd 1 to fd 2, which will happily puts your logs
 to the socket.  Why do you want to determine qmail services whether it runs
 under tcpserver or not?  It's a very heavy compatibility issue.

What about djb's errorsto? If you made the pop3d etc
log to stderr, running them under tcpserver is trivial.
Couldn't they be made to work under inetd with errorsto?

Basically it's just
smtp stream tcp nowait qmaild errorsto splogger qmail-smtpd

-- 
Havoc Consulting | unix, linux, perl, mail, www, internet, security consulting
+358 50 5486010  | software development, unix administration, training



serialmail over ssh

1999-04-25 Thread Tommi Virtanen

Hi. Here's a small utility I wanted to share
(and get some peer review on;)

Serialmail seemed to me almost ideal for dialup
links. I never liked fetchmail.. But then again,
fetchmail could easily operate under ssh.

qmtpoverssh is a simple wrapper for serialqmtp
and qmail-qmtpd that runs under maildirserial.
It runs serialqmtp on one end but tunnels the
connection through ssh and runs qmail-qmtpd on
the other end (note qmail-qmtpd does not have to
be listening on a port - it will used directly).

Usage is like this:
maildirserial dir prefix qmtpoverssh prefix2 hostname user
prefix and prefix2 will usually be the same;
look at the documentation of maildirserial and 
serialqmtp. hostname and user specify where the
ssh connection will be made.

You have to have RSA authentication or something
similar for this to work. I suggest making a new
key with an empty password and limited access.

TODO:
give qmail-qmtpd some environment variables to
make it log information more nicely.

-- 
Havoc Consulting | unix, linux, perl, mail, www, internet, security consulting
+358 50 5486010  | software development, unix administration, training


#include unistd.h
#include stdio.h

/* maildirserial [-b] [-tlifetime] dir prefix 
 qmtpssh prefix2 host login */

#define PROGNAME "qmtpoverssh"
#define READ 0
#define WRITE 1

void fail(char *s) {
  fprintf(stderr,"%s: failure: %s\n",PROGNAME,s);
  exit(100);
}
void defer(char *s) {
  fprintf(stderr,"%s: deferral: %s\n",PROGNAME,s);
  exit(111);
}

int main (int argc, char **argv) {
  int pid;
  int toserial[2];
  int fromserial[2];
  if (argc4) { fail("usage: qmtpoverssh prefix host login."); }
  if (pipe(toserial)==-1) { defer("pipe to serialqmtp failed."); }
  if (pipe(fromserial)==-1) { defer("pipe from serialqmtp failed."); }
  pid=fork();
  if (pid==-1) { defer("fork failed."); }
  if (pid==0) { /* child */
if (dup2(toserial[READ],6)==-1) { defer("dup2 failed on stdin."); }
if (dup2(fromserial[WRITE],7)==-1) { defer("dup2 failed on stdout."); }
argv[0] = "serialqmtp";
argv[2] = NULL;
execvp("serialqmtp", argv);
defer("exec serialqmtp failed");
  }
  else { /* parent */
if (dup2(toserial[WRITE],1)==-1) { defer("dup2 failed on stdin."); }
if (dup2(fromserial[READ],0)==-1) { defer("dup2 failed on stdout."); }
execlp("ssh", "ssh","-q",argv[2],"-l",argv[3],"/usr/sbin/qmail-qmtpd");
defer("exec ssh failed");
  }
}