i'm trying to set up a mail gateway for virus scanning (with amavisd) and then foward incoming
mail for the entire domain to an internal mail server wich stores users mailboxes.
Actually, only the internal mail server is active ( = smtp.mydomain.org in the
DNS) and don't scan viruses. this server is configured to automatically add
@domain.org for internal mail where recipients are not fully completed (mail sent
to joe is rewritten with j...@domain.org). I would like to keep that
service on the mail GW when it'll be up and set as primary MX
because users often uses this short cut to send internal mails.
i set up the mail GW like this :
myhostname = mailgw.domain.org
mydomain = domain.org
myorigin = $mydomain
mydestination = $mydomain , $myhostname , localhost.$mydomain
in transport i added :
domain.org smtp:<internal-mail-server IP>
to forward all incoming mails to internal server after the virus scan with
amavis
After some tests it seems to work fine but i've some trouble with system users
like root or admin on the mail gateway.
On the mailGW, i've a created a user admin wich may received all system mails. My
/etc/postfix/aliases looks like :
daemon: root
bin: root
nobody: root
...
...
...
# amavis-perl
virusalert: root
root: admin
when i send a message to admin, the recipient address is rewritten with
ad...@domain.org and is forwarded to internal server but admin user doesn't exist
on the internal mail server (root neither) => user unknown.
i try to add this in aliases:
admin ja...@domain.org
to forward the system mails to my personal mail account, but in the mail.info log, alias
is doesn't seem to be applied : postfix always try to send it to ad...@domain.org
not ja...@domain.org
i try to change myorigin parameter (replacing with $myhostname) but now, a mail sent to jayet
will be rewritten ja...@host1.domain.org => user unknown on mailGW !
my questions :
1) how to keep the "system" mails generated by the mailGW to a
local user as admin on the mail gateway ?
Perhaps, it's not a good solution to keep these mails on the mailGW (i'll have to
install a pop ou imap server just for one user)
2) so how to forward these mails to a mailbox stored in the internal mail server
?
Thank you for your help
---
Arnaud
>Date: Fri, 07 Feb 2003 18:01:11 -0600
> From: Noel Jones <njo...@megan.vbhcs.org>
> Subject: Re: local users , aliases on a mail gateway
>
> At 12:25 AM 2/8/03 +0100, Arnaud Jayet wrote:
>>i try to change myorigin parameter (replacing with $myhostname) but now, a
>>mail sent to jayet
>>will be rewritten ja...@host1.domain.org => user unknown on mailGW !
>>
>>my questions :
>>
>>1) how to keep the "system" mails generated by the mailGW to a
>>local user as admin on the mail gateway ?
>
> look at masquerade_domains and masquerade_exceptions.
> Further docs can be found in sample-rewrite.cf
> --
> Noel Jones
Noel,
i don't think masquerade domains is the good solution (i try it) because it
works just for outgoing mail and it didn't solved my problem with local system
users.
instead, i do this :
main.cf :
--------
myhostname = mailgw.domain.org
mydomain = domain.org
myorigin = $mydomain
mydestination = $mydomain, $myhostname , localhost.$mydomain
transport
---------
domain.org smtp:<internal-server IP>
canonical
---------
root ro...@mailgw.domain.org
admin ad...@mailgw.domain.org
aliases
-------
postmaster : root
webmaster : root
virusalert : root
root : admin
admin : admin-...@domain.org
(adm-mailgw mailbox was created on the internal mail server)
==============
it seems to works as i want except for one thing (see below) :
- mail to standard user like jayet is rewritten ja...@domain.org and forwarded to internal server =>
OK
- mail to root or admin is rewritten to root/ad...@mailgw.domain.org and then
forwarded to admin-...@domain.org due to the alias => OK (without the last alias, mail
is delivered locally to mailbox ad...@mailgw.domain.org)
i still have a problem with a "system" user like postmaster ou webmaster.
at present, mail to webmaster is rewritten to webm...@domain.org (alias isn't
applied) and forwarded to internal server (running OpenVMS) managed by my colleague. I would like to have
a copy sent also to admin so forwarded to admin-...@domain.org (see aliases)
i wonder aliases aren't applied due to transport table, am i wrong ???
i try to do this :
in canonical -> postmaster postm...@mailgw.domain.org
in aliases -> postmaster: \postmaster , admin
but mail is sent twice to admin-...@domain.org .
So how can i specify to postfix running on the mailgw two or more forwarding addresses for special accounts like
postmaster ou webmaster ?
i hope i was clear
Thank you.
---
Arnaud
Either I don't understand your problem correctly or you're trying to
make this too complicated.
# main.cf
myhostname = mailgw.domain.org
mydomain = domain.org
myorigin = $mydomain
mydestination = $myhostname, localhost.$mydomain
relay_domains = $mydestination, $mydomain
masquerade_domains = domain.org
masquerade_exceptions = root, admin, postmaster, webmaster, virusalert
# aliases:
webmaster : root
virusalert : root
root : admin
admin : admin-...@domain.org
postmaster: postmaster , admin
# transport
domain.org smtp:[internal.server]
--
Noel Jones