Net::SMTP via PERL is not working in few cases


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Net::SMTP via PERL is not working in few cases
# 1  
Old 11-13-2009
Net::SMTP via PERL is not working in few cases

We are getting some special scenarios where Net::SMTP is not working for some mails.

we are sending a similar kind of data via mails but some of the mails are not received.

After checking the Net::SMTP in debug mode we found below difference:

Good One - (Mail sent properlly)
---
-----
Net::SMTP=GLOB(0x1bfcd34)>>>
Net::SMTP=GLOB(0x1bfcd34)>>> </body></html>
Net::SMTP=GLOB(0x1bfcd34)>>> .
Net::SMTP=GLOB(0x1bfcd34)<<< 250 2.0.0 nAD6WZah001063 Message accepted for delivery
Net::SMTP=GLOB(0x1bfcd34)>>> QUIT
Net::SMTP=GLOB(0x1bfcd34)<<< 221 2.0.0 XXX.yyy.com closing connection



Failed One - (Mail not recieved )
-----
----------
Net::SMTP=GLOB(0x1bfccb4)>>>
Net::SMTP=GLOB(0x1bfccb4)>>> </body></html>
Net::SMTP=GLOB(0x1bfccb4)>>> .
Net::SMTP=GLOB(0x1bfccb4)<<< 250 OK: data received
Net::SMTP=GLOB(0x1bfccb4)>>> QUIT
Net::SMTP=GLOB(0x1bfccb4)<<< 221 2.0.0 XXX.YYY.com closing connection


Can some one please help me undestanding this issue
Thanks in advance
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl Net::IP not working

Experts - I have a snippet of code I can't figure out. I was hoping someone could help me here. I have a file of IPv6 address that I need to format correct. Example in: 2620:0:2d0:200::7 2620:0:2d0:200:a0:c 2620:0a:3f0:200:a0:c I need to convert them to:... (3 Replies)
Discussion started by: timj123
3 Replies

2. Shell Programming and Scripting

Perl: Send mail via SMTP

I have a existing perl program , in this program it will output a email address list to a variable ( $email_list ) , mail content to a variable ( $email_content ) , if I want to send all email to these email address with corresponding content , would aadivse how to write a perl script ? thanks (2 Replies)
Discussion started by: ust3
2 Replies

3. Web Development

Ssh authentication from .NET webpage to UNIX is not working

My .NET website invokes a perl script to perform GIT operations on Gerrit server running UBuntu. In the perl script I connect using passwordless authentication to Gerrit server as below: system ( "ssh gitadmin@gerritserver.com 'cd /xyz && git clone xxx' "); I verified that ssh authentication... (3 Replies)
Discussion started by: tkota
3 Replies

4. Shell Programming and Scripting

MIME Type detection for Net::SMTP

I've spent a good two weeks on trying to figure out a proper way to get the mime type of a file. The "file" command on the Sparc machine I'm working on is an older version and does not support the --mime flag. It outputs things like: somefile.pdf: Adobe Portable Document Format (PDF) v1.5 ... (3 Replies)
Discussion started by: mrwatkin
3 Replies

5. Shell Programming and Scripting

Net::OpenSSH not working on Unix machine.

So, I installed the Net::OpenSSH module and I am having trouble getting it to work. It appears to be failing on this code: my $ssh = Net::OpenSSH->new('user:passwd@host.com'); $ssh->error and die "Couldn't establish SSH connection: ". $ssh->error; It's pretty simple code. I keep... (0 Replies)
Discussion started by: mrwatkin
0 Replies

6. Shell Programming and Scripting

Perl - Net::FTP issue

Wondering if anyone can help or advise on following issue. The below script should simply connect to a different server and retrieve certain files for me. use lib "/xxxxx/xxxxx/xxxxx/xxxx"; use Net::FTP; my $directory = "xxxxxxxx"; my $destinationDir = "xxxxxxxxx"; my $filePrefix =... (1 Reply)
Discussion started by: meevagh
1 Replies

7. Shell Programming and Scripting

Net::Ftp in perl

I am trying to execute a script in another server, i used Net::Ftp module How to execute unix command in another server by using Net::Ftp module.. #!/usr/bin.perl ### Perl script to $ftp->login($user_name,'password') or die "Cannot login ", $ftp->message;... (2 Replies)
Discussion started by: pritish.sas
2 Replies

8. Shell Programming and Scripting

Sending Attachment using MIME::Lite and Net::SMTP

Hello, I'm a newbie perl scriptor and i'm trying to figure out why i can't send an email using MIME::Lite with Net::SMTP. I keep receiving the following error: SMTP MAIL command failed: 5.7.1 Helo invalid . at attach1.pl line 31 The error keeps coming from the very last line... (2 Replies)
Discussion started by: xmaverick
2 Replies

9. Shell Programming and Scripting

Best place on the net to get Perl tutorials ?

I am looking for a full Perl course on internet (tutorial) to learn everything about Perl. I already know a bunch of programing languages. I have started Unix interests this year ever since I installed Ubuntu Linux on my PC AND I also got a job at IBM doing software distributions with... (1 Reply)
Discussion started by: Browser_ice
1 Replies

10. Shell Programming and Scripting

Net::smtp - Did this work

Hi, I have read the related posts by perleo and those who assisted. I wish to do a similar thing, in that I wish to use the Net:smtp module. I have downloaded it and followed the instructions for the install. When I check the perldoc net::smtp, the information returns (thus showing it... (1 Reply)
Discussion started by: cheng
1 Replies
Login or Register to Ask a Question
Server(3pm)						User Contributed Perl Documentation					       Server(3pm)

NAME
Net::SMTP::Server - A native Perl SMTP Server implementation for Perl. SYNOPSIS
use Carp; use Net::SMTP::Server; use Net::SMTP::Server::Client; use Net::SMTP::Server::Relay; $server = new Net::SMTP::Server('localhost', 25) || croak("Unable to handle client connection: $! "); while($conn = $server->accept()) { # We can perform all sorts of checks here for spammers, ACLs, # and other useful stuff to check on a connection. # Handle the client's connection and spawn off a new parser. # This can/should be a fork() or a new thread, # but for simplicity... my $client = new Net::SMTP::Server::Client($conn) || croak("Unable to handle client connection: $! "); # Process the client. This command will block until # the connecting client completes the SMTP transaction. $client->process || next; # In this simple server, we're just relaying everything # to a server. If a real server were implemented, you # could save email to a file, or perform various other # actions on it here. my $relay = new Net::SMTP::Server::Relay($client->{FROM}, $client->{TO}, $client->{MSG}); } DESCRIPTION
The Net::SMTP::Server module implements an RFC 821 compliant SMTP server, completely in Perl. It's extremely extensible, so adding in things like spam filtering, or more advanced routing and handling features can be easily handled. An additional module, Net::SMTP::Server::Relay has also been implemented as an example of just one application of this extensibility. See the pod for more details on that module. This extension has been tested on both Unix and Win32 platforms. Creating a new server is as trivial as: $server = new Net::SMTP::Server($host, $port); This creates a new SMTP::Server. Both $host and $port are optional, and default to the current hostname and the standard SMTP port(25). However, if you run on a multi-homed machine, you may want to explicitly specify which interface to bind to. The server loop should look something like this: while($conn = $server->accept()) { my $client = new Net::SMTP::Server::Client($conn) || croak("Unable to handle client connection: $! "); $client->process; } The server will continue to accept connections forever. Once we have a connection, we create a new Net::SMTP::Server::Client. This is a new client connection that will now be handled. The reason why processing doesn't begin here is to allow for any extensibility or hooks a user may want to add in after we've accepted the client connection, but before we give the initial welcome message to the client. Once we're ready to process an SMTP session, we call $client->process. This may HANG while the SMTP transaction takes place, as the client and server are communicating back and forth (and if there's a lot of data to transmit, well...). Once $client->process returns, various fields have been filled in. Those are: $client->{TO} -- This is an array containing the intended recipients for this message. There may be multiple recipients for any given message. $client->{FROM} -- This is the sender of the given message. $client->{MSG} -- The actual message data. :) The SMTP::Server module performs no other processing for the user. It's meant to give you the building blocks of an extensible SMTP server implementation. For example, using the MIME modules, you can easily process $client->{MSG} to handle MIME attachments, etc. Or you could implement ACLs to control who can connect to the server, or what actions are taken. Finally, a suggested use that the author himself uses, is as an SMTP relay. There are lots of times I need access to an SMTP server just to send a message, but don't have access to one for whatever reason (firewalls, permissions, etc). You can run your own SMTP server whether under Unix or Win32 environments, and simply point your favorite mail client to it when sending messages. See the Net::SMTP::Server::Relay modules for details on that use. AUTHOR AND COPYRIGHT Net::SMTP::Server / SMTP::Server is Copyright(C) 1999, MacGyver (aka Habeeb J. Dihu) <macgyver@tos.net>. ALL RIGHTS RESERVED. You may distribute this package under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file. SEE ALSO
Net::SMTP::Server::Client, Net::SMTP::Server::Relay perl v5.10.1 1999-12-28 Server(3pm)