qmail Digest 8 Apr 1999 10:00:01 -0000 Issue 604

Topics (messages 23972 through 24016):

Is the double bounce's envelope sender wrong?
        23972 by: [EMAIL PROTECTED]
        23990 by: "Fred Lindberg" <[EMAIL PROTECTED]>

QMTP suggestion
        23973 by: "Fred Lindberg" <[EMAIL PROTECTED]>
        23976 by: Chris Johnson <[EMAIL PROTECTED]>
        23983 by: Richard Letts <[EMAIL PROTECTED]>
        23986 by: "Chris Garrigues" <[EMAIL PROTECTED]>
        23988 by: "Fred Lindberg" <[EMAIL PROTECTED]>
        23991 by: Peter van Dijk <[EMAIL PROTECTED]>
        24001 by: "Peter C. Norton" <[EMAIL PROTECTED]>

I know this is possible, just not sure how to make it work
        23974 by: Donna Phillips <[EMAIL PROTECTED]>
        23975 by: Russell Nelson <[EMAIL PROTECTED]>
        23977 by: Harald Hanche-Olsen <[EMAIL PROTECTED]>

maildirserial -> ccMail Link fails
        23978 by: Dirk Vleugels <[EMAIL PROTECTED]>
        23985 by: Richard Letts <[EMAIL PROTECTED]>

ESMTP SIZE and qmail
        23979 by: Lee Shakespeare <[EMAIL PROTECTED]>
        24012 by: Anand Buddhdev <[EMAIL PROTECTED]>

Mail Message Replication.
        23980 by: R Aldridge <[EMAIL PROTECTED]>
        23981 by: Peter Gradwell <[EMAIL PROTECTED]>
        23987 by: Richard Letts <[EMAIL PROTECTED]>

Question regarding - in aliases.
        23982 by: Greg Moeller <[EMAIL PROTECTED]>
        23984 by: "Jay D. Dyson" <[EMAIL PROTECTED]>
        23989 by: Greg Moeller <[EMAIL PROTECTED]>
        23992 by: Justin Bell <[EMAIL PROTECTED]>
        23998 by: Spike <[EMAIL PROTECTED]>
        24003 by: Greg Moeller <[EMAIL PROTECTED]>
        24007 by: Greg Moeller <[EMAIL PROTECTED]>
        24008 by: "Peter C. Norton" <[EMAIL PROTECTED]>

bare LF's, how ?
        23993 by: Gordon Soukoreff <[EMAIL PROTECTED]>
        23994 by: Harald Hanche-Olsen <[EMAIL PROTECTED]>
        23999 by: "Scott D. Yelich" <[EMAIL PROTECTED]>

Where is others qmail-command?
        23995 by: Sean Lee <[EMAIL PROTECTED]>
        23997 by: "Fred Lindberg" <[EMAIL PROTECTED]>

Unable_to_chdir_to_maildir._(#4.2.1)
        23996 by: [EMAIL PROTECTED]
        24002 by: Chris Johnson <[EMAIL PROTECTED]>

Domain names in header records
        24000 by: John Conover <[EMAIL PROTECTED]>

As many of these things as I've done...
        24004 by: Vince Vielhaber <[EMAIL PROTECTED]>

baffling qmail error
        24005 by: "Adam D. McKenna" <[EMAIL PROTECTED]>
        24006 by: "Adam D. McKenna" <[EMAIL PROTECTED]>

Mickey Hates qmail
        24009 by: Gordon Soukoreff <[EMAIL PROTECTED]>

control/locals prolem
        24010 by: "Yessure" <[EMAIL PROTECTED]>
        24011 by: Uwe Ohse <[EMAIL PROTECTED]>

logging qmail and qmail-smtpd
        24013 by: Van Liedekerke Franky <[EMAIL PROTECTED]>
        24016 by: [EMAIL PROTECTED] (Frank D. Cringle)

qmail speed
        24014 by: [EMAIL PROTECTED]
        24015 by: Van Liedekerke Franky <[EMAIL PROTECTED]>

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To bug my human owner, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------


    Harald Hanche-Olsen <[EMAIL PROTECTED]> writes:
    > + [EMAIL PROTECTED]:
    >
    >  | Qmail use the address #@[] as the envelope sender address for double
    >  | bounces. The messages with this sender address are rejected by
    >  | Microsoft Exchange IMS with this error (from qmail logs):
    >  |
    >  | Connected_to_NNN.NNN.NNN.NNN_but_sender_was_rejected.
    >  | /Remote_host_said:_553_malformed_address:_<#@[]>/
    >  |
    >  | I have read the RFC821 (SMTP) and it seems to me that this address
    >  | is ilegal. [...]
    >
    >  I am no RFC lawyer myself, but it looks like you're right.  In fact,
    >  if memory serves, that address was chosen because practically all
    >  servers will accept it as a sender address, but at the same time it is
    >  guaranteed to be unreplyable, which puts an effective stop to bounce
    >  loops.
    >

Harald, 

First, thank you very much for your help. This information confirms my problem's 
diagnosis.

About the sender address used by qmail, I understand that it's difficult to 
choose an address given that the RFC's don't reserve any for this purpose. 
However the choice of an "ilegal" address seems to me a little unfortunate, even 
more since it's hard coded. Though it could be useful in most cases, some RFC 
compliant product, as Microsoft Exchange in this case, would be affected. Many 
founded critics to Microsoft products are based on their standards violations. 
It's surprising that an excelent program as qmail suffers a "similar" flaw.

    >  [I skipped the part about patching qmail to use a different double
    >  bounce sender, since you already discovered that an external solution
    >  works just as well.]
    >
    >  | Furthermore I tried another solution. I forward double bounces but
    >  | changing the envelope sender with this .qmail file:
    >  |
    >  | | qmail-inject -f"<>" postmaster@exchange-server
    >  |
    >  | However, if this forwarding fails, this configuration could produce
    >  | a mail loop. Any suggestions?
    >
    >  First, doesn't that make qmail-remote say "mail from:<<>>"?
    >

Something similar but even uglier: "<<>@mydomain>". My original choose is really 
dreadful 8^).

    >  Second, you're right about the loop.  I would rather do something like
    >
    >  |NEWSENDER=triplebounce forward postmaster@exchange-server
    >
    >  and have .qmail-triplebounce contain
    >
    >  |echo 'Aaack!  Pfhht!  Triple bounce!'
    >
    >  which will just put that message in the log and discard the mail.
    >
    >  - Harald
    >

Your hint is very useful but to avoid loops I have followed these steps:

* The doublebounceto must be different from local postmaster. 

* Also doublebounceto must be different from triplebounce sender.

* The triplebounce .qmail allways must return success. If the forwarding 
fails, qmail will create a simple bounce to "triplebounce", since we have 
changed the sender, and if this bounce fails again qmail will produce a new 
double bounce that closes the loop.

* Since we are bypassing the qmail's bounce loop detecction, the logs are forged:

Apr  6 19:12:42 hostname qmail: 923418762.691380 delivery 6: success: 
Triple_bounce!!_Message_discarded./did_0+0+1/

So the triple bounces are logged as successful deliveries. That could affect 
mail stats and log analysis.


Finally, I opted for modifying the source code because it seems to me easier to 
maintain and support than tricking with qmail users.

   dj.

====
David Jorrin <[EMAIL PROTECTED]>

   "This chapter is about Laziness, Impatience
    and Hubris because this chapter is about
    good software design"
    Larry Wall, Tom Christiansen & 
    Randal L. Schwartz [Programming Perl]
  


----------------------------------------------------------------
Get your free email from AltaVista at http://altavista.iname.com




On Wed, 7 Apr 1999 08:21:35 -0400 (EDT), [EMAIL PROTECTED]
wrote:

>About the sender address used by qmail, I understand that it's difficult to 
>choose an address given that the RFC's don't reserve any for this purpose. 
>However the choice of an "ilegal" address seems to me a little unfortunate, even 
>more since it's hard coded. Though it could be useful in most cases, some RFC 
>compliant product, as Microsoft Exchange in this case, would be affected. Many 
>founded critics to Microsoft products are based on their standards violations. 
>It's surprising that an excelent program as qmail suffers a "similar" flaw.

One could argue that the "From:" address at the SMTP level since it is
trivial to fake serves only one purpose: to direct bounce info. Thus,
there is no reason to check this address, unless one needs to bounce
the message. Of course, the syntax has to be good enough for the SMTP
dialog. The problem, IMHO is that the use of this address has been
extended as a SPAM filter to force spammers to use valid envelope
senders (valid=correct syntax and existing domain).

This adaptation is trivial for spammers, but the filter has negative
consequences for normal mail.  The rfc talks about how a message should
be composed, not received. rfc compliance for recipients means only
that they should accept correctly formatted messages. It does not say
that any non-conforming message should be rejected. This is a BIG
difference.

qmail as an example accepts as much as possible, except the bare-LF
which is rejects because doing anything else risks message corruption.
The SENDER syntax restriction has no such redeeming features.

-Sincerely, Fred

(Frederik Lindberg, Infectious Diseases, WashU, St. Louis, MO, USA)






On Tue, 6 Apr 1999 19:40:59 -0400, Peter C. Norton wrote:

>I'm not concerned with this.  I'm concerned with Fred's proposal
>relying on the status of the remote smtp and qmtp server.  If I'm
>"local" and someone else is "remote" and remote's qmtp service is
>down, but remote's smtp server is still advertising qmtp then I
>shouldn't have my queue grow because of it.  There should be some
>local communication about bum servers if this database is used, to
>prevent it from severely slowing down email.

If you use qmail (the only QMTP implementation I'm aware of), the
likelihood of SMTP working and QMTP being down is virtually zero. Thus,
the likelihood of a slowdown due to this is very low.

For external problems (e.g. firewalled qmtp port with open smtp port
and both servers running) you'd fail on qmtp, log that, continue
failing until the db is updated, use smtp for the message, log the qmtp
banner, etc. This means that mail to that host will be delayed for up
to an update interval and work fine via SMTP for the next update
interval. Update db every 15 min and it still works quite well. Again,
this requires misconfiguration.

Also follows that, when QMTP fails, one would assume that the failure
is true for both channels. Thus, one would go on to the next MX. If
failure is due to a firewall misconfig, you're no worse of that with
the MX magic.

Since SMTP and QMTP are linked anyway, the advertizing of QMTP by the
SMTP server could easily be linked to QMTP being up. Thus, a working
smtpd with a failed qmtpd (admin forgot to start?) would not advertize
QMTP. This would also make this part of config automatic, i.e. if you
choose not to use qmail-qmtpd, you won't advertize it.
 
-Sincerely, Fred

(Frederik Lindberg, Infectious Diseases, WashU, St. Louis, MO, USA)






On Wed, Apr 07, 1999 at 08:53:29AM -0500, Fred Lindberg wrote:
> Since SMTP and QMTP are linked anyway, the advertizing of QMTP by the
> SMTP server could easily be linked to QMTP being up. Thus, a working
> smtpd with a failed qmtpd (admin forgot to start?) would not advertize
> QMTP. This would also make this part of config automatic, i.e. if you
> choose not to use qmail-qmtpd, you won't advertize it.

Why not just implement QMTP in qmail-smtpd? qmail-smtpd would advertise QMTP in
its banner, and then the host connecting would be free to start firing away in
QMTP lingo. There would never be any question of QMTP being up, since
qmail-smtpd would know how to talk QMTP itself. The fact that a particular host
talked QMTP on its SMTP port could be cached so that one wouldn't even have to
wait for the banner next time.

If the remote host sent some kind of magic string to indicate that it was about
to start QMTPing, the above could be implemented with a simple patch to
qmail-smtpd that exec'ed qmail-qmtpd upon reception of the magic string. Or it
could be done in the qmail-popup fashion--a program could answer the
connection, advertising QMTP, and exec qmail-smtpd or qmail-qmtpd depending on
whether it received a HELO command or a QMTP command.

Chris




On Tue, 6 Apr 1999, Peter C. Norton wrote:

> On Tue, Apr 06, 1999 at 06:31:03PM -0500, Chris Garrigues wrote:
> > 
> >     netstat -a |fgrep '*:qmtp'
> > 
> > or the low-level C equivalent.
> 
> I'm not concerned with this.  I'm concerned with Fred's proposal
> relying on the status of the remote smtp and qmtp server.  If I'm
> "local" and someone else is "remote" and remote's qmtp service is
> down, but remote's smtp server is still advertising qmtp then I
> shouldn't have my queue grow because of it.  There should be some

I think Chris' point was the remote SMTP server monitors the state of the
remote qmtp socket/listener on itself. if there is something listening on
the QMTP port isn't it fairly reasonable for qmail-smtpd to
[configureabley] assume it's qmail-qmtpd ?

Richard





> From:  Richard Letts <[EMAIL PROTECTED]>
> Date:  Wed, 7 Apr 1999 19:06:04 +0100 (BST)
>
> On Tue, 6 Apr 1999, Peter C. Norton wrote:
> 
> > On Tue, Apr 06, 1999 at 06:31:03PM -0500, Chris Garrigues wrote:
> > > 
> > >   netstat -a |fgrep '*:qmtp'
> > > 
> > > or the low-level C equivalent.
> > 
> > I'm not concerned with this.  I'm concerned with Fred's proposal
> > relying on the status of the remote smtp and qmtp server.  If I'm
> > "local" and someone else is "remote" and remote's qmtp service is
> > down, but remote's smtp server is still advertising qmtp then I
> > shouldn't have my queue grow because of it.  There should be some
> 
> I think Chris' point was the remote SMTP server monitors the state of the
> remote qmtp socket/listener on itself. if there is something listening on
> the QMTP port isn't it fairly reasonable for qmail-smtpd to
> [configureabley] assume it's qmail-qmtpd ?

Bingo.

Certainly Peter's concern is legitimate to a point: as the sender, if the 
remote claims qmtp is there and it isn't, I have a problem.  But as someone 
else pointed out, right now any remote end that supports qmtp will be qmail, 
so if we can make sure qmail only claims to have qmtp available if it really 
is, his concern shouldn't arise.

Also, didn't the original proposal include the idea that if a host that we 
thought had qmtp on it doesn't respond to the qmtp port, we fall back to smtp?

In the worst case of a system that claims to have qmtp but doesn't, we contact 
them via smtp; they say they support qmtp; we cache this information and send 
the one message via smtp; on the next message we contact them via qmtp; they
timeout; we fall back to smtp and remove them from the qmtp cache (not
putting them back in the cache).  We repeat the cycle.  Half their mail goes
directly via SMTP, the other half attempts QMTP and then falls back to SMTP.

Of course, this is pathological, and mail to most hosts will either always go
SMTP or the first message will go SMTP and the rest will go QMTP.

Chris

-- 
Chris Garrigues                 virCIO
+1 512 432 4046                 4314 Avenue C                    O-
http://www.DeepEddy.Com/~cwg/   Austin, TX  78751-3709
                                +1 512 374 0500

  My email address is an experiment in SPAM elimination.  For an
  explanation of what we're doing, see http://www.DeepEddy.Com/tms.html 

    Nobody ever got fired for buying Microsoft,
      but they could get fired for relying on Microsoft.


PGP signature





On Wed, 7 Apr 1999 10:37:48 -0400, Chris Johnson wrote:

>Why not just implement QMTP in qmail-smtpd? qmail-smtpd would advertise QMTP in
>its banner, and then the host connecting would be free to start firing away in
>QMTP lingo. There would never be any question of QMTP being up, since
>qmail-smtpd would know how to talk QMTP itself. The fact that a particular host
>talked QMTP on its SMTP port could be cached so that one wouldn't even have to
>wait for the banner next time.

QMTP doesn't BS: Connect, (send package, wait for reply)*, disconnect.
Package=message,from,to*. Starting with a SMTP handshake would be a lot
of overhead. To be efficient, the sender must (for a session) know that
the recipient does QMTP without connecting via SMTP first. I as just
suggesting that that knowledge come from a previous SMTP session (only
one needed per host) rather than a special MX record.


-Sincerely, Fred

(Frederik Lindberg, Infectious Diseases, WashU, St. Louis, MO, USA)






On Wed, Apr 07, 1999 at 10:37:48AM -0400, Chris Johnson wrote:
> On Wed, Apr 07, 1999 at 08:53:29AM -0500, Fred Lindberg wrote:
> > Since SMTP and QMTP are linked anyway, the advertizing of QMTP by the
> > SMTP server could easily be linked to QMTP being up. Thus, a working
> > smtpd with a failed qmtpd (admin forgot to start?) would not advertize
> > QMTP. This would also make this part of config automatic, i.e. if you
> > choose not to use qmail-qmtpd, you won't advertize it.
> 
> Why not just implement QMTP in qmail-smtpd? qmail-smtpd would advertise QMTP in
> its banner, and then the host connecting would be free to start firing away in
> QMTP lingo. There would never be any question of QMTP being up, since
> qmail-smtpd would know how to talk QMTP itself. The fact that a particular host
> talked QMTP on its SMTP port could be cached so that one wouldn't even have to
> wait for the banner next time.

Just one point.. the qmtp protocol would then need to be adapted so that it would
ignore this banner.

> If the remote host sent some kind of magic string to indicate that it was about
> to start QMTPing, the above could be implemented with a simple patch to
> qmail-smtpd that exec'ed qmail-qmtpd upon reception of the magic string. Or it
> could be done in the qmail-popup fashion--a program could answer the
> connection, advertising QMTP, and exec qmail-smtpd or qmail-qmtpd depending on
> whether it received a HELO command or a QMTP command.

Also very feasible, but this too would require a change to the QMTP standard. I think
if we want this, we should do it right now, while qmail is still the only
qmtp-supporting mta.

Your point with the caching is very good. I don't know which of the mentioned
approaches would be the best, but this is one good possibility.

Greetz, Peter
-- 
| 'He broke my heart,    |                              Peter van Dijk |
     I broke his neck'   |                     [EMAIL PROTECTED] |
   nognixz - As the sun  |        Hardbeat@ircnet - #cistron/#linux.nl |
                         | Hardbeat@undernet - #groningen/#kinkfm/#vdh |




On Wed, Apr 07, 1999 at 09:42:18AM +0200, Peter van Dijk wrote:
> Well extend it a bit to ignore qmtp in smtp banners for like one hour if qmtp turns
> out to be _not_ available. No big deal.

Right.  I just wanted to throw that into the proposal.  An hour is
probably a good long time.

-Peter




Using the .qmail file of a local Maildir
Is there a way to set it up that it would filter email in the following way:

The all messages would be delived to the Mailbox it was attached to
and that only email with say 'internic' in the From: field would also have a
copy sent to another email box







Donna Phillips writes:
 > Using the .qmail file of a local Maildir
 > Is there a way to set it up that it would filter email in the following way:
 > 
 > The all messages would be delived to the Mailbox it was attached to
 > and that only email with say 'internic' in the From: field would also have a
 > copy sent to another email box

|if echo $SENDER | grep internic; then forward other-email-box
./Mailbox

-- 
-russ nelson <[EMAIL PROTECTED]>  http://crynwr.com/~nelson
Crynwr supports Open Source(tm) Software| PGPok |   There is good evidence
521 Pleasant Valley Rd. | +1 315 268 1925 voice |   that freedom is the
Potsdam, NY 13676-3213  | +1 315 268 9201 FAX   |   cause of world peace.




+ Russell Nelson <[EMAIL PROTECTED]>:

| Donna Phillips writes:
|  > The all messages would be delived to the Mailbox it was attached
|  > to and that only email with say 'internic' in the From: field
|  > would also have a copy sent to another email box
| 
| |if echo $SENDER | grep internic; then forward other-email-box
| ./Mailbox

Um.  Apart from the obvious syntax error in the above, which will
cause all mail for this address to bounce, you neglected the
requirement that forwarding be based on the From: field rather than
the envelope sender.  The best fix is probably to replace the test by
822field from | grep internic, where 822field is from Dan's mess822
package.  Fixing the syntax error is left as an exercise for the
reader.

- Harald





Hello,

I deliver mails from a Maildir to a dial customer via
serialmail-0.72. The customer is runninc ccMail (don't know which
version), quit yields: "221 ccMail Link to SMTP closing connection". 
The problem seems to be that the DATA submission end can't be detected
on the ccMail side (for certain mails):

Router to Mailserver (using NAT):

      0410: 64 65 72 20 63 6f 6d 69  63 73 20 6e 65 6e 6e 65  der comics nenne
      0420: 6e 2e 20 64 61 6e 6b 65  20 73 65 68 72 20 20 41  n. danke sehr  A
      0430: 41 0d 0a 0d 0a 2e 0d 0a                           A.......        
                ^^^^^^^^^^^^^^^^^^^ This looks correct. The
                                    transmission should be finished!
        
             IP-Packet from 192.76.144.44 to 192.168.1.2  protocol 0x6 
             TCP-Message, sourceport 54818 destinationport 25


Mailserver answer to router (resp. serialmail site) after the timeout:

000112.058997 DATA[0080]
      0000: 00 a0 f9 00 61 48 00 20  af e1 f4 29 08 00 45 00  ....aH. ...)..E.
      0010: 00 42 97 1e 40 00 1f 06  b1 74 c0 a8 01 02 c0 4c  .B..@....t.....L
      0020: 90 2c 00 19 d6 22 06 d9  8c e0 66 8a 43 39 50 18  .,..."....f.C9P.
      0030: 1d ba 79 ba 00 00 34 35  31 20 43 6f 6e 6e 65 63  ..y...451 Connec
      0040: 74 69 6f 6e 20 54 69 6d  65 64 20 4f 75 74 0d 0a  tion Timed Out..
             IP-Packet from 192.168.1.2 to 192.76.144.44  protocol 0x6 
             TCP-Message, sourceport 25 destinationport 54818


This is a working transfer (different Mail):

server -> client:

      0110: 2e 64 65 0d 0a 0d 0a 74  65 73 74 2c 69 67 6e 6f  .de....test,igno
      0120: 72 65 0d 0a 0d 0a 44 69  72 6b 0d 0a 2e 0d 0a     re....Dirk..... 
             IP-Packet from 192.76.144.44 to 192.168.1.2  protocol 0x6 
             TCP-Message, sourceport 54902 destinationport 25
                          sequence number 1786583507
                          acknowledgement number 115347804
                          offset 5 flags ACK PSH 
                          window 8760 checksum 0x7f1f urgent 0

client -> server:

000005.930657 DATA[0073]
      0000: 00 a0 f9 00 61 48 00 20  af e1 f4 29 08 00 45 00  ....aH. ...)..E.
      0010: 00 3b c5 1e 40 00 1f 06  83 7b c0 a8 01 02 c0 4c  .;..@....{.....L
      0020: 90 2c 00 19 d6 76 06 e0  11 5c 6a 7d 1a cc 50 18  .,...v...\j}..P.
      0030: 20 d2 23 e4 00 00 32 35  30 20 4d 61 69 6c 20 61   .#...250 Mail a
      0040: 63 63 65 70 74 65 64 0d  0a                       ccepted..       
             IP-Packet from 192.168.1.2 to 192.76.144.44  protocol 0x6 
             TCP-Message, sourceport 25 destinationport 54902
                          sequence number 115347804
                          acknowledgement number 1786583756
                          offset 5 flags ACK PSH 
                          window 8402 checksum 0x23e4 urgent 0


Both mails get delivered by qmail & sendmail without problems. I will
try serialmail-0.75 tomorrow, but i wonder if anyone else encountered
this problem ....

Regards,
Dirk

-- 
[EMAIL PROTECTED]              http://www.de.uu.net
Tools & Standards                    UUnet Deutschland GmbH
Tel. +49 231 972 00                  Emil-Figge-Strasse 80
Fax. +49 231 972 1180                44227 Dortmund, Germany





On 7 Apr 1999, Dirk Vleugels wrote:

> 
> Hello,
> 
> I deliver mails from a Maildir to a dial customer via
> serialmail-0.72. The customer is runninc ccMail (don't know which
> version), quit yields: "221 ccMail Link to SMTP closing connection". 
> The problem seems to be that the DATA submission end can't be detected
> on the ccMail side (for certain mails):

which version of ccMail link to SMTP? I found it so bad I wrote my own...
earlier versions use FTP software's SMTP listener, later versions Lotus'
own

I think you can find a zip file of the source-code & binaries on
ftp.salford.ac.uk if you want to use them feel free. I no-longer use
cc:mail (and have also resigned from Salford to move to Austin, Texas) so
have no interest in maintaining this. if it breaks you'll have the source.

Richard





Hi Folks.

Can someone explain to me the support Qmail has for the ESMTP SIZE
command?  I've used this in sendmail to define the maximum message size
I'm willing to accept, but can't find a similar setting for Qmail.

Also more importantly to me, my upstream provider uses Qmail for my backup
mail servers.  They do not appear to send the extended ESMTP Mail command
to report the size of the message being sent, when relaying mail to me.  I
connect via ISDN and therefore don't want to download very large messages.
Is there a configuration change I can recommend to my ISP which will
enable this? 

Thanks in advance.

Lee Shakespeare

--
[EMAIL PROTECTED]






On Wed, Apr 07, 1999 at 04:43:57PM +0100, Lee Shakespeare wrote:

qmail does support a size limit for mail coming in via SMTP, but it does
not advertise or recognise the ESMTP SIZE parameter. This is a problem
indeed, because it waits for the entire message to transfer before deciding
it is too big, and rejecting it.

> Hi Folks.
> 
> Can someone explain to me the support Qmail has for the ESMTP SIZE
> command?  I've used this in sendmail to define the maximum message size
> I'm willing to accept, but can't find a similar setting for Qmail.

-- 
System Administrator
See complete headers for address, homepage and phone numbers




Guys,

I'm considering building a replicated mail service. If the primary goes
down for any reason (software or hardware), I need to be able to switch
over to the backup service, simply by changing the MX. Minimal mail
should therefore be lost or bounced and customers will not
inconvenienced when we try to fix a disk or whatever. Is there any
software already which will allow this to be done. I have had a quick
scan at the qmail archives, but that didn't really turn anything up. The
main issues are really "how to replicate imcoming messages" and "how to
replicate POP3 transactions", though I'm sure it's a bit more involved
than that.

Thanks for any help or advice you can give, regarding this matter.

Regards,

Richard Aldridge,
Internet Systems Engineer,
Cable Internet.




>The
>main issues are really "how to replicate imcoming messages" and "how to
>replicate POP3 transactions", though I'm sure it's a bit more involved
>than that.



Think 'cluster' !

Rather than having a warm spare, for which you can just flip over
to by changing an MX record, I think your time would be better spent
on a central mail spool, that was redundant (you know RAID, dual NICs, two
power supplies) and two front end work horses, using that spool.

That way you can break pretty much any individual component, with out
actually breaking service.

I'm not a unix raid guru, but I should have thought that this would give
you the ability to 'fix a disk'.

I belive NetApp do some nice NFS servers <g>

peter


--
peter at gradwell dot com; online @ http://www.gradwell.com/

"To look back all the time is boring. Excitement lies in tomorrow"







On Wed, 7 Apr 1999, R Aldridge wrote:

> Guys,
> 
> I'm considering building a replicated mail service. If the primary goes
> down for any reason (software or hardware), I need to be able to switch
> over to the backup service, simply by changing the MX. Minimal mail
> should therefore be lost or bounced and customers will not
> inconvenienced when we try to fix a disk or whatever. Is there any
> software already which will allow this to be done. I have had a quick
> scan at the qmail archives, but that didn't really turn anything up. The
> main issues are really "how to replicate imcoming messages" and "how to
> replicate POP3 transactions", though I'm sure it's a bit more involved
> than that.

replicate at the filestore level, rather than the protocol level using
something that so clustering:  eg Two large NetWare servers running
Netware clustering and NFS? You then have multiple pop-servers pointing at
a different server over NFS. as they (or qmail) changes the filestore the
chnages are replicated to the other servers. A couple of 1TB Netware
servers should be able to store as much data as you require... 

RjL






We're running a largish qmail install and have a problem with aliases with a -
in them.
We have fast forward installed, and we have a number of aliases like:
[EMAIL PROTECTED]:      [EMAIL PROTECTED]

We also have a user called nip who's totally unrelated to the alias in 
question.

How do I get the system to notice the alias?  As it is, all we get are bounces 
from the mailing system saying the user isn't found.

Also, how do I figure out what version of Qmail is in use?
(We're probably pretty old)

Thanks in advance
Greg






-----BEGIN PGP SIGNED MESSAGE-----

On Wed, 7 Apr 1999, Greg Moeller wrote:

> How do I get the system to notice the alias?  As it is, all we get are
> bounces from the mailing system saying the user isn't found. 

        Check your /var/qmail/rc first.  It should be something like:

#!/bin/sh
exec env - PATH="/var/qmail/bin:$PATH" \
qmail-start '|dot-forward .forward
|preline -f /usr/lib/mail.local -r "${SENDER:-MAILER-DAEMON}" -d "$USER"' \
splogger qmail

        Then check /var/qmail/alias/.qmail-default.  Its contents should
be something like:

| fastforward -d /etc/aliases.cdb

        If you still get errors, make sure you ran the *new* newaliases
and nuked your old aliases.cdb.

> Also, how do I figure out what version of Qmail is in use?  (We're
> probably pretty old)

        Check /var/qmail/doc/UPGRADE.  Chances are you have the version+1
of the latest version listed in there.

- -Jay

   (                                                             ______
   ))   .-- "There's always time for a good cup of coffee." --.   >===<--.
 C|~~| (>-- Jay D. Dyson -- [EMAIL PROTECTED] --<) |   = |-'
  `--'  `-- People who think NASA is fake view WWF as real. --'  `-----'

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBNwufRM2OVDpaKXD9AQGNrgQAop7a9kX5vzPHk+sTI8uBLFjh/YhmwuuL
I7ad5j2Mo60vLJANk//zfTnlW/PqupCca2DNo2L2p18OxoiJ/Frad7AwGt8Mgyyo
IoUU1QjTQOZhM255XU2iHTzSVyNivpK1jroXFebpKXJ5ILuLUzd6dr7OgDF8Pevm
xEyI6L0XQWY=
=NiAz
-----END PGP SIGNATURE-----





> -----BEGIN PGP SIGNED MESSAGE-----
> 
> On Wed, 7 Apr 1999, Greg Moeller wrote:
> 
> > How do I get the system to notice the alias?  As it is, all we get are
> > bounces from the mailing system saying the user isn't found. 
> 
>       Check your /var/qmail/rc first.  It should be something like:
> 
> #!/bin/sh
> exec env - PATH="/var/qmail/bin:$PATH" \
> qmail-start '|dot-forward .forward
> |preline -f /usr/lib/mail.local -r "${SENDER:-MAILER-DAEMON}" -d "$USER"' \
> splogger qmail
Ok, this one is a tad different. (read alot)  This is in our /etc/init.d/
qmailq file:
watch $pidfile qmail-start ./Maildir/ splogger mail
>From the check for version below, I think I'm at 1.00 (I don't have a doc 
directory at all)
I don't really need .forward, I just need the - thing to be turned off.
Would the above turn off - processing?
nip-nt in /etc/aliases doesn't work.
nipnt in /etc/aliases does work.
The user nip exists
> 
>       Then check /var/qmail/alias/.qmail-default.  Its contents should
> be something like:
> 
> | fastforward -d /etc/aliases.cdb
> 
This is working.  I added [EMAIL PROTECTED] and it worked perfectly. (right 
under the other alias that isn't working)

Greg






# I don't really need .forward, I just need the - thing to be turned off.
# Would the above turn off - processing?
# nip-nt in /etc/aliases doesn't work.
# nipnt in /etc/aliases does work.
# The user nip exists

what you can do is if the user nip is not using any .qmail-<file> files, add
a line to /var/qmail./users/assign
+nip-:alias:uid:gid::-::

and then alias will handle them

# > 
# >     Then check /var/qmail/alias/.qmail-default.  Its contents should
# > be something like:
# > 
# > | fastforward -d /etc/aliases.cdb
# > 
# This is working.  I added [EMAIL PROTECTED] and it worked perfectly. (right 
# under the other alias that isn't working)
# 
# Greg
# 
# 

-- 
/- [EMAIL PROTECTED] --------------- [EMAIL PROTECTED] -\
|Justin Bell  NIC:JB3084| Time and rules are changing.         |
|Pearson                | Attention span is quickening.        |
|Developer              | Welcome to the Information Age.      |
\-------- http://www.superlibrary.com/people/justin/ ----------/




My qmail server accepts messages that I send using the TEST.deliver procedure
BUT ---
will not receive from the outside world.
My DNS is OK and all other services work e.g. FTP, HTTP etc.
? Do I have to add all qmail users to the group qmail ?
I did the touch ~alias/.qmail-username ---> for a valid user and all.
When I set my incoming server to the server I get a POP3 error message.
Seems like the service is not running but I did the csh routine pre the
documentation.
Any help out there?





> On Wed, Apr 07, 1999 at 05:01:50PM -0500, Greg Moeller wrote:

> # here's assign:
> # nip-nt:alias:60003:65535:/var/qmail/alias:-::
> that's not what should be in assign
> 
> if this is the only line, and assuming that 60003 65535 are the uid and gid
> respectively, your assign should look like this:
> 
> cut-----
> +nip-:alias:60003:65535:/var/qmail/alias/:-::
> .
> cut-----
> 
I actually has all that and still no joy.

I found out the . line when newu didn't do anything useful.
I just tried it again, exactly as you put it, and the exact same thing.

It just doesn't like me.  :)

Greg






> > On Wed, Apr 07, 1999 at 05:01:50PM -0500, Greg Moeller wrote:
> 
This thread had to do with trying to get qmail to use the alias mech with an 
address with a - in it. (nip-nt) when the user nip already existed.
The qmail-users mech also didn't work.
> > 
> I actually has all that and still no joy.
> 
> I found out the . line when newu didn't do anything useful.
> I just tried it again, exactly as you put it, and the exact same thing.
> 
> It just doesn't like me.  :)
My final 'solution' was to attack qmail-getpw and simplify it greatly.
It takes local, checks the passwd file, and returns yes or no.  That's it, no 
checking for dashes, or extensions.  So, nice and simple, nip-nt isn't a user 
and it's passed to the alias mech.

I know this isn't really a preferable solution, but I'd spent all day on it 
and wanted it working.  :)
(and yes, it now does what it's supposed to)

Greg






I think you wanted to man qmail-users(5).

Did you look at users/assign?  You should be able to do this there w/o
having to mess w/ qmail-getpw.  Since it will get silently
over-written next time you install qmail, you may save time down the
line by using users/assign.


-- 
The 5 year plan:
In five years we'll make up another plan.
Or just re-use this one.






> > 
> > /usr/local/bin/tcpserver -v -x/etc/tcp.smtp.cdb -u1002 -g101 0 smtp
> > /var/qmail/bin/qmail-smtpd 2>&1 | /var/qmail/bin/splogger smtpd 3 &
> > 


Hi, I've seen some documentation on this however, I'm trying to set it up.
This is what I get:

tcpserver -u "$uid" -g "$gid" -c "$concurrency" -v \
                -x /etc/tcpcontrol/smtp.cdb 0 smtp \
                qmail-pipe fixcr -- qmail-smtpd \| \
                $logger 

But what is " qmail-pipe " ? I can't find no docs on it. Thanks for the
help guys !

---gordie






+ Gordon Soukoreff <[EMAIL PROTECTED]>:

| Hi, I've seen some documentation on this however, I'm trying to set it up.
| This is what I get:
| 
| tcpserver -u "$uid" -g "$gid" -c "$concurrency" -v \
|                 -x /etc/tcpcontrol/smtp.cdb 0 smtp \
|                 qmail-pipe fixcr -- qmail-smtpd \| \
|                 $logger 
| 
| But what is " qmail-pipe " ? I can't find no docs on it. Thanks for the
| help guys !

Looks like my program - the one I just call pipe:

  <URL:http://www.math.ntnu.no/~hanche/prog/pipe/>

Its purpose is to create pipelines that are beyond the capabilities of
the shell, in this case a pipeline whose leading process executes in
the context of the original (qmail-)pipe program itself.

- Harald




-----BEGIN PGP SIGNED MESSAGE-----

> But what is " qmail-pipe " ? I can't find no docs on it. Thanks for the
> help guys ! ---gordie

It's there!  

Scott


-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBNwvgRVvCesh4C4FtAQE/7wQAjMPqv6Ne3bcs2vfLq8jvoamNPD4odnMm
QPKEau+rfYGqEWKQHzK7l4A8k8V5dMUzEEKA1gLf8UwnmNzyH8frwOfvlhvyAgn4
Bz8TwrKobge8yCtUAY5mfxnZz0vEyg3xVGntcotAIq+K0JO9+L3IH4ztIl3ikZrd
+3VKrLP3BWI=
=j2cM
-----END PGP SIGNATURE-----





Hi,
   About qmail ENVIRONMENT VARIABLES:

$SENDER is the envelope sender address.  $NEWSENDER is the
forwarding envelope sender address......
..
.
   But; where is SUBJECT and MESSAGE BODY VARIABLES?
   How to get the email message and subject?



Thanks a lot!!
Sean Lee





On Thu, 08 Apr 1999 04:51:58 +0800, Sean Lee wrote:

>   But; where is SUBJECT and MESSAGE BODY VARIABLES?
>   How to get the email message and subject?

The message is on stdin.


-Sincerely, Fred

(Frederik Lindberg, Infectious Diseases, WashU, St. Louis, MO, USA)






Mime-Version: 1.0

Content-Type: text/plain; charset=us-ascii

Content-Transfer-Encoding: 7bit

Content-MD5: uNOT6O6CxbB2PPONrrH2ow==




Hello list !



I am setting up pop3 deliveries, and keep getting this message in the logs,

it obviously means that the program that actually tries to deliver (qmail-local ??)

has no access to the Maildir directory. 



# pwd

/var/qmail

# ls -l

total 73

drwxr-sr-x   2 alias    qmail       8192 Apr  7 10:59 alias

drwxr-xr-x   2 root     qmail       8192 Mar  3 16:38 bin

drwxr-xr-x   2 root     qmail       8192 Mar  3 16:38 boot

drwxr-xr-x   2 root     qmail       8192 Mar 23 11:58 control

drwxr-xr-x   2 root     qmail       8192 Mar  3 16:38 doc

drwxr-xr-x  10 root     qmail       8192 Mar  3 16:38 man

drwx------   3 popuser  qmail       8192 Apr  6 14:51 popboxes

drwxr-x---  11 qmailq   qmail       8192 Mar  3 16:38 queue

-rwxr-xr-x   1 root     qmail        205 Apr  7 08:54 rc

drwxr-xr-x   2 root     qmail       8192 Apr  7 16:35 users



# cd popboxes 

# ls -l

total 8

drwx------   5 popuser  qmail       8192 Apr  7 15:08 testeur



Isn't qmail-local suppose to pick the UID in assign and deliver as

the user defined there and if not, what user is it running as and how 

could it deliver to the Maildir if it is 0700 ??



# pwd

/var/qmail

# cd users

# ls -l

total 4

-rw-r--r--   1 root     qmail         58 Apr  7 16:14 assign

-rw-r--r--   1 root     qmail       2150 Apr  7 16:35 cdb

# cat assign

=testeur:popuser:208:201:/var/qmail/popboxes/testeur:::

.

# 



Thanks

Chris





On Wed, Apr 07, 1999 at 05:01:23PM -0400, [EMAIL PROTECTED] wrote:
> I am setting up pop3 deliveries, and keep getting this message in the logs,
> 
> it obviously means that the program that actually tries to deliver (qmail-local ??)
> 
> has no access to the Maildir directory. 
> 
> 
> 
> # pwd
> 
> /var/qmail
> 
> # ls -l
> 
> total 73
> 
> drwxr-sr-x   2 alias    qmail       8192 Apr  7 10:59 alias
> 
> drwxr-xr-x   2 root     qmail       8192 Mar  3 16:38 bin
> 
> drwxr-xr-x   2 root     qmail       8192 Mar  3 16:38 boot
> 
> drwxr-xr-x   2 root     qmail       8192 Mar 23 11:58 control
> 
> drwxr-xr-x   2 root     qmail       8192 Mar  3 16:38 doc
> 
> drwxr-xr-x  10 root     qmail       8192 Mar  3 16:38 man
> 
> drwx------   3 popuser  qmail       8192 Apr  6 14:51 popboxes
> 
> drwxr-x---  11 qmailq   qmail       8192 Mar  3 16:38 queue
> 
> -rwxr-xr-x   1 root     qmail        205 Apr  7 08:54 rc
> 
> drwxr-xr-x   2 root     qmail       8192 Apr  7 16:35 users
> 
> 
> 
> # cd popboxes 
> 
> # ls -l
> 
> total 8
> 
> drwx------   5 popuser  qmail       8192 Apr  7 15:08 testeur
> 
> 
> 
> Isn't qmail-local suppose to pick the UID in assign and deliver as
> 
> the user defined there and if not, what user is it running as and how 
> 
> could it deliver to the Maildir if it is 0700 ??

What are the permissions on and ownership of /var/qmail/popboxes/testeur/Maildir and
/var/qmail/popboxes/testeur/Maildir/* ?

Chris




Qmail inserts the domain name in "Return-Path:" and "Message-ID:"
header records. Is there something in /var/qmail/control that can be
changed to alter the domain name in ONLY these two records?

        Thanks,

        John

-- 

John Conover, 631 Lamont Ct., Campbell, CA., 95008, USA.
VOX 408.370.2688, FAX 408.379.9602
[EMAIL PROTECTED], http://www2.inow.com/~conover/john.html






As many of these things as I've done, I don't think I've ever encountered
this.

# ./config
Your hostname is db1radio.michvhf.com.
hard error
Sorry, I couldn't find your host's canonical name in DNS.
You will have to set up control/me yourself.
#


$ dig db1radio.michvhf.com

; <<>> DiG 2.2 <<>> db1radio.michvhf.com 
;; res options: init recurs defnam dnsrch
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6
;; flags: qr aa rd ra; Ques: 1, Ans: 1, Auth: 4, Addit: 4
;; QUESTIONS:
;;      db1radio.michvhf.com, type = A, class = IN

;; ANSWERS:
db1radio.michvhf.com.   86400   A       209.57.60.22

;; AUTHORITY RECORDS:
michvhf.com.    86400   NS      cinnamon.michvhf.com.
michvhf.com.    86400   NS      basil.michvhf.com.
michvhf.com.    86400   NS      ns1.eaglequest.com.
michvhf.com.    86400   NS      ns2.eaglequest.com.

;; ADDITIONAL RECORDS:
cinnamon.michvhf.com.   86400   A       209.57.60.10
basil.michvhf.com.      86400   A       209.57.60.17
ns1.eaglequest.com.     86400   A       209.57.57.10
ns2.eaglequest.com.     86400   A       209.57.57.20

;; Total query time: 4 msec
;; FROM: paprika.michvhf.com to SERVER: default -- 209.57.60.17
;; WHEN: Wed Apr  7 22:51:02 1999
;; MSG SIZE  sent: 38  rcvd: 219

$

Don't have to worry about whether I gave named an HUP, just had a power
failure here (still ain't got around to getting a UPS) and everything 
has started fresh :)   BTW, we're getting a buncha storms thru here so
if you try any DNS searches and don't find a server, that may be why!

Vince.
-- 
==========================================================================
Vince Vielhaber -- KA8CSH   email: [EMAIL PROTECTED]   flame-mail: /dev/null
       # include <std/disclaimers.h>                   TEAM-OS2
        Online Campground Directory    http://www.camping-usa.com
       Online Giftshop Superstore    http://www.cloudninegifts.com
==========================================================================






Alright, I'm trying to get qmail installed on another sparc running solaris
2.6.  The baffling error happens when I log out.  qmail quits.  Why is this
happening?

I am using the standard rc file (/var/qmail/boot/home) and it still happens.

I type:

# csh -cf '/var/qmail/rc &'

I do a ps -ef and I get:

  qmaill 12283 12282  0 21:02:20 pts/13   0:00 splogger qmail
  qmailr 12285 12282  0 21:02:20 pts/13   0:00 qmail-rspawn
    root 12284 12282  0 21:02:20 pts/13   0:00 qmail-lspawn ./Mailbox
  qmailq 12286 12282  0 21:02:20 pts/13   0:00 qmail-clean
  qmails 12282     1  0 21:02:20 pts/13   0:00 qmail-send
    root 12288 12268  0 21:02:25 pts/13   0:00 grep qmail

Now, when I logout, all of these processes die.

Does anyone have any clue why this is happening?

--Adam

---
bash: syntax error near unexpected token `:)'

Adam D. McKenna
[EMAIL PROTECTED]






From: Peter C. Norton <[EMAIL PROTECTED]>


: Try nohup'ing it.  It seems that your csh isn't doing this for you.
:
: -Peter


That worked.  Thanks, Peter.

I seem to remember doing the same thing on an identical box and having it work
fine, though.  It looks like exactly the same copy of csh on the two boxes.

--Adam








Why does Microsoft have a problem ?
Is there a work around..to the CR/LF ?

I'm trying to figure this out. 





Hi,
  For some reason, I must let our qmail treat all hosts like *.mydomain.com
as local host. (There are over 50000 hosts and increase very fast, I cann't
add it one per line into control/locals).
   So I add a line '.mydomain.com' into control/locals.  But when I send a
letter to [EMAIL PROTECTED], (it should be treat as a local
host!), qmail tell me:
it_isn't_in_my_control/locals_file,_so_I_don't_treat_it_as_local._(#5.4.6)
It Clearly show that  the line'.mydomain.com' in control/locals has no any
effect.  :(
  Now what can do?

 Thanks very much.


Yessure







> it_isn't_in_my_control/locals_file,_so_I_don't_treat_it_as_local._(#5.4.6)
> It Clearly show that  the line'.mydomain.com' in control/locals has no any
> effect.  :(
>   Now what can do?

have a look at qmail-send.c, about line 141:
  at = byte_rchr(addr.s,addr.len,'@');

  if (constmap(&maplocals,addr.s + at + 1,addr.len - at - 1)) {
    if (!stralloc_cat(&rwline,&addr)) return 0;
    if (!stralloc_0(&rwline)) return 0;
    return 1;
  }

you might want to append something like this (which is rather untested and has
not even been sent through a compiler):

{ int dot=byte_chr(addr.s+at+1,addr.len-at-1,'.');
  if (dot < addr.len-at-1) {
    if (constmap(&maplocals,addr.s + at + dot + 1,addr.len - at - dot - 1)) {
      if (!stralloc_cat(&rwline,&addr)) return 0;
      if (!stralloc_0(&rwline)) return 0;
      return 1;
    }
  }
}

Something like this should do it.

btw: i think that kind of game is evil. 

Regards, Uwe




Hi,

I'm using tcpserver and cyclog to log qmail and qmail-smtpd. Now I would
like to know how to combine these two: in the qmail log I see who mailed to
whom, but I don't know the IP address, this is in the qmail-smtpd log. So
how can I combine these two logs?

Franky




Van Liedekerke Franky <[EMAIL PROTECTED]> writes:
> Hi,
> 
> I'm using tcpserver and cyclog to log qmail and qmail-smtpd. Now I would
> like to know how to combine these two: in the qmail log I see who mailed to
> whom, but I don't know the IP address, this is in the qmail-smtpd log. So
> how can I combine these two logs?

Sort them...

% sort this-log that-log | tailocal

Here is a perl script that does this in a somewhat more comfortable
fashion.  It extracts a time-slice from the qmail-related logs and
merges them together.

You may need to change the names of the log directories, near the
beginning of the script.  Note: this script is strictly for raw cyclog 
files.  They must be named @<14-digit-timestamp> with each line
beginning with an accustamp time value.  Filenames ending in .gz will
be decompressed automatically.

You also need the Time::ParseDate module, available on CPAN.

================================================================
#!/usr/bin/perl -w

# Display merged pop3d, smtpd and qmail-send logs

# fdc, 1998-07-15

use strict;
use Time::ParseDate;
use Getopt::Std;

use vars qw($opt_g $opt_h $opt_p $opt_q $opt_s $opt_t);

my $pop3log = '/var/log/pop3d';
my $sendlog = '/var/log/qmail-send';
my $smtplog = '/var/log/smtpd';

getopts('g:hpqst') and !$opt_h or die <<EOT;
Usage:
$0 [ flags ] [ <start> ] [ to|bis <end> ]

flags:
 -g re  only show lines matching re (grep)
 -p     show POP3 log         \\
 -q     show qmail-send log   | show all logs if none of pqs are given
 -s     show qmail-smtpd log  /
 -t     test (just show the start and end times)

start and end are date/time specifications (see man Time::ParseDate)
default: <start> = now -1 minute; <end> = <start> +1 minute
EOT

my $now = time;
my($start,$end);
my @extra = (PREFER_PAST=>1, UK=>1, WHOLE=>1);
if (@ARGV) {
    my($from,$x,$till) =
        split / (through|thru|to|until|till|bis) /, "@ARGV";
    $start = parsedate($from, @extra);
    die "$from?\n" unless $start;
    if ($till) {
        push @extra, (NOW=>$start) unless $till =~ /now/;
        $end = parsedate($till, @extra);
        die "$till?\n" unless $end;
    }
    else { $end = $start+60 }
}
else {
    $start = $now-60;
    $end = $now;
}

if ($opt_t) {
    print isodate($start), " -> ", isodate($end), "\n";
    exit 0;
}

my @files = ();
push @files, $pop3log if $opt_p;
push @files, $sendlog if $opt_q;
push @files, $smtplog if $opt_s;
@files = ($pop3log, $sendlog, $smtplog) unless @files;

my $tmp = "/tmp/mail-log.$$";
open(OUT, "|sort|tailocal >$tmp") or
    die "Can't create output pipe: $!\n";

$SIG{PIPE} = 'IGNORE';
$SIG{__DIE__} = sub { close OUT; unlink $tmp; die @_ };

foreach my $file (@files) {
    scan($file, $start, $end);
}

close(OUT) or die "Pipe error: $!\n";

open(IN, $tmp) or die "Can't read results file ($tmp): $!\n";
print while (<IN>);
close(IN);    
unlink $tmp;
exit 0;

sub scan {
    my($d,$s,$e) = @_;
    opendir(D, $d) or die "Can't open $d: $!\n";
    my @logs = sort grep /^@/, readdir(D);
    closedir(D);
    my $limit = sprintf "\@%014d", $s;
    while (@logs > 1) {
        last if $logs[1] gt $limit;
        shift @logs;
    }
    foreach my $f (@logs) {
        $f = "$d/$f";
        $f = "gzip -cdq 2>/dev/null $1|" if $f =~ /(.*\.gz)$/;
        open(F, $f) or die "Can't read $f: $!\n";
        while (<F>) {
            next unless /^(\d+)/;
            next unless $1 >= $s;
            last unless $1 <= $e;
            next if $opt_g and !/$opt_g/o;
            print OUT;
        }
        close(F);
    }
}

sub isodate {
    my(@t) = localtime $_[0];
    sprintf("%04d-%02d-%02d %02d:%02d:%02d",
            $t[5]+1900, $t[4]+1, $t[3], $t[2], $t[1], $t[0]);
}


-- 
Frank Cringle,      [EMAIL PROTECTED]
voice: (+49 2304) 467101; fax: 943357




What speed should one be able to expect from qmail?

A client of ours is delivering a newsletter to 230,000
people which we are feeding into the queue like this:

#! /bin/sh

for address in `cat list`
do

echo -ne "[EMAIL PROTECTED]\000T$address\000\000" >/tmp/address
sed s/xxxx/$address/g /tmp/message | /var/qmail/bin/qmail-queue 1< /tmp/address

echo $address  >>log
done

Current speed is 20,000-40,000/hour on a PPRO200/PII350 with
SCSI drives. Anybody know a better/faster way? 

Dirk




try to remove the accesses to your disk: 

maybe something like this (on one line)

> sed s/xxxx/$address/g /tmp/message | /var/qmail/bin/qmail-queue 1< `echo
> -ne "[EMAIL PROTECTED]\000T$address\000\000" `
> 
(Even better: use perl en load the whole message in memory, with the
replacement and then do your stuff.)

> ----------
> From:         [EMAIL PROTECTED][SMTP:[EMAIL PROTECTED]]
> Sent:         Thursday, April 08, 1999 9:51 AM
> To:   [EMAIL PROTECTED]
> Subject:      qmail speed
> 
> What speed should one be able to expect from qmail?
> 
> A client of ours is delivering a newsletter to 230,000
> people which we are feeding into the queue like this:
> 
> #! /bin/sh
> 
> for address in `cat list`
> do
> 
> echo -ne "[EMAIL PROTECTED]\000T$address\000\000" >/tmp/address
> sed s/xxxx/$address/g /tmp/message | /var/qmail/bin/qmail-queue 1<
> /tmp/address
> 
> echo $address  >>log
> done
> 
> Current speed is 20,000-40,000/hour on a PPRO200/PII350 with
> SCSI drives. Anybody know a better/faster way? 
> 
> Dirk
> 


Reply via email to