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?

Thanks
pepitoHAsked:
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 main.mc 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:
FEATURE(`no_default_msa')dnl

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=127.0.0.1, 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):
make main.cf

save a copy of your existing /etc/mail/sendmail.cf and cp this main.cf as /etc/mail/sendmail.cf

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...
0
 
fim32Commented:
you could build an alias for that local user to go to a different user.  look in /etc/mail/aliases
0
 
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:
amanda:daniel@w3.com.ar

but when I send a local mail to amanda it doesn't go to daniel@w3.com.ar

Am I doing something wrong?

Thanks
0
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.

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

as in:

echo "test" | /usr/lib/sendmail your.email@domain

works?
0
 
fim32Commented:
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
0
 
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 danny:daniel@w3.com.ar

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

danny: daniel@w3.com.ar
0
 
pepitoHAuthor Commented:
yep I did a search on google and that was the problem,

But...
I can't manage to send a local mail to user danny.

daniel@w3.com.ar is my external email account
This works great:
echo "test" | /usr/lib/sendmail daniel@w3.com.ar

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.
0
 
fim32Commented:
is sendmail running on a service? (ps -ef | grep sendmail)

if so, then kill and restart.
0
 
fim32Commented:
as, not on
0
 
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.

0
 
ahoffmannCommented:
why not simply using .forward ?
0
 
fim32Commented:
.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 submit.cf 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.
0
 
ahoffmannCommented:
>  .forward is basically the same as using the aliases file, major exception ..
.. the (existing) user decides, not the MTA
0
 
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?

Thanks.
0
 
ahoffmannCommented:
echo 'daniel@w3.com.ar' > ~/.forward

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

Here are some extra points for you..

http://www.experts-exchange.com/Operating_Systems/Solaris/Q_20928932.html

sorry I didn't split, I forgot.

Anyway.. have you managed to get samba working?
I have a question regarding this with windows 2003:
http://www.experts-exchange.com/Operating_Systems/Solaris/Q_20924699.html

Thanks
0
All Courses

From novice to tech pro — start learning today.