Solved

send local mail through other server

Posted on 2004-03-22
19
832 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
0
Comment
Question by:pepitoH
  • 8
  • 7
  • 4
19 Comments
 
LVL 7

Expert Comment

by:fim32
ID: 10651534
you could build an alias for that local user to go to a different user.  look in /etc/mail/aliases
0
 

Author Comment

by:pepitoH
ID: 10651611
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
 
LVL 7

Expert Comment

by:fim32
ID: 10651677
i'm assuming your server is already set up to send emails?

as in:

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

works?
0
 
LVL 7

Expert Comment

by:fim32
ID: 10651693
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
 

Author Comment

by:pepitoH
ID: 10651764
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
 
LVL 7

Expert Comment

by:fim32
ID: 10651822
there has to be a space between the : and the email address, like:

danny: daniel@w3.com.ar
0
 

Author Comment

by:pepitoH
ID: 10651882
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
 
LVL 7

Expert Comment

by:fim32
ID: 10651934
is sendmail running on a service? (ps -ef | grep sendmail)

if so, then kill and restart.
0
 
LVL 7

Expert Comment

by:fim32
ID: 10651936
as, not on
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:pepitoH
ID: 10652121
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
 
LVL 51

Expert Comment

by:ahoffmann
ID: 10653056
why not simply using .forward ?
0
 
LVL 7

Expert Comment

by:fim32
ID: 10653178
.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
 
LVL 51

Expert Comment

by:ahoffmann
ID: 10653388
>  .forward is basically the same as using the aliases file, major exception ..
.. the (existing) user decides, not the MTA
0
 

Author Comment

by:pepitoH
ID: 10653455
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
 
LVL 7

Accepted Solution

by:
fim32 earned 200 total points
ID: 10653525
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
 
LVL 51

Expert Comment

by:ahoffmann
ID: 10653542
echo 'daniel@w3.com.ar' > ~/.forward

# and enjoy
0
 

Author Comment

by:pepitoH
ID: 10657485
Thanks guys! you've been very helpful.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 10658613
means you got your sendmail  running?
0
 

Author Comment

by:pepitoH
ID: 10658829
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

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now