We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

send local mail through other server

pepitoH
pepitoH asked
on
Medium Priority
884 Views
Last Modified: 2013-12-27
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
Comment
Watch Question

Commented:
you could build an alias for that local user to go to a different user.  look in /etc/mail/aliases

Author

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

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

as in:

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

works?

Commented:
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

Author

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.

Commented:
there has to be a space between the : and the email address, like:

danny: daniel@w3.com.ar

Author

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.

Commented:
is sendmail running on a service? (ps -ef | grep sendmail)

if so, then kill and restart.

Commented:
as, not on

Author

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 ?

Commented:
.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.
>  .forward is basically the same as using the aliases file, major exception ..
.. the (existing) user decides, not the MTA

Author

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.
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
echo 'daniel@w3.com.ar' > ~/.forward

# and enjoy

Author

Commented:
Thanks guys! you've been very helpful.
means you got your sendmail  running?

Author

Commented:
Yes..
Thanks for your help ahoffmann:

Here are some extra points for you..

https://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:
https://www.experts-exchange.com/Operating_Systems/Solaris/Q_20924699.html

Thanks
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.