9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi there,
I just want to know how can I redirect error msgs returned from running a command (e.g. nslookup) and then only print out the correct output using an if statement?.
I've tried the following:
where $a is a list of IPs.
but I got all the error msgs printed out to screen and... (9 Replies)
Discussion started by: Abdulelah
9 Replies
2. UNIX for Advanced & Expert Users
Hello Forumers!
Has anyone successfully implemented forwarding of syslog messages to a remote server which is listening on a port other than udp514?
Thanks! (3 Replies)
Discussion started by: bluescreen
3 Replies
3. Shell Programming and Scripting
I found some posts describing how to completely clean out a mailbox in Unix/Linux. But I want to keep the 50 most recent messages. Any ideas out there?
Thanks! (3 Replies)
Discussion started by: OPTIMUS_prime
3 Replies
4. Shell Programming and Scripting
Hi all..
The following set of statements is used in a shell script to ftp a file to a remote machine
I want to redirect the ftp messages thrown by the first ftp statement to a log file. As you can see there is a logic downstream to decide if the ftp was a success or not. But i am not... (5 Replies)
Discussion started by: hareeshkumaru
5 Replies
5. Shell Programming and Scripting
hey im writing a script like this:
#!/bin/bash
#Name: moveMail
#Purpose: To move some files in the pine inbox to a folder on the desktop
#Step one: Find all messages with that have the subject "Hello" in them.
#---------------------------------------------------------------------... (1 Reply)
Discussion started by: oxoxo
1 Replies
6. Solaris
summary found at bottom. to skip straight to action summary, ctrl+f for <summary>
this initially started with trouble changing passwords due to client being unable to authenticate, this was further caused by missing client files.
This was transparent to me, so this details the road I took,... (0 Replies)
Discussion started by: ProGrammar
0 Replies
7. Solaris
Hello,
I have a problem - I created a chrooted jail for one user. When I'm logged in as root, everything work fine, but when I'm logged in as a chrooted user - I have many problems:
1. When I execute the command ping, I get weird results:
bash-3.00$ usr/sbin/ping localhost ... (4 Replies)
Discussion started by: Przemek
4 Replies
8. UNIX for Dummies Questions & Answers
Hello all
I'm new to this site and I have to say that ,it is just awesome. I was able to get most of my questions answered by reading the archives.
I've been a UNIX programmer for a while now but new to administration.
I just installed SunOS 5.9 on my desktop ( i86pc) . Everything... (3 Replies)
Discussion started by: luft
3 Replies
9. UNIX for Dummies Questions & Answers
Is there a way, as sysadmin, to put out system msgs, ie scheduled downtime, backup info, etc, whenever users log in? (5 Replies)
Discussion started by: kymberm
5 Replies
NetSDS::App::SMTPD(3pm) User Contributed Perl Documentation NetSDS::App::SMTPD(3pm)
NAME
NetSDS::App::SMTPD
SYNOPSIS
use NetSDS::App::SMTPD
Packages
NetSDS::App::SMTPD::Socket
Needs for work with socket. This module is a parent for NetSDS::App::SMTPD and NetSDS::App::SMTPD::Client and a child of a NetSDS::APP
ITEMS
create_socket
Creating a simple socket which could be transformed into a listening in NetSDS::App::SMTPD and could be used in
NetSDS::App::SMTPD::Client for accept connection
can_read
This method uses for making a timeout before connections to the server: if there is no connections to accept, program would be just
waiting in select while the connection appeared.
close_socket
Close socket
NetSDS::App::SMTPD::Client
Provides the smtp protocol bu using Net::Server::Mail::SMTP. Had attributes: smtp - an object of Net::Server::Mail::SMTP, ip - ip of the
remote host, headers - ref hash with headers of a message, msg - a body of a message.
ITEMS
set_callback and process
All that subs do - its only call the methods of a Net::Server::Mail::SMTP with the same name.
get_mail
In this sub we parse message and set headers of the object and message body. This sub is call as a callback on event DATA
get_header and get_msg
Get methods that make you access to a header of a msg and message body. Example: $client->get_header('FROM') or
$client->get_header('to');
NetSDS::App::SMTPD
This module init a smtp-server.
ITEMS
create_socket
Init a listening socket by creating a simple socket Super::create_socket and make it listening.
data Takes - a message that has been received, parses them and prepare the structure of headers, body for next actions
accept Waiting for an smtp connection and that accept it.
data
process
Example
#!/usr/bin/env perl
use strict;
use warnings;
Receiver->run(
infinite => 1,
debug => 1,
verbose => 1,
conf_file => '../conf/mts-receiver.conf',
);
1;
package Receiver;
use base 'NetSDS::App::SMTPD';
sub process {
my $self = shift;
my $client = $self->SUPER::process;
#do something with msg;
my $from = $client->get_header('from');
my $msg = $client->get_msg;
.....
return $self;
};
or you could reinit process like this:
sub process {
my $self = shift;
my $client = $self->accept;
return unless $client;
$client->process;
#do something
......
$client->close;
return $self;
};
AUTHOR
Yana Kornienko <yana@netstyle.com.ua>
perl v5.10.1 2010-04-28 NetSDS::App::SMTPD(3pm)