Sponsored Content
Full Discussion: Dynamically using mail host
Top Forums Shell Programming and Scripting Dynamically using mail host Post 302490611 by paventhan on Tuesday 25th of January 2011 09:25:11 AM
Old 01-25-2011
Currently i am using simple perl script with Mail::Sendmail module as a separate file and the mail host ip is hardcoded in the perl script. I just call this perl script where i need to trigger mail.

I want to know do we have any way to define the mail host in the shell script itself. So it can be used during every exceution to send mail.
 

10 More Discussions You Might Find Interesting

1. IP Networking

QNX host cannot ping SCO host, vice versa

The problem I am facing now is that the QNX host could not ping the SCO host and vice versa. They are in the same domain, ie, 172.20.3.xx. As I am very new to Unix, I guess I must have missed out some important steps. Pls help... Thanx alot (2 Replies)
Discussion started by: gavon
2 Replies

2. IP Networking

mail host name on AIX box.

Hi, I was wondering if any body out there can tell me how can I find out what is the name of the mail host on the AIX box that I am working on? Is there any command to bring up the configuration for the mail server or mail host? Thanks in advance. (4 Replies)
Discussion started by: Shaz
4 Replies

3. Solaris

How to delete the files from local host to remote host

Hi all, i am copying .gz files from production server to development server using "scp" command.my requirement is after copying .gz files i want to delete old .gz files(two days back) in development server from production server. like this way i need to delelte .log ,.z and .dmp files... (3 Replies)
Discussion started by: krishna176
3 Replies

4. Shell Programming and Scripting

running commands to remote host from centralized host

Gurus/Experts We have a centralized UNIX/Solaris server from where we can actually ssh to all other UNIX/Solaris servers...I need to write a script that reside on this centerlized server and do FileSystem monitoring (basically run df -h or -k) of other remote servers and then send an email to me... (6 Replies)
Discussion started by: anjum.suri
6 Replies

5. UNIX for Advanced & Expert Users

Help! How to find the local host after few ssh hops to remote host???

I do a ssh to remote host(A1) from local host(L1). I then ssh to another remote(A2) from A1. When I do a who -m from A2, I see the "connected from" as "A1". => who -m userid pts/2 2010-03-27 08:47 (A1) I want to identify who is the local host who initiated the connection to... (3 Replies)
Discussion started by: gomes1333
3 Replies

6. Solaris

Mail issue solution query- host map: lookup (domain): deferred

Hi all I had a mail issue earlier today where I was not receiving any emails from the servers of one of our clients. The mail queue just showed this: -----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient----------- o8S7eSpp020274* 5858 Tue Sep 28 10:42... (0 Replies)
Discussion started by: notreallyhere
0 Replies

7. UNIX for Dummies Questions & Answers

Transfer large number of files host to host

Hello.... I have two servers, one has an empty / and the other has a subdirectory with a large number (4 gig) with many, many files. I need a way to transfer the files en masse from the server with the large number of files to the one that is essentially blank. I don't have space on the used... (16 Replies)
Discussion started by: blaine.miller
16 Replies

8. IP Networking

ping can not recognize host but host command can

Hi, I have a weird problem. when ever I do ping command like for example ping unix.comI get the following message: # ping unix.com ping: unknown host unix.com but when I use host the computer is able to know the host. # host unix.com unix.com has address 81.17.242.186 unix.com mail is... (2 Replies)
Discussion started by: programAngel
2 Replies

9. UNIX for Dummies Questions & Answers

No route to host - mail error

A linux box is supposed to emailing the results of backups to the windows exchange server, but nothing arrives. it never has, as the muppet who set up the Windows domain knew nothing about linux. I know only slightly more than that... pretty sure sendmail is the daemon running to handle mail. it... (0 Replies)
Discussion started by: Noewon
0 Replies

10. Solaris

Need to recover/move diskgroup from failed host to another host

Hi All I am having VxVm on two Solaris hosts. host1 is using disk group dgHR. right now this server went down due to hardware fault. Not I need to import this dgHR into host2 server. Please let me know the procedure for the same. (1 Reply)
Discussion started by: amity
1 Replies
Email::Filter(3pm)					User Contributed Perl Documentation					Email::Filter(3pm)

NAME
Email::Filter - Library for creating easy email filters SYNOPSIS
use Email::Filter; my $mail = Email::Filter->new(emergency => "~/emergency_mbox"); $mail->pipe("listgate", "p5p") if $mail->from =~ /perl5-porters/; $mail->accept("perl") if $mail->from =~ /perl/; $mail->reject("We do not accept spam") if $mail->subject =~ /enlarge/; $mail->ignore if $mail->subject =~ /boring/i; ... $mail->exit(0); $mail->accept("~/Mail/Archive/backup"); $mail->exit(1); $mail->accept() DESCRIPTION
This is another module produced by the "Perl Email Project", a reaction against the complexity and increasing bugginess of the "Mail::*" modules. It replaces "Mail::Audit", and allows you to write programs describing how your mail should be filtered. TRIGGERS
Users of "Mail::Audit" will note that this class is much leaner than the one it replaces. For instance, it has no logging; the concept of "local options" has gone away, and so on. This is a deliberate design decision to make the class as simple and maintainable as possible. To make up for this, however, "Email::Filter" contains a trigger mechanism provided by Class::Trigger, to allow you to add your own functionality. You do this by calling the "add_trigger" method: Email::Filter->add_trigger( after_accept => &log_accept ); Hopefully this will also help subclassers. The methods below will list which triggers they provide. ERROR RECOVERY
If something bad happens during the "accept" or "pipe" method, or the "Email::Filter" object gets destroyed without being properly handled, then a fail-safe error recovery process is called. This first checks for the existence of the "emergency" setting, and tries to deliver to that mailbox. If there is no emergency mailbox or that delivery failed, then the program will either exit with a temporary failure error code, queuing the mail for redelivery later, or produce a warning to standard error, depending on the status of the "exit" setting. METHODS
new Email::Filter->new(); # Read from STDIN Email::Filter->new(data => $string); # Read from string Email::Filter->new(emergency => "~simon/urgh"); # Deliver here in case of error This takes an email either from standard input, the usual case when called as a mail filter, or from a string. You may also provide an "emergency" option, which is a filename to deliver the mail to if it couldn't, for some reason, be handled properly. Hint If you put your constructor in a "BEGIN" block, like so: use Email::Filter; BEGIN { $item = Email::Filter->new(emergency => "~simon/urgh"); } right at the top of your mail filter script, you'll even be protected from losing mail even in the case of syntax errors in your script. How neat is that? This method provides the "new" trigger, called once an object is instantiated. exit $mail->exit(1|0); Sets or clears the 'exit' flag which determines whether or not the following methods exit after successful completion. The sense-inverted 'noexit' method is also provided for backwards compatibility with "Mail::Audit", but setting "noexit" to "yes" got a bit mind-bending after a while. simple $mail->simple(); Gets and sets the underlying "Email::Simple" object for this filter; see Email::Simple for more details. header $mail->header("X-Something") Returns the specified mail headers. In scalar context, returns the first such header; in list context, returns them all. body $mail->body() Returns the body text of the email from to cc bcc subject received $mail-><header>() Convenience accessors for "header($header)" ignore Ignores this mail, exiting unconditionally unless "exit" has been set to false. This method provides the "ignore" trigger. accept $mail->accept(); $mail->accept(@where); Accepts the mail into a given mailbox or mailboxes. Unix "~/" and "~user/" prefices are resolved. If no mailbox is given, the default is determined according to Email::LocalDelivery: $ENV{MAIL}, /var/spool/mail/you, /var/mail/you, or ~you/Maildir/. This provides the "before_accept" and "after_accept" triggers, and exits unless "exit" has been set to false. reject $mail->reject("Go away!"); This rejects the email; if called in a pipe from a mail transport agent, (such as in a ~/.forward file) the mail will be bounced back to the sender as undeliverable. If a reason is given, this will be included in the bounce. This calls the "reject" trigger. "exit" has no effect here. pipe $mail->pipe(qw[sendmail foo@bar.com]); Pipes the mail to an external program, returning the standard output from that program if "exit" has been set to false. The program and each of its arguments must be supplied in a list. This allows you to do things like: $mail->exit(0); $mail->simple(Email::Simple->new($mail->pipe("spamassassin"))); $mail->exit(1); in the absence of decent "Mail::SpamAssassin" support. If the program returns a non-zero exit code, the behaviour is dependent on the status of the "exit" flag. If this flag is set to true (the default), then "Email::Filter" tries to recover. (See "ERROR RECOVERY") If not, nothing is returned. PERL EMAIL PROJECT
This module is maintained by the Perl Email Project <http://emailproject.perl.org/wiki/Email::Filter> COPYRIGHT
Copyright 2003, Simon Cozens <simon@cpan.org> LICENSE
You may use this module under the terms of the BSD, Artistic, or GPL licenses, any version. AUTHOR
Casey West, "casey@geeknest.com" Simon Cozens, "simon@cpan.org" perl v5.10.0 2008-09-15 Email::Filter(3pm)
All times are GMT -4. The time now is 06:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy