- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to send mail to another server at sheduled tim...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2009 01:49 AM
04-29-2009 01:49 AM
I want to sent the output of /var/mail/root to another server in the same ip range through mail configuration.
Is it possible to do that as if whenever the mail is generated in first server it should be transferred to the second one through this mail system.
Is there any script available for the same???
waiting for the reply
Jestin
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2009 02:51 AM
04-29-2009 02:51 AM
SolutionUse cron.
http://docs.hp.com/en/B2355-90164/apcs01.html
after script name entry in crontab edit | mailx -s "subject" email@your.net
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2009 05:48 AM
04-29-2009 05:48 AM
Re: How to send mail to another server at sheduled time
"I want to sent the output of /var/mail/root to another server in the same ip range through mail configuration."
"Is it possible to do that as if WHENEVER THE MAIL IS GENERATED in first server it should be transferred to the second one through this mail system."
those are three different requirements. the second one may be the easiest to address, but which is it you want to do????
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2009 05:49 AM
04-29-2009 05:49 AM
Re: How to send mail to another server at sheduled time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2009 05:51 AM
04-29-2009 05:51 AM
Re: How to send mail to another server at sheduled time
If you want to send the root mail to a user on another server, this can be accomplished by setting an mail alias for root in the /etc/mail/aliases, such as :
root:user1@server1.mydomain.com,user2@server2.anotherdomain.com
save the file then run the command:
newaliases
now everything that comes to root's mailbox will be forwarded to user1@server1.mydomain.com and user2@server2.anotherdomain.com
If what you want is to forward root mail to another user at a certain time in the day, you can do that by using cron but it will need a little bit of more effort to get each email from the root's mailbox first, then send it to the user on the other server one-by-one.
Hope this helps
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2009 02:40 AM
05-01-2009 02:40 AM
Re: How to send mail to another server at sheduled time
Sorry for the confusing ...
i need the output for the second one can you specify the steps..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2009 05:30 AM
05-01-2009 05:30 AM
Re: How to send mail to another server at sheduled time
I am pasting the aliases file
cat aliases
##
# Sendmail Alias File
# @(#)B11.23_LRaliases $Revision: 1.1.212.1 $ $Date: 99/09/13 15:13:16 $
#
# Mail to an alias in this file will be sent to the users, programs, or
# files designated following the colon.
# Aliases defined in this file will NOT be expanded in headers from
# mailx(1), but WILL be visible over networks and in headers from
# rmail(1).
#
# >>>>>>>>>> The program "/usr/sbin/newaliases" must be run after
# >> NOTE >> this file is updated, or else any changes will not be
# >>>>>>>>>> visible to sendmail.
##
# Alias for mailer daemon
MAILER-DAEMON : root
# RFC 822 requires that every host have a mail address "postmaster"
postmaster : root
# Aliases to handle mail to msgs and news
nobody : /dev/null
# System Admistration aliases
operator : root
uucp : root
daemon : root
# Ftp maintainer.
ftp-bugs : root
# Local aliases
How i can do changes according to which you had mentioned in this file, can you specify it .Its my request because its a live server....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2009 06:26 AM
05-01-2009 06:26 AM
Re: How to send mail to another server at sheduled time
put the following lines in a script
uuencode /var/mail/root root | mailx -m -s "Your mail subject here" someuser@someserver.com
> /var/mail/root
# first line, starting with uuencode and ending with .com
# (yes it should be on one single line) above
# takes the root's mailbox, encodes it to be attached and sends it to
# someuser@someserver.com as an attachment.
#
# second line, starting with ">" will clean root's mailbox for the next day.
then edit your crontab with "crontab-e" command and append this line to it:
0 17 * * * /path/to/my/scriptfile > /dev/null 2>&1
save and exit
Everyday at 5 PM, the mailbox file of the root user will be delivered to someuser you specified as one single attachment file. It is a text file but when you need to read it, you will need to convert it to dos format for the line breaks to look okay. There are many free utilities to do that on windows. Just google the term unix2dos
On the other side, if you want each message to be delivered to you as one single message at 5 PM, then you will need to write a script, to get messages one-by-one, convert them into individual text files (instead of one big blob) and send those text files as individual mail messages, but I unfortunately do not have time to devise a script for this. Maybe someone else have already done this and can help you with that, if this is what you exactly want.
Good luck.
UNIX because I majored in cryptology...