Prevent root from expanding domain so can mail to alias
am 27.11.2007 09:02:37 von googlee07My brain is fried. I've searched the net for 72 hours in trying to
find out how to do a very simple thing in sendmail. which is for my
server to send nightly logwatch reports normally destined for the
LOCAL root mail account ON A SYSTEM THAT HAS A PRIVATE IP BEHIND A
FIREWALL TO an EXTERNAL LIVE EMAIL ADDRESS via an alias. Make sense?
Let me see if I can simplify this.
# cat /etc/aliases
root: name@isp.com
# newaliases
When I send a message to root
# echo test | mail -s test root
I want it to immediately be sent to the external alias for root -
name@isp.com.
BUT IT NEVER DOES. Instead, sendmail wants to first expand 'root'
mail acount to a FQDN per my /etc/hosts or hostname setting. In
effect, email to root now becomes:
root@bogusprivatedomain.com
OR if i use a real registered domain for another server i have.
root@realdomain.com
If i use first technique, it appears my localhost can't find a real
domain as it tries to send message from root@bogusprivatedomain.com TO
root@bogusprivatedomain.com. It then gets a DSN error and oddly
enough, then my MAILER DAEMON (which is aliased to root which is
aliased to name@isp.com) forwards the errored email to
name@isp.com??????????
If i use the second technique, it will try to send FROM
root@realdomain.com TO root@realdomain.com, open up what appears to be
a connection to realdomain.com and send the mail to it. That prevents
the DSN error. But once it sends to the realdomain.com, (which i
don't think it should do in the first place) it never aliases to
name@isp.com. So the mail is never received externally like i want it
to.
It's a catch 22. Using a real domain in a fictious private network
sendmail server behind a firewall allows the mail to be sent but it
never gets to the alias. If i use a fake bogus domain, the mail never
gets sent and somehow the failure then does route to name@isp.com.
How does one achieve such a simple thing i'm trying to do?
I don't need any inbound mail. I don't want any outbound mail except
these silly logwatch mails so i can montior the health of this server
remotely and on a daily basis. This server does live behind a
firewall on a private address so it has no real MX record associated
with it.
I've read everything under the sun and i can't get this to work.
Can someone tell me how to fix the setup i have? How do i prevent
expansion of the FQDN and immediate send to the alias?
If you have a simpler method of doing this using another method or
mailer i'm game.
fwiw, i've got centos5 running.