qmail Digest 12 Jul 1999 10:00:01 -0000 Issue 695

Topics (messages 27668 through 27696):

lwq/serialmail
        27668 by: "Jacob (Mettavihari)" <[EMAIL PROTECTED]>

qmail-newu
        27669 by: Harald Hanche-Olsen <[EMAIL PROTECTED]>

This is a nasty one
        27670 by: Harald Hanche-Olsen <[EMAIL PROTECTED]>
        27675 by: Lars Balker Rasmussen <[EMAIL PROTECTED]>

use NT user database for POP3
        27671 by: Stefan Paletta <[EMAIL PROTECTED]>

trashing unwanted mail
        27672 by: Stefan Paletta <[EMAIL PROTECTED]>
        27680 by: Bruno Wolff III <[EMAIL PROTECTED]>
        27682 by: "Sam" <[EMAIL PROTECTED]>

periodic cleanup of email
        27673 by: Frederik Lindberg <[EMAIL PROTECTED]>

info
        27674 by: Frederik Lindberg <[EMAIL PROTECTED]>
        27676 by: "Robin Bowes" <[EMAIL PROTECTED]>
        27677 by: Rick Myers <[EMAIL PROTECTED]>

recordio hack
        27678 by: Aaron Nabil <[EMAIL PROTECTED]>
        27683 by: Faried Nawaz <[EMAIL PROTECTED]>
        27689 by: Aaron Nabil <[EMAIL PROTECTED]>

Source Routing Relaying
        27679 by: Bruno Wolff III <[EMAIL PROTECTED]>

IMAP Server that understands Maildir's
        27681 by: "David Harris" <[EMAIL PROTECTED]>

Using qmail with CGI feedback form - needing reference
        27684 by: "Dan Poynor" <[EMAIL PROTECTED]>
        27687 by: Markus Stumpf <[EMAIL PROTECTED]>
        27688 by: Markus Stumpf <[EMAIL PROTECTED]>

Strange problem
        27685 by: Russell Nelson <[EMAIL PROTECTED]>
        27686 by: "Adam D . McKenna" <[EMAIL PROTECTED]>

Forwarding to variable username
        27690 by: "Jim Gilliver" <[EMAIL PROTECTED]>
        27694 by: Stefan Paletta <[EMAIL PROTECTED]>

nested aliases
        27691 by: Rachelle DuBey <[EMAIL PROTECTED]>

ORBS check, except for specific users.
        27692 by: Russell Nelson <[EMAIL PROTECTED]>

Virus scanning with qmail+amavis (Take 2)
        27693 by: Troy Morrison <[EMAIL PROTECTED]>

wrapping qmail-inject - can I?
        27695 by: Varga Robert <[EMAIL PROTECTED]>
        27696 by: Stefan Paletta <[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]


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



Hi Dave,

I have used your script in lwq to install qmail
and from what I see it is working quite well
I am still setting it up on a test-server
and have not yet connected it to the net

I am in the process of setting up a freemail domain and
I am in the situation that is described in Serialmail
and need to download mail onto various smaller machines that
are beeing installed around in Sri Lankan cities,
initially 2 machines and with plans to covering
a large part of Sri Lanka with freemail.

I have also looked at AUTOTURN on how to install serialmail
and have come up with a problem on how to intergrate the script
that has been suggested in AUTOTURN with your script

Could you kindly suggest a way of making
serialmail work with your script

I have myself too little understanding of this script to be able to
formulate it myself.


the part of your script that starts up qmail-smtpd
--------------------------------------------------
    echo -n " qmail-smtpd"
    supervise /var/supervise/qmail/smtpd tcpserver -v -x/etc/tcp.smtp.cdb
\
        -u$QMAILDUID -g$NOFILESGID 0 smtp \
        /var/qmail/bin/qmail-smtpd-wrapper 2>&1 | setuser qmaill accustamp
| \
        setuser qmaill cyclog /var/log/qmail/smtpd &

    echo "."

the part from the faq for your easy access
------------------------------------------
3. Replace

      /var/qmail/bin/qmail-smtpd

   with

      sh -c '
        /var/qmail/bin/qmail-smtpd
        cd /var/qmail/autoturn
        exec setlock -nx $TCPREMOTEIP/seriallock \
        maildirsmtp $TCPREMOTEIP autoturn-$TCPREMOTEIP- $TCPREMOTEIP
AutoTURN
      '

   in the tcpserver invocation in your boot scripts. Reports from
   maildirsmtp will be sent to the same place as reports from tcpserver.


Jacob





+ "Jacob (Mettavihari)" <[EMAIL PROTECTED]>:

| >>[root@dhamma bin]# ./qmail-newu
| >>qmail-newu: fatal: bad format in users/assign
| 
| the line in /var/qmail/users/assign is a cut and paste
| from the serial mail instalation file.
| 
| +autoturn-:qmaild:501:500:/var/qmail/autoturn:-::

*the* line?  Try add a final line containing a lone period.

(I set Reply-To, since this is not a serialmail issue.)

- Harald




+ Juan Carlos Castro y Castro <[EMAIL PROTECTED]>:

| All of a sudden, qmail stopped delivering messages. Everything
| double-bounces. The double-bounce messages say "sorry, no mailbox here
| by that name" for accounts that DO exist on our server. Everything is
| configured for Maildir. Help!

Probably your NIS or NIS+ server is acting up.  qmail-getpw, relying
on the getpwnam() call, cannot tell the difference between a permanent
and a temporary NIS or NIS+ failure.  The short term solution is to
get your NIS or NIS+ server back online.  Then, either put your entire
user database in the users/assign database (with the help of
qmail-pw2u perhaps), or replace qmail-getpw with a program that does
its NIS/NIS+ lookups directly and responds appropriately to temporary
errors.

- Harald




On Tue, Jul 06, 1999 at 12:16:14PM -0300, Juan Carlos Castro y Castro wrote:
> All of a sudden, qmail stopped delivering messages. Everything
> double-bounces. The double-bounce messages say "sorry, no mailbox here
> by that name" for accounts that DO exist on our server. Everything is
> configured for Maildir. Help!

I had something like that the other day.

I have listed all valid users in /var/qmail/users/userlist, and a
Makefile in /var/qmail/users/:

new:
        ( grep alias: /etc/passwd; \
          perl -pe 'chomp; $$_ = `ypmatch $$_ passwd`' userlist \
        ) | /var/qmail/bin/qmail-pw2u -H > assign
        /var/qmail/bin/qmail-newu

Note the -H option.  Since home-directories are auto-mounted (Solaris),
they will have the following owner/permissions when not mounted

    dr-xr-xr-x   1 root     root           1 Jul 11 16:15 /users/user

and qmail-pw2u will silently drop the "invalid" users on the floor (as
per the documentation) without it.

I made a boo-boo, and people's mail started to bounce...  No fun.

Check your assign file.
-- 
Lars Balker Rasmussen, Software Engineer, Mjolner Informatics ApS
[EMAIL PROTECTED]




Milivoj Ivkovic wrote/schrieb/scribsit:
> Is there way to use an NT domain controller's user database to authenticate
> POP3 users?

I was under the impression that there was a perl-based checkpassword
at www.qmail.org, but I cannot find one at the moment.
Anyway, you could just marry the Authen:SMB module with one.

Stefan




Matt D. Landry wrote/schrieb/scribsit:
> I'd like to send any incoming mail for that account to /dev/null if
> possible.  Can I edit a .qmail-xxxx file for the
> account to point to /dev/null?  I've been trying to access the FAQ for

Identify the .qmail file for the address and
echo '#' > .qmail

Stefan




The local postmaster shouldn't be seeing mailing list bounces for 
nonexistant accounts. You are probably better off blocking the sites
that are running the screwed up mailing lists rather than accepting the
email. This will force the bounces to occur on the remote system and maybe
someone there will actually fix things.




On Sun, 11 Jul 1999, Bruno Wolff III wrote:

> The local postmaster shouldn't be seeing mailing list bounces for 
> nonexistant accounts. You are probably better off blocking the sites
> that are running the screwed up mailing lists rather than accepting the
> email. This will force the bounces to occur on the remote system and maybe
> someone there will actually fix things.

Another possibility is that there's nothing wrong on the local box, and
either it's misconfigured, or it's on a blacklist, so the bounces are
rejected by the mailing list server.





Dinesh Punjabi writes:

> Is there any program/package that will 
> periodically remove/clear email older than a 
> certain period of time ? 

crond, find, rm. Look at find's -ctime/-newer switches. It's very easy to
make a script that checks all the ~/Maildir.

If you use mbox format it's a lot harder. See it as a hint to switch ;-)


-Sincerely, Fred
Frederik Lindberg, Inf. Dis, WashU, St. Louis, MO




> Racer X <[EMAIL PROTECTED]> writes on 5 July 1999 at 20:58:11 -0700
>  > > Precisely. If such a command existed he could have used it.
>  > >
>  > > It would work like this.
>  > >
>  > > [EMAIL PROTECTED]

Use ezmlm-idx. It supports [EMAIL PROTECTED] The texts can be
edited by the list admin to whatever s/he wants them to be. Or use
qmail-verh-0.02.tar.gz as a qmail patch. This can give you a
"list-unsubscribe-shag=cnmnetwork.com@listhost" header "personalized" for
each recipient address. Both at ftp://ftp.id.wustl.edu/pub/patches/


-Sincerely, Fred
Frederik Lindberg, Inf. Dis, WashU, St. Louis, MO




Anand Buddhdev wrote:
> 
> I haven't contributed to the war on this list so far, but I feel I have to
> say something: Alex, you've come in and really angered many of us. This
> list was so serene and peaceful, until you jumped in. From your posts, you
> sound like a little spoon-fed child. And it's exactly the method you're
> using to teach newbies. Your words "Teaching is sacred... blah blah..." are
> fine, but one never learns properly unless one is taught to question
> oneself and the knowledge around them. Spoon-feeding only makes people
> dull, and I feel that many of the intellectual people on this list would
> prefer to lead a newbie to the answer than serve it on a plate. Please, I
> beg of you: stop this war of words, make peace with the list members, close
> your mouth, and listen for a while. You might actually like it here, and
> learn something along the way.

Anand,

You have articulated precisely what I was thinking myself.

I have been fortunate in learning qmail (and unix admin) for that matter
in that I have had a friend to help me along the way (as well as this
list).  However, his help has never consisted of merely showing me the
solution to a problem; he always makes me find out the answer myself.  A
typical discourse might be:

Me: Hey, Mark.  I'm doing blah blah blag, and when I blah, it blahs. 
How do I do blah blah?
Him: man foobar :)

I now know considerably more than if I had been spoonfed.

Some people just need to learn that it's OK to not know how to do
something; the real problem is not knowing how to find out!

R.
-- 
Two rules to success in life: 
  1. Don't tell people everything you know.
     -- Sassan Tat




On Jul 06, 1999 at 23:20:02 +0100, Robin Bowes twiddled the keys to say:
> Some people just need to learn that it's OK to not know how to do
> something; the real problem is not knowing how to find out!

Amen! A college instructor once told me, it's not important to know
everything. It's more important to know where to find out everything.

Rick Myers                            [EMAIL PROTECTED]
----------------------------------------------------
The Feynman Problem       1) Write down the problem.
Solving Algorithm         2) Think real hard.
                          3) Write down the answer.





Makes recordio only record I/O if RECORDIO is in the environment.

copy at http://www.spiritone.com/~nabil/recordio.diff


diff -c dist/ucspi-tcp-0.84/Makefile local/ucspi-tcp-0.84/Makefile
*** dist/ucspi-tcp-0.84/Makefile        Wed Nov 11 21:32:01 1998
--- local/ucspi-tcp-0.84/Makefile       Wed Jul 07 14:16:54 1999
***************
*** 451,459 ****
  tcpcat mconnect mconnect-io fixcr addcr delcr argv0 recordio rts
  
  recordio: \
! load recordio.o strerr.a substdio.a error.a str.a fs.a fd.a sig.a
!       ./load recordio strerr.a substdio.a error.a str.a fs.a \
!       fd.a sig.a 
  
  recordio.0: \
  recordio.1
--- 451,459 ----
  tcpcat mconnect mconnect-io fixcr addcr delcr argv0 recordio rts
  
  recordio: \
! load recordio.o strerr.a substdio.a error.a env.a str.a fs.a fd.a sig.a
!       ./load recordio strerr.a substdio.a error.a env.a str.a fs.a \
!       fd.a sig.a
  
  recordio.0: \
  recordio.1
diff -c dist/ucspi-tcp-0.84/recordio.c local/ucspi-tcp-0.84/recordio.c
*** dist/ucspi-tcp-0.84/recordio.c      Wed Nov 11 21:32:01 1998
--- local/ucspi-tcp-0.84/recordio.c     Wed Jul 07 14:03:59 1999
***************
*** 7,12 ****
--- 7,13 ----
  #include "exit.h"
  #include "fmt.h"
  #include "select.h"
+ #include "env.h"
  
  #define FATAL "recordio: fatal: "
  
***************
*** 138,143 ****
--- 139,146 ----
    if (argc < 2)
      strerr_die1x(100,"recordio: usage: recordio program [ arg ... ]");
  
+   if (env_get("RECORDIO")) {
+ 
    if (pipe(piin) == -1)
      strerr_die2sys(111,FATAL,"unable to create pipe: ");
    if (pipe(piout) == -1)
***************
*** 159,164 ****
--- 162,169 ----
      strerr_die2sys(111,FATAL,"unable to move descriptors: ");
    if (fd_move(1,piout[1]) == -1)
      strerr_die2sys(111,FATAL,"unable to move descriptors: ");
+ 
+   }
  
    execvp(argv[1],argv + 1);
    strerr_die4sys(111,FATAL,"unable to run ",argv[1],": ");


-- 
Aaron Nabil





[EMAIL PROTECTED] (Aaron Nabil) writes:

  Makes recordio only record I/O if RECORDIO is in the environment.

I like the idea, but shouldn't you make recordio not record if something
like NORECORDIO is in the environment, as opposed to making it record only
if RECORDIO is in the environment?  I mean, when people use recordio, they
expect it to record io.


Faried.
-- 
           LAMBDA CALCULUS -- for all your computational needs.
                          ACCEPT NO SUBSTITUTES!




Faried Nawaz writes...
>[EMAIL PROTECTED] (Aaron Nabil) writes:
>
>  Makes recordio only record I/O if RECORDIO is in the environment.
>
>I like the idea, but shouldn't you make recordio not record if something
>like NORECORDIO is in the environment, as opposed to making it record only
>if RECORDIO is in the environment?  I mean, when people use recordio, they
>expect it to record io.

Hmm, not quite as useful.  You'd need to flag every host NOT to record.  

But even better would been to have a flag for the new behavior
and leave the original behavior intact.  But that would have been 
a 'patch', not a 'hack', and I was in a world of hurt when I
came up with that hack as the shortest distance between two
points.

For anyone to whom it's just not obvious what this does, consider you
are getting hammered by some system 1.1.1.1

1.1.1.1,RECORDIO=""
:allow

will record just the io for that host and bypass all of the forky/pipey
stuff recordio would be trying to do for all other connections, also makes
for smaller logs.

In fact I'll probably just leave recordio in place permanently, what's one
extra exec per delivery?


-- 
Aaron Nabil




I think this is related to a question I asked a while back. If the recipient
address has a null local part, the message is silently rejected.

On Tue, Jul 06, 1999 at 11:15:11AM -0700,
  Eric Huss <[EMAIL PROTECTED]> wrote:
> I have a question about relay routes and qmail.  (This is in reference to
> RFC 821, Section 3.6).
> 
> If you connect to a qmail smtpd, and specify:
> RCPT TO: <@somedomain.com>
> 
> It will always say 250 ok.  Whats more, the logs will say "msg 12345 to
> local @mylocaldomain.com" where mylocaldomain.com is your box's domain.
> However, I do not see the message actually delivered anywhere on the
> machine.  Shouldn't qmail either outright reject the message (because
> somedomain.com is not in rcpthosts), or accept the message, and then try
> to bounce it to the original receiver?
> 
> -Eric





See: http://www.davideous.com/imap-maildir/

Along with the sources and patches, I've got an RPM which works out-of-box on a
RedHat 6.0 system.

 - David Harris
   Principal Engineer, DRH Internet Services


-----Original Message-----
From:   Stewart Jeacocke [mailto:[EMAIL PROTECTED]]
Sent:   Tuesday, July 06, 1999 3:50 PM
To:     [EMAIL PROTECTED]
Subject:        IMAP Server that understands Maildir's

I am looking for an IMAP Server that can understand Maildir format,
preferably "out of the box". It would be nice if it were availible as an
RPM or SRPM. Any Ideas?

TIA
Stewart





Can someone point me to the reference on how to use qmail with a CGI (Perl)
user feedback form. I seem to remember reading somewhere about using
qmail-inject but not sure. I'm not able to find the info from the main qmail
pages easily.

Specifically I'm starting with FormMail.pl from World Wide Mart and need to
set the $mailprog = '/usr/lib/sendmail' to something like $mailprog =
'/var/qmail/bin/qmail-inject' to receive the form results via email I'm
thinking.

Cheers,
DAN





On Sun, Jul 11, 1999 at 01:16:22PM -0700, Dan Poynor wrote:
> Specifically I'm starting with FormMail.pl from World Wide Mart and need to
> set the $mailprog = '/usr/lib/sendmail' to something like $mailprog =
> '/var/qmail/bin/qmail-inject' to receive the form results via email I'm
> thinking.

I have a symb.link (which is kinda mandatory for systems running qmail)
from /usr/sbin/sendmail -> /var/qmail/sendmail
You have to check .. on some/older systems it may (also) be
/usr/lib/sendmail and you'll have to link that (too).

That's what I basically use in my scripts:

# --------------------- snip ----------------------------------------------
my $SENDMAIL            = '/usr/sbin/sendmail -t -i';
my @mon_names           = ( 'Jan','Feb','Mar','Apr','May','Jun',
                                'Jul','Aug','Sep','Oct','Nov','Dec');
my @week_names          = ( 'Sun','Mon','Tue','Wed','Thu','Fri', 'Sat'
);

my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
my $DATUM = sprintf ("%02d %s %04d %02d:%02d:%02d -0000",
                                $mday, $mon_names[$mon], $year+1900,
                                $hour, $min, $sec);


open(SENDMAIL, "|$SENDMAIL");
print SENDMAIL <<EOF;
Received: ($ENV{SCRIPT_NAME} $$ invoked from network); $DATUM
Received: from $ENV{REMOTE_HOST} ($ENV{REMOTE_ADDR});
  by $ENV{SERVER_NAME} with $ENV{GATEWAY_INTERFACE}; $DATUM
From: $from
To: $to
Subject: $subject

$text
EOF
# --------------------- snip ----------------------------------------------

You may also want to set
    $ENV{'QMAILSUSER'} = 'webmaster';
    $ENV{'QMAILSHOST'} = 'example.com';
before open(SENDMAIL, "|$SENDMAIL"); to set a Envelope-Sender pointing
to a valid address.

For our webservers I do this in apache.conf with
    SetEnv          QMAILUSER               webmaster
    SetEnv          QMAILDEFAULTHOST        www
    SetEnv          QMAILDEFAULTDOMAIN      example.com
    SetEnv          QMAILSUSER              webmaster
    SetEnv          QMAILSHOST              example.com

Otherwise the envelope sender address will be something like
    [EMAIL PROTECTED]
and that may be not what you want ;-)

HTH,
        \Maex

-- 
SpaceNet GmbH             |   http://www.Space.Net/   | Yeah, yo mama dresses
Research & Development    | mailto:[EMAIL PROTECTED] | you funny and you need
Joseph-Dollinger-Bogen 14 |  Tel: +49 (89) 32356-0    | a mouse to delete files
D-80807 Muenchen          |  Fax: +49 (89) 32356-299  |




On Sun, Jul 11, 1999 at 11:39:03PM +0200, Markus Stumpf wrote:
> I have a symb.link (which is kinda mandatory for systems running qmail)
> from /usr/sbin/sendmail -> /var/qmail/sendmail

*ARGL*
That should read
    /var/qmail/bin/sendmail
              ****
of course :/

        \Maex
-- 
SpaceNet GmbH             |   http://www.Space.Net/   | Yeah, yo mama dresses
Research & Development    | mailto:[EMAIL PROTECTED] | you funny and you need
Joseph-Dollinger-Bogen 14 |  Tel: +49 (89) 32356-0    | a mouse to delete files
D-80807 Muenchen          |  Fax: +49 (89) 32356-299  |




Adam D . McKenna writes:
 > OK, I figured it out (sort of).
 > 
 > ~alias/.qmail-postmaster was forwarding to root..
 > 
 > When I changed it to adam-postmaster, mail to root started working again.
 > 
 > Anyone have an idea why this happened?

Hahahahah!  This is not to laugh at you, but to laugh at *us*.  I got
bitten by that exact problem years ago.  The instructions tell you to
create an empty .qmail-root, .qmail-mailer-daemon, and
.qmail-postmaster, all in ~alias.  This is all very nice, but doesn't
help the newbie a bit.

You see, the natural idea is to think "because ~alias has a Mailbox,
and mail to root@ (etc) is being delivered into it, mail is being
forwarded into it, so if I forward the mail elsewhere, it'll go
there."

It won't.  Alias is a special user -- it controls all non-deliverable
mail directly, just by virtue of having a .qmail file in its home
directory.  So, instead of the mail being *forwarded* to alias, the
mail is being directly stuffed into alias's Mailbox.  If you want
alias's mail forwarded to some other user, you need to eschew empty
~alias/.qmail-* files.  Either forward the mail to alias, and forward
alias's mail elsewhere, or forward the mail directly to the desired
user.

-- 
-russ nelson <[EMAIL PROTECTED]>  http://crynwr.com/~nelson
Crynwr supports Open Source(tm) Software| PGPok | Government schools are so
521 Pleasant Valley Rd. | +1 315 268 1925 voice | bad that any rank amateur
Potsdam, NY 13676-3213  | +1 315 268 9201 FAX   | can outdo them. Homeschool!




Russ,

The problem was that there was stuff in /var/qmail/users/assign that I didn't
put there..  It had nothing to do with anything in ~alias..

--Adam

On Sun, Jul 11, 1999 at 05:11:54PM -0400, Russell Nelson wrote:
> Adam D . McKenna writes:
>  > OK, I figured it out (sort of).
>  > 
>  > ~alias/.qmail-postmaster was forwarding to root..
>  > 
>  > When I changed it to adam-postmaster, mail to root started working again.
>  > 
>  > Anyone have an idea why this happened?
> 
> Hahahahah!  This is not to laugh at you, but to laugh at *us*.  I got
> bitten by that exact problem years ago.  The instructions tell you to
> create an empty .qmail-root, .qmail-mailer-daemon, and
> .qmail-postmaster, all in ~alias.  This is all very nice, but doesn't
> help the newbie a bit.
> 
> You see, the natural idea is to think "because ~alias has a Mailbox,
> and mail to root@ (etc) is being delivered into it, mail is being
> forwarded into it, so if I forward the mail elsewhere, it'll go
> there."
> 
> It won't.  Alias is a special user -- it controls all non-deliverable
> mail directly, just by virtue of having a .qmail file in its home
> directory.  So, instead of the mail being *forwarded* to alias, the
> mail is being directly stuffed into alias's Mailbox.  If you want
> alias's mail forwarded to some other user, you need to eschew empty
> ~alias/.qmail-* files.  Either forward the mail to alias, and forward
> alias's mail elsewhere, or forward the mail directly to the desired
> user.
> 
> -- 
> -russ nelson <[EMAIL PROTECTED]>  http://crynwr.com/~nelson
> Crynwr supports Open Source(tm) Software| PGPok | Government schools are so
> 521 Pleasant Valley Rd. | +1 315 268 1925 voice | bad that any rank amateur
> Potsdam, NY 13676-3213  | +1 315 268 9201 FAX   | can outdo them. Homeschool!
> 




Hi all,

I'll start with the explanation, since I can't seem to write the question
accurately enough by itself...

I've written a small C program that will take a single string and match it
to the most likely user account in /etc/passwd.  Obviously, this is to ease
the task of forwarding on email with incorrectly spelt email addresses (we
feel this is less hassle that attempting to educate 6 billion morons who
can't handle spelling correctly).  The problem is, I'm not sure what the
best way to return the result is.  At the moment I set an environment
variable, but I'm not sure that works, just as I'm not sure putting
&$FORWARD_ADDRESS in .qmail works.

Any ideas welcome.

Jim





Jim Gilliver wrote/schrieb/scribsit:
> I've written a small C program that will take a single string and match it
> to the most likely user account in /etc/passwd.  Obviously, this is to ease

> best way to return the result is.  At the moment I set an environment
> variable, but I'm not sure that works, just as I'm not sure putting
> &$FORWARD_ADDRESS in .qmail works.

You write it to stdout, so you can do
| forward `speling-checkar`
in .qmail-default.

Stefan




I am trying to do nested aliases using qmail - we recently switched over 
from sendmail to qmail running on a redhat 6.0 box.
I want to have nested aliases where jjones is a member or engineering and 
then engineering is a member of allhands.
It worked fine in sendmail.
Is the best bet fast-forward or what are the suggestions?
Rachelle
In a world with no walls or fences, who needs Windows or Gates?





Adam D . McKenna writes:
 > You can do ORBS/RBL/DUL checks in .procmailrc if you want to.

Of course one would rather that qmail-smtpd not accept the mail in the
first place.  The problem is that there's no way to reject specific
recipients.  That's one of the benefits qmail-smtpd loses by not
associating a recipient with a user.  Doesn't outweigh the benefits
gained, but it *is* a benefit lost.

-- 
-russ nelson <[EMAIL PROTECTED]>  http://crynwr.com/~nelson
Crynwr supports Open Source(tm) Software| PGPok | Government schools are so
521 Pleasant Valley Rd. | +1 315 268 1925 voice | bad that any rank amateur
Potsdam, NY 13676-3213  | +1 315 268 9201 FAX   | can outdo them. Homeschool!





> I skimmed thru the last six months worth of qmail archives and I did not
> see any good method for using a virus checker with qmail.  Well, there
> was mention of the Star Screening System but all I could find was a white
> paper and I haven't bothered converting it from .doc format.

The last time I set it up (on a previous installation) I used the
RELAYCLIENT environment variable to append a virtual domain (@virus.check)
to mails processed by qmail, then pointed that virtual domain to
scanmails.  It required some hacking on the scanmails script but it
essentially worked well that way.  I think I also set up scanmails to only
scan the message if it was delivered locally (RECIPIENT contained my
domain name) because scanning each message multiple times for each mailing
list recipient was loaded the machine fairly heavily.

I'm not claiming that this is better or worse; just pointing out that
there's more than one way to do it.

Troy

--- amavis-0.2.0-pre4/src/scanmails/scanmails.in.cls    Wed Mar 31 06:43:49 1999
+++ amavis-0.2.0-pre4/src/scanmails/scanmails.in        Mon Jul  5 17:57:59 1999
@@ -36,7 +36,8 @@
 #
 #####################################################################
 
-scanscriptname="scanmails"
+#scanscriptname="scanmails"
+scanscriptname=`basename $0`
 
 ################################################
 # Path to DrSolomon Antivirus                  #
@@ -77,6 +78,7 @@
 #                   in                         #
 ################################################
 tmpdir=/var/tmp/${scanscriptname}$$
+usingqmail=@USE_QMAIL@
 
 ################################################
 # "var_log" indicates the path where statistic #
@@ -84,6 +86,7 @@
 # - if "do_log" is set to "yes"                #
 ################################################
 var_log=@var_log@
+systemlogdir=${var_log}/scanmails/
 do_log=@do_log@
 do_syslog=@do_syslog@
 syslog_level=@syslog_level@
@@ -120,7 +123,34 @@
 arc=@arc@
 unfreeze=@unfreeze@
 
-deliver=@deliver@
+if [ "x${usingqmail}" = "x" ]; then
+    deliver=@deliver@
+else
+    deliver=${scanscriptname}-real
+fi
+ 
+if [ "x${usingqmail}" != "x" ] ; then
+    if [ "${scanscriptname}" = "qmail-remote" ] ; then
+       SENDER="$2"
+       RECIPIENT="$3"
+    elif [ "${scanscriptname}" = "qmail-local" ] ; then
+       # Sometims qmail-local is called with -- as the first arg
+       # this screws up the arg count so shift everything
+       if [ "$1" = "--" ] ; then
+           RECIPIENT="$4"@"$7"
+           SENDER="$8"
+       else
+           RECIPIENT="$3"@"$6"
+           SENDER="$7"
+       fi
+    else
+       SENDER="$1"
+       RECIPIENT="$2"
+    fi
+else
+    SENDER="$2"
+    RECIPIENT="$7"
+fi
 
 ################################################
 #                main program                  #
@@ -171,8 +201,8 @@
 
 echo xxxxxxxxxxxxxxxxxx`date`xxxxxxxxxxxxxxxxxxxxxxx >${tmpdir}/logfile
 echo ${scanscriptname} called $* >>${tmpdir}/logfile
-echo FROM: $2 >>/${tmpdir}/logfile
-echo TO: $7 >>/${tmpdir}/logfile
+echo FROM: $SENDER >>/${tmpdir}/logfile
+echo TO: $RECIPIENT >>/${tmpdir}/logfile
 
 ${metamail} -r -q -x -w ${tmpdir}/receivedmail > /dev/null 2>&1
 
@@ -588,19 +618,19 @@
   mv ${tmpdir}/receivedmail ${virusmailsdir}/virus$$
   chmod 400 ${virusmailsdir}/virus$$
   echo The attached mail has been found to contain a virus >${tmpdir}/virusmail
-  echo Originally $* >>${tmpdir}/virusmail
+  echo Originally $0 "$@" >>${tmpdir}/virusmail
   echo The mail has been stored as ${virusmailsdir}/virus$$ >> ${tmpdir}/virusmail
-  mkdir -p ${var_log}/${scanscriptname}
-  cat ${tmpdir}/logfile >>${var_log}/${scanscriptname}/logfile
+  mkdir -p ${systemlogdir}
+  cat ${tmpdir}/logfile >>${systemlogdir}/logfile
   cat ${tmpdir}/virusmail ${tmpdir}/logfile | ${mail} -s "FOUND VIRUS IN MAIL $*" 
${mailto}
 
 ################### send a mail back to sender ######################
 
-cat <<EOF| ${mail} -s "VIRUS IN YOUR MAIL TO $7" $2
+cat <<EOF| ${mail} -s "VIRUS IN YOUR MAIL TO $RECIPIENT" $SENDER
 
                    V I R U S  A L E R T
 
-  Our viruschecker found a VIRUS in your email to "$7".
+  Our viruschecker found a VIRUS in your email to "$RECIPIENT".
            We stopped delivery of this email!
 
     Now it is on you to check your system for viruses           
@@ -611,14 +641,15 @@
 
 EOF
 
+if [ "${scanscriptname}" != "qmail-remote" ] ; then
 ############### send a mail to the addressee ########################
 
-cat <<EOF| ${mail} -s "VIRUS IN A MAIL FOR YOU FROM $2" $7
+cat <<EOF| ${mail} -s "VIRUS IN A MAIL FOR YOU FROM $SENDER" $RECIPIENT
 
                    V I R U S  A L E R T
 
   Our viruschecker found a VIRUS in a mail from 
-     "$2"
+     "$SENDER"
   to you.
   
   Delivery of the email was stopped!
@@ -626,11 +657,34 @@
   Please contact your system administrator for details
 
 EOF
-##################### No virus, send as usual #######################
+fi
+
+if [ "x${usingqmail}" != "x" ]; then
+    # Stop all other delivery mechanisms
+    cd /var/tmp && rm -rf ${tmpdir} ;
+    if [ "${scanscriptname}" = "scanmails" ] ; then
+       # Assume we were called by qmail-local
+       exit 99 ;
+    else
+       if [ "${scanscriptname}" = "qmail-remote" ] ; then
+           echo "Message was found to contain virus."
+       fi
+       exit 0 ;
+    fi
+fi
+
 
 else
+##################### No virus, send as usual #######################
   echo No virus found - good >> ${tmpdir}/logfile
-  if [ "x${deliver}" != "x" ] && [ -x ${deliver} ] ; then
+
+  if [ "x${usingqmail}" != "x" ]; then
+    # If invoked as anything other than "scanmails", invoke the real
+    # program else fall thru to exit
+       if [ "${scanscriptname}" != "scanmails" ] ; then
+           ${scanscriptname}-real "$@" < ${tmpdir}/receivedmail
+        fi
+  elif [ "x${deliver}" != "x" ] && [ -x ${deliver} ] ; then
     ${deliver} "$@" <${tmpdir}/receivedmail
   else
     pid=$$
@@ -644,8 +698,8 @@
 
   if [ "x${do_log}" = "xyes" ]
   then
-    mkdir -p ${var_log}/${scanscriptname}
-    cat ${tmpdir}/logfile >> ${var_log}/${scanscriptname}/logfile
+    mkdir -p ${systemlogdir}
+    cat ${tmpdir}/logfile >> ${systemlogdir}/logfile
   fi
 fi
 
--- amavis-0.2.0-pre4/configure.in.cls  Wed Mar 31 06:45:51 1999
+++ amavis-0.2.0-pre4/configure.in      Mon Jul  5 17:41:36 1999
@@ -94,6 +94,9 @@
 AC_ARG_ENABLE(sendmail,[  --enable-sendmail=PROG         set location of sendmail],
        [ MTA="$enableval -oi"], [ MTA="" ])
 
+AC_ARG_ENABLE(qmail, [  --enable-qmail                 enable use of qmail features 
+in scanmails],
+       [USE_QMAIL=1], [USE_QMAIL=])
+
 AC_CACHE_CHECK(mail transport agent (MTA),amavis_cv_SYS_MTA,
 if test "$MTA" != ""
 then
@@ -125,6 +128,7 @@
 fi
 
 AC_SUBST(SENDMAIL)
+AC_SUBST(USE_QMAIL)
 AC_SUBST(MTA)
 
 AC_CHECKING([*** H+BEDV AntiVir/X ***])
@@ -215,7 +219,13 @@
 dnl                      ### Enable logging ? ###
 dnl                     ########################
 AC_MSG_CHECKING([event logging])
-AC_ARG_ENABLE(logging,[  --enable-logging=[yes/no]      perform logging 
[default=yes]], do_log="$enableval", do_log="yes")
+dnl if using qmail, scanmails will be run a non-root user
+dnl so logging won't work in most cases
+if test -n "$USE_QMAIL"; then
+    do_log=no
+else
+    AC_ARG_ENABLE(logging,[  --enable-logging=[yes/no]      perform logging 
+[default=yes]], do_log="$enableval", do_log="yes")
+fi
 AC_MSG_RESULT([$do_log])
 AC_SUBST(do_log)
 





I would like to set up centrally managed user masquaradeing for my virtual
domains.

For this I thought that I read MAILUSER, MAILNAME and MAILHOST from a
central file, in a wrapper of qmail-inject.

The question is whether I can do this? Or perhaps is there an already
established mechanism for that?

I thought of something like this:

Move qmail-inject to qmail-inject-bin and use the following in 
qmail-inject:

# retrieve MAILUSER MAILHOST MAILNAME according to $USER from a file

MAILUSER=... 
MAILHOST=...
MAILNAME=...

QMAILDEFAULTHOST=MAILHOST
QMAILINJECT=`echo ${QMAILINJECT}f

export MAILUSER MAILHOST MAILNAME QMAILDEFAULTHOST QMAILINJECT

qmail-inject-bin $*



Will this work?

Robert Varga







Varga Robert wrote/schrieb/scribsit:
> For this I thought that I read MAILUSER, MAILNAME and MAILHOST from a
> central file, in a wrapper of qmail-inject.
 
> Will this work?

Yes. Been there, done that.
I invoked new-inject instead of qmail-inject, though.

Stefan


Reply via email to