Re: Editing error messages

2000-08-04 Thread Bryan Ischo

"Robin S. Socha" [EMAIL PROTECTED] writes:

 * Erich Zigler [EMAIL PROTECTED] writes:
 
  I was wondering if its possible to edit the error messages in qmail. And
  what is the simplest way to do it?
 
 Grab an editor and UTSL.
 
  For example, I want to change "This address is not in my rcpthosts"
  message to something different.

 That'd be qmail-(s|q)mtpd.c - but why would you want to do that?

I am sure Erich can answer for himself, but may I posit one possible
reason:

The people who read bounce mails are typically those who sent it, which,
99% of the time, is a person who is completely unfamiliar with mail
systems.

To them, something like, "You cannot sent mail to that site using this
mail server", or somesuch, would be less confusing and more personable.

Just a thought.

On the flip side, as soon as the word "rcpthosts" leaves a user's
mouth, I am pretty sure I know exactly what the problem is.

Bryan

-- 


    p l u m b d e s i g n 
 
Bryan Ischo | Software Developer 
157 chambers st ny ny 10007
p.212-285-8600 x233 f.212-285-8999




Re: maildirmake

2000-08-02 Thread Bryan Ischo

"qmail List" [EMAIL PROTECTED] writes:

 Not sure that I understand what you're asking, but
 /var/qmail/bin/maildirmake ~/Maildir will create ~/Maildir/new,
 ~/Maildir/tmp and ~/Maildir/cur for incoming mail.
 
 A
 
 - Original Message -
 From: "Eddie Greer" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Wednesday, August 02, 2000 2:56 PM
 Subject: maildirmake
 
 
  Question to all the qmail professionals:
 
  when you issue the /var/qmail/bin/maildirmake command to create the
 Maildir
  folder for a perspective user; where does store this information.  The
  information that I am referring to is the location of the perspective
 user
  newly created Maildir so that when incoming mail is sent, it is
 delivered
  correctly to the user Maildir folder.
 
  Eddie Greer

I think what is being asked is, if your default mail delivery 
instructions (passed to qmail-start) are something like, "./Mailbox",
and you start creating Maildirs for users, how do you get the mail
to be delivered to the Maildirs instead of the Mailboxes?

And the answer is, there are several ways.  The two I am familiar with
are:

* Put:
./Maildir/

into the .qmail file of every user who is going to be using Maildirs,
or, if your whole site is switching over, just change the default
mail delivery to be "./Maildir/", by invoking qmail-start specifying
"./Maildir/" instead of "./Mailbox".

Hope his helps,
Bryan

-- 
________
    
p l u m b d e s i g n 
 
Bryan Ischo | Software Developer 
157 chambers st ny ny 10007
p.212-285-8600 x233 f.212-285-8999




Rejecting mail from outside for a specific user

2000-07-27 Thread Bryan Ischo


Hi all.

I have a question which may have been answered elsewhere, but I didn't
find an answer in the FAQ, and I can't think of search terms specific
enough to locate an answer in the mailing list archives.

So I apologize in advance if this has been answered already.

We have been using qmail for our company for nearly a year now.
Everything has been working 100% flawlessly.  So there is no problem
to speak of.  But a recent policy decision now requires me to make
some mail aliases unavailable to the outside world.  Specifically,
we have a mail alias set up (via the fastfoward program, in the
/etc/aliases file) which sends mail to everyone in the company.

We would like this alias to be unavailable to anyone sending mail
from outside the company.

Thus, we would like to configure qmail somehow so that it will
accept mail for a given address only if the mail was sent from
inside our own intranet.

Can anyone point to me the best and easiest way to do this?
I would need to somehow check the IP address of the remote host
sending the mail, and the To: address to the mail, and I am not
sure where in the qmail process these two pieces of information
are readily available.

Thank you!
Bryan

-- 


p l u m b d e s i g n 
 
Bryan Ischo | Software Developer 
157 chambers st ny ny 10007
p.212-285-8600 x233 f.212-285-8999




Re: Rejecting mail from outside for a specific user

2000-07-27 Thread Bryan Ischo

"Chris, the Young One" [EMAIL PROTECTED] writes:

 On Thu, Jul 27, 2000 at 12:28:39PM -0400, Bryan Ischo wrote:
 ! Can anyone point to me the best and easiest way to do this?
 ! I would need to somehow check the IP address of the remote host
 ! sending the mail, and the To: address to the mail, and I am not
 ! sure where in the qmail process these two pieces of information
 ! are readily available.
 
 There's a simpler way. If you use tcpserver (as opposed to tcp-env)
 to invoke qmail-smtpd, just put this in your rules file (assuming
 10.*.*.* is your internal network):
 
 10.:allow,INTERNAL="yes"
 
 Then, in the .qmail file that handles your internal mailing list,
 put in the first line,
 
 |bouncesaying "You can't send to this address" [ -z "$INTERNAL" ]
 
 I haven't tested the above, but that's the basic gist of it.

Thank you Chris.  Actually I am not running tcpserver to start qmail;
my line from inetd.conf looks like this:

smtpstream  tcp nowait  qmaild  /usr/sbin/tcpd \
/var/qmail/bin/tcp-env /var/qmail/bin/selective.sh smtpd

Here is selective.sh:

--
#!/bin/bash

ADDR=${TCPREMOTEIP##63.75.128.}

if [ -z $ADDR ]; then
unset RELAYCLIENT
elif [ $ADDR = 127.0.0.1 ]; then
export RELAYCLIENT=""
elif [ $ADDR = $TCPREMOTEIP ]; then
unset RELAYCLIENT
elif [ $ADDR -lt 130 -o $ADDR -gt 254 ]; then
unset RELAYCLIENT
else
export RELAYCLIENT=""
fi

/var/qmail/bin/qmail-$1
--

I didn't want to install tcpserver when I first installed qmail, so I
came up with the above script instead, which, while probably not the
most efficient thing in the world (starting a new bash shell for every
incoming mail!), works great.

But I can just add extra code to my selective.sh script to set the
INTERNAL variable myself, and then use the bouncesaying program as
you have described.

Thank you for the pointer!

Best wishes,
Bryan

-- 
________
    
p l u m b d e s i g n 
 
Bryan Ischo | Software Developer 
157 chambers st ny ny 10007
p.212-285-8600 x233 f.212-285-8999




Re: me file

1999-09-21 Thread Bryan Ischo

Marek Narkiewicz wrote:
 
 Hi there.  I aked this a while ago but in the wrong context.  I intend to set up an 
ISP style
 smtp and pop server using qmail.  I need full relaying to any host from dialup users 
on my
 network.  What do I put in the me file?  As I can't get the ./config script to find 
my dns
 name and As my machine runs a lot of virtual hosts(over 50) I need to know what to 
put in
 the file.  I've found a nice article on relaying which I am sure will be a lot of 
help but it
 doesn't mention this file.  If anyone has any thoughts let me know.
 Incidently the hostname of the machine is not a dns name.

I'm new to qmail and not entirely sure what you are asking, but as
for allowing relaying only on your network, as I understand it you
can use tcpserver to limit relaying to hosts on your network only,
or you can do what I did which is to roll your own script which
allows or denies relaying based upon IP address of the SMTP peer.

Here is the script that I use to allow relaying only for hosts
on our network (I called it /var/qmail/bin/selectiverelay.sh):

--
#! /usr/local/bin/bash

ADDR=${TCPREMOTEIP##209.116.169.}

if [ -z $ADDR ]; then
unset RELAYCLIENT
elif [ $ADDR = 127.0.0.1 ]; then
export RELAYCLIENT=""
elif [ $ADDR = $TCPREMOTEIP ]; then
unset RELAYCLIENT
elif [ $ADDR -lt 66 -o $ADDR -gt 126 ]; then
unset RELAYCLIENT
else
export RELAYCLIENT=""
fi

/var/qmail/bin/qmail-smtpd
---

My inetd.conf entry for qmail looks like this:

smtp stream tcp nowait qmaild /var/qmail/bin/tcp-env tcp-env
/var/qmail/bin/selectiverelay.sh

As you can see, you can set up any number of rules and tests to
see if relaying should be accepted for the host in question.  This
gives you all the power in the world to determine who to relay for.

The script above first sets the variable ADDR to be the last octal
of the remote peer's IP address using some bash string magic.  The
variable TCPREMOTEIP will have been set by tcp-env, whose job is
to set such variables.  If the remote peer is not in the
209.116.169. network (which is our network) ADDR will remain
whatever it was, otherwise it will only be the last octal.

Then, if ADDR is nothing (which should never happen anyway), or
ADDR is the same as the remote peer's IP (which means that the
remote peer was not in the 209.116.169. network) the variable
RELAYCLIENT is unset.  If the last octal is in the range 66 - 126
or the IP is 127.0.0.1 (which are all of the valid hosts in our
network and the localhost IP, respectively), RELAYCLIENT is set.

qmail-smtpd will ignore the rcpthosts file if RELAYCLIENT is set,
so for the hosts we have allowed RELAYCLIENT, relaying happens,
otherwise relaying only to the hosts in our network (which are
listed in our rcpthosts file) is allowed.

The only drawback I can see to a script like the above is that it
runs yet another process (a bash process) every time an email is
received.  But it's working well for us so far, and it's easy
to change and to even add a "trusted" remote IP address.

You can also selectively relay using the tcpserver program, if
memory serves correctly.  You may want to check into that as well,
especially if you are using tcpserver already, because the selective
relaying will then essentially be "free".

I don't know if this addresses your problem in any way, but I
posted it in hopes that if it doesn't, it might help someone
else sometime.

Any comments or suggestions (or reports of any problems with
my approach to selective relaying) are welcome.

Best wishes,
Bryan

-- 
----
Bryan Ischop l u m b d e s i g n
[EMAIL PROTECTED]http://www.plumbdesign.com