On 2001-10-10 14:45:57, Ben Hartshorne wrote:

> The problem that I'm having is that mail generated by programs run as
> root on my machine (cron, bounces, errors on boot, etc.) get sent to
> [EMAIL PROTECTED] (which goes to all the administrators of
> hartshorne.net) instead of [EMAIL PROTECTED] (which goes only to me).

Try this:

1. main.cf:

a. virtual_maps = hash:/etc/postfix/virtual
b. myorigin = $mydomain
c. mydestination = ..., $myhostname
d. realyhost = hartshorne.net (may I suggest a cname of
smtp.hartshorne.net?)

2. Add a line in /etc/postfix/virtual for each account you
want to be delivered locally where $myorigin and $myhostname
are the values from from your main.cf:

[EMAIL PROTECTED] [EMAIL PROTECTED]
...
[EMAIL PROTECTED] [EMAIL PROTECTED]

3. cd /etc/postfix; postmap virtual

4. Restart postfix.


Check out file:///usr/doc/postfix/html/rewrite.html#standard
for more details.

> Domains:
>   green.hartshorne.net resolves to the same machine as hartshorne.net

You might want to rethink that.

> So I figured that I could intercept this process by putting into the
> /etc/aliases file:
> root: ben
> running newaliases, giving postfix a kick, and all would be well.

/etc/alises is only used for local delivery and postfix has already
decided that it's remote.

> *when I send mail to [EMAIL PROTECTED], it gets sent to
> hartshorne.net, and qmail interprets the address correctly, and delivers
> it.

You might want to rethink that.  Why do you want mail destinated to
your machine delivered somewhere else?  What are you really trying
to achive?

> *when fetchmail injects any message, it gets thrown through procmail and
> delivered appropriately.
> *when an automated program generates mail to root, it gets delivered to
> EITHER [EMAIL PROTECTED] (which will get to me eventually) or
> just straight locally.  I don't really care.

The above will deliver it locally.

> Now, the third point above may bely a misunderstanding on my part.  I am
> under the impression that fetchmail injects a message into the local
> mail delivery program,

Configurable, see "mda" in man for fetchmail(1).

> which then sends it through the .forward file
> into procmail, which actually writes the messages to different files.
> Is this correct?  

Depends on the above, if unset, fetchmail will deliver it to port 25
and as you have postfix running there, it will deliver it to whatever
mailbox_command in main.cf is set to (you probably want it to say
/usr/bin/procmail -a "$EXTENSION").  If unset, postfix will use internal
delivery agent, but either would use .forward file.

> Also, I believe that mutt passes of messages to the local delivery agent
> (postfix) to be dealt with and sent at it's leasure.  Is this correct?

mutt sends mail via the program defined as "sendmail" in .muttrc
which is most likely the sendmail program that postfix provides. You
could configure mutt to use something like ssmtp which is a mail
user agent.

This might be useful to you:

file:///usr/doc/postfix/html/big-picture.html

> If both of those are right, is it true that both incoming and outgoing
> mail go through postfix at some point?  I think that's where my problem
> lies.

Yes (that would most likely be the case on your system).


/Allan
-- 
Allan M. Wind                   email: [EMAIL PROTECTED]
P.O. Box 2022                   finger: [EMAIL PROTECTED] (GPG/PGP)
Woburn, MA 01888-0022
USA

Attachment: pgplKAiYvenKe.pgp
Description: PGP signature

Reply via email to