send local mail through other server

I have Solaris: SunOS 5.9
I am running a cron backup using Amanda.
Amanda sends a log to a specified user in the config file.
I want that mail to go to a non-local user. To an outside email account (hotmail for instance)

Is there a way to make local mail go through another mail server?
Or does anyone know how to make amanda send dump logs to non-local emails?

Who is Participating?
fim32Connect With a Mentor Commented:
ahoffman: now that is true, however it would appear on this particular request, that pepito is the owner of the system.  also, as local mails are not being delivered, i highly doubt that the mail would ever get to the .forward file

pepito... ouch... what a pain in the butt.  it appears the problem is the translation from local users into the local delivery agent, as opposed to using the default mail delivery subsystem.  you're going to have to go into /usr/lib/mail/cf and edit your file.  given, that i'm not sure how your sendmail is set up, i'll show you how mine works... this particular machine is operating solely as a sendmail client, but will need to have a sendmail daemon running that listens exclusively on localhost:

between the DOMAIN and the  MAILER line, add this feature:

then there should be a couple of mailers, local and smtp, and finally add these options (not necessary if you want your daemon to listen on all addresses, this will limit connections to this host only):
DAEMON_OPTIONS(``Port=smtp, Addr=, Name=MTA'')dnl

note, that at the beginning of the parentheses, those are backwards quotes (not the regular ones).

save it, then regenerate a config file from it, using make (which is in /usr/ccs/bin, if that's not already in your path):

save a copy of your existing /etc/mail/ and cp this as /etc/mail/

then restart your sendmail:
pkill -HUP sendmail

now, local mails should be delivered... and the aliasing we did earlier will work... and, if you want to take ahoffman's advice, you can create a user named danny, or amanda, and put a .forward file in that user's home directory, with the email to forward to in it...
you could build an alias for that local user to go to a different user.  look in /etc/mail/aliases
pepitoHAuthor Commented:
man you're fast.

I've tried adding an alias to my user:
local SUN user: danny

in /etc/mail/aliases
I added the line:

but when I send a local mail to amanda it doesn't go to

Am I doing something wrong?

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

i'm assuming your server is already set up to send emails?

as in:

echo "test" | /usr/lib/sendmail

and after you edited the alias file, you rehashed, right?

for the sendmail that came with solaris 9:

cd /etc/mail; /usr/sbin/makemap hash aliases < aliases
pepitoHAuthor Commented:
Yes the test sends mails ok.

The last time I didn't do the rehash.
I ran:
/usr/sbin/makemap hash aliases < aliases
inside /etc/mail
and got this:
makemap: aliases: line 57: no RHS for LHS

Do you know what it is?
I tried sending a local mail to user danny but it doesn't work.
there has to be a space between the : and the email address, like:

pepitoHAuthor Commented:
yep I did a search on google and that was the problem,

I can't manage to send a local mail to user danny. is my external email account
This works great:
echo "test" | /usr/lib/sendmail

but this doesn't:
echo "test" | /usr/lib/sendmail danny

I also tried:
#mail danny
to: danny
subject: test

this is a test
And after the dot, it does nothing.
It used to send the mail to the local account.

Thanks for being so fast.
is sendmail running on a service? (ps -ef | grep sendmail)

if so, then kill and restart.
as, not on
pepitoHAuthor Commented:
I killed it:
# ps -ef |grep sendmail
   smmsp  2452  2451  0 16:54:12 ?        0:00 /usr/lib/sendmail -oi -- danny
    root  2472  2462  0 16:55:25 pts/7    0:00 grep sendmail
    root  2453  2444  0 16:54:13 ?        0:00 /usr/lib/sendmail -bd -q15m
   smmsp  2447     1  0 16:53:47 ?        0:00 /usr/lib/sendmail -Ac -q15m
    root  2444     1  0 16:53:47 ?        0:00 /usr/lib/sendmail -bd -q15m
# kill -9 2452
# kill -9 2444
# kill -9 2447
# kill -9 2453
# ps -ef |grep sendmail
    root  2474  2462  0 16:56:24 pts/7    0:00 grep sendmail

And restarted it:
#/etc/init.d/sendmail start

But I can't send local mails.
It gets "stuck" when trying to send a mail to danny or another local user.

why not simply using .forward ?
.forward is basically the same as using the aliases file, major exception being that using aliases the user does not have to exist.

this appears to be an issue of the default file not utilizing the local mail delivery subsystem; in trying to create a solution on one of my solaris 9 systems, i am getting the same issues.
>  .forward is basically the same as using the aliases file, major exception ..
.. the (existing) user decides, not the MTA
pepitoHAuthor Commented:
how is .forward used?
Pardon my ignorance?

fim32: I still can't send local mails.. do you know what the problem may be?

echo '' > ~/.forward

# and enjoy
pepitoHAuthor Commented:
Thanks guys! you've been very helpful.
means you got your sendmail  running?
pepitoHAuthor Commented:
Thanks for your help ahoffmann:

Here are some extra points for you..

sorry I didn't split, I forgot.

Anyway.. have you managed to get samba working?
I have a question regarding this with windows 2003:

All Courses

From novice to tech pro — start learning today.