>>On Mon, 18 Jan 1999, Niels Jensen wrote:
>>
>> So, some of my control files are:
>>
> me: f64.work.com
>> locals: f64.work.com (to define local addresses)
>> defaultdomain: work.com
>> defaulthost: sonic.net (my ISP)
>> plusdomain: work.com
>> smtproutes: :mail.sonic.net
>>
>> If I send mail to myself using the local-local test from TEST.deliver,
>> the mail is delivered remotely to the sonic mailserver, because sonic.net
>> is added to my username. How do I get qmail to stop doing this?
>
>That's because your defaulthost is sonic.net. When qmail-inject sends
>an email to an address without a host, it adds the default host (see
>qmail-inject manpage).
>
>Change it to f64.work.com.
If I do this, then when I mail stuff remotely through my ISP's
mailserver, the return address for me is my work address, which I
do not want. Somehow I have to make qmail change my address to
[EMAIL PROTECTED] whenever mail is sent rmotely, and keep it to
nielsj, or [EMAIL PROTECTED] when mail is sent locally.
First of all, the line
smtproutes: :mail.sonic.net
says that whenever there is a local connection to smtp, the message
should be sent to mail.sonic.net, your ISP. So if a (local) user
sends mail from Netscape or MH---even to a local address---it will be
sent through your ISP.
But suppose all mailers use sendmail. Then how about this solution:
Set up a virtualdomain l.l as
l.l:special
and put
|forward $[EMAIL PROTECTED]
in ~special/.qmail-default. (Since l.l is for local users, no need for it to be in
DNS)
Then your users can send a message to a local user joe as
To: [EMAIL PROTECTED]
To also set the envelope sender, put
| SLOCAL=`echo $SENDER | cut -d@ -f1`
qmail-inject -f $[EMAIL PROTECTED] $[EMAIL PROTECTED]
in ~special/.qmail-default (all on one line).
If any of your users find that it is too much work to type `@l.l',
then they can set up aliases (or you can do it for them) as
joe: [EMAIL PROTECTED]
for each local user joe in their MUAs.
Mate