Sponsored Content
Top Forums Shell Programming and Scripting MAILX too much time to send email Post 302933729 by occhiverdi1987 on Monday 2nd of February 2015 05:30:27 AM
Old 02-02-2015
Question MAILX too much time to send email

Hello,
I am using heirloom-mailx on UBUNTU 11.04 to create a bash script that sends an e-mail with an attachment.
The command invoked is :
Code:
echo $BODY | mailx -v \
-S smtp=smtps://$smtpmailserver:465 \
-S from=$MITTENTE \
-S ssl-verify=ignore \
-S smtp-auth=login \
-S smtp-auth-user=$USER \
-S smtp-auth-password=$PASSWORD \
-s "$SUBJECT" \
-a $ATTACHMENT \
$RECIPIENT

The result is :
Code:
Resolving host xxxxxxxxxx . . . done.
Connecting to xxxxxxxxxx . . . connected.

Then I have to wait ONE MINUTE before it appears the following:

Code:
220 (mail-server) ESMTP ready
>>> EHLO svn
250-(mail-server)
250-AUTH CRAM-MD5 PLAIN LOGIN DIGEST-MD5 NTLM
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-PIPELINING
250-ETRN
250-DSN
250 HELP
>>> AUTH LOGIN
334 (string)
>>> (string)
334 (string)
>>> (string)
235 2.0.0 Authentication successful
>>> MAIL FROM:<(sender)>
250 2.1.0 Sender <(sender)> ok
>>> RCPT TO:<(recipient)>
250 2.1.5 Recipient <(recipient)> ok (local)
>>> DATA
354 Enter mail, end with CRLF.CRLF
>>> .
250 2.0.0 (string) Message accepted for delivery
>>> QUIT
221 2.0.0 SMTP closing connection

Do you know why there is such a delay? How can I reduce the sending time?
It is not linked to the attached file, I have to wait also if it is not present.

Thanks in advance for any reply.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Unable to send eMail from a UNIX-Host ( using mailx ) to a Outlook-email-addres(Win)

Hi A) I am able to send eMail using mailx from a UNIX ( solaris 8 ) host to my Outlook-email-ID : FName.Surname@Citigroup.com ( This is NOT my actual -eMail-ID). But in Outlook the "From :" eMail address is displayed as " usr1@unix-host1.unregistered.email.citicorp.com " .i.e the words... (2 Replies)
Discussion started by: Vetrivela
2 Replies

2. Shell Programming and Scripting

Using mailx to send email to multiple users.

Hi, I am using the mailx command to send email to multple users. The command works fine when i am sending mail to a single user but when i insert multiple email ids inside the quote it does not work. All the email ids are coming from a property file.Please have a lookt at the property file and... (4 Replies)
Discussion started by: priyaksingh
4 Replies

3. Shell Programming and Scripting

How to send attachment to web-based email client using mailx

hi, i am trying to send mail with attachment to web-based email client like gmail.com using mailx. the problem is it is displayed in content rather than as attachment. the code i am using is as follows, uuencode test1.txt test1.txt | mailx -s "test only" aaaa@gmail.com does anyone... (1 Reply)
Discussion started by: randomcz1
1 Replies

4. UNIX Desktop Questions & Answers

Using Mailx to send to list of email addresses

Im trying to use a shell script to send to a list of email addresses in a txt file. Here is what i have tried but it keeps sending to dead.letter... Success.ksh contains... mailx -s"Night Batch Success" 'cat /Scripts/email_addresses.txt' < /Scripts/email_body_message.txt The email body... (1 Reply)
Discussion started by: aguad3
1 Replies

5. UNIX for Dummies Questions & Answers

Not able to send email as CC to a ID using Mailx command in HP UX

Hey Guys, I have been trying to send a email as ccto a email ID .However it seems the -c option is not working in HP UX system. It is shooting an error as "mailx: illegal option -- c" My script isin the below manner: mailx -c EMAIL_IDS_CC# -s 'BDC reminder' -r sender@email.com... (1 Reply)
Discussion started by: rohit.shetty84
1 Replies

6. UNIX for Advanced & Expert Users

Send email using alias name through mailx

Hi, My requirement is I have to send email using mailx command and the recipient of the mail should see a alias instead of email address in his mail box. The same functionality that we get when we sent email using an address book. Is this functionality possible through mailx? I tried doing... (5 Replies)
Discussion started by: vamsisurampalli
5 Replies

7. Solaris

How can i use Mailx to send email

I would like to use Mailx command, please i hope when you replay give me example. because this is very good think for me. I am New in sun Microsystems Solaris 10, i hope to give me also rules to learn Solaris easily. Thank you Joseph Shafik (8 Replies)
Discussion started by: J.shafik
8 Replies

8. Shell Programming and Scripting

Need Syntax for mailx to send email to CC

I am trying to send email using "echo "Test Email" | mailx -s "Subject" someone@xyz.com I also want to send CC to another email address along with TO using above statement. Can anyone please help me on this. Thanks. (2 Replies)
Discussion started by: swap27
2 Replies

9. UNIX for Dummies Questions & Answers

Send email with attachment and body : mailx , waiting for input , signal Control D

Hi, I am trying to send email with attacment and body using "mailx" (cat body.txt; uuencode attach.txt) | mailx -s "Attachment" abc@xyz.com When i type this command, the shell is still waiting for me to enter something in standard input and press control D before it sends a mail and... (2 Replies)
Discussion started by: aliaszero
2 Replies

10. Debian

sendmail taking too much time to send a email

Hi , I'm using sendmail command to send a email. To send a email sendmail taking 3minutes to complete the process. Is there any configuration needs to be done in server or another solution is there to resolve this issue. Thanks in Advance. Regards Latika (1 Reply)
Discussion started by: latika
1 Replies
Net::SMTP::TLS::ButMaintained(3pm)			User Contributed Perl Documentation			Net::SMTP::TLS::ButMaintained(3pm)

NAME
Net::SMTP::TLS::ButMaintained - An SMTP client supporting TLS and AUTH VERSION
version 0.17 SYNOPSIS
use Net::SMTP::TLS::ButMaintained; my $mailer = Net::SMTP::TLS::ButMaintained->new( 'your.mail.host', Hello => 'some.host.name', Port => 25, #redundant User => 'emailguy', Password=> 's3cr3t'); $mailer->mail('emailguy@your.mail.host'); $mailer->to('someonecool@somewhere.else'); $mailer->data; $mailer->datasend("Sent thru TLS!"); $mailer->dataend; $mailer->quit; DESCRIPTION
Net::SMTP::TLS::ButMaintained is forked from Net::SMTP::TLS. blame "Evan Carroll" for the idea. :) Net::SMTP::TLS::ButMaintained is a TLS and AUTH capable SMTP client which offers an interface that users will find familiar from Net::SMTP. Net::SMTP::TLS::ButMaintained implements a subset of the methods provided by that module, but certainly not (yet) a complete mirror image of that API. The methods supported by Net::SMTP::TLS::ButMaintained are used in the above example. Though self explanatory for the most part, please see the perldoc for Net::SMTP if you are unclear. The differences in the methods provided are as follows: The mail method does not take the options list taken by Net::SMTP The to method also does not take options, and is the only method available to set the recipient (unlike the many synonyms provided by Net::SMTP). The constructor takes a limited number of Net::SMTP's parameters. The constructor for Net::SMTP::TLS::ButMaintained takes the following (in addition to the hostname of the mail server, which must be the first parameter and is not explicitly named): NoTLS - In the unlikely event that you need to use this class to perform non-TLS SMTP (you ought to be using Net::SMTP itself for that...), this will turn off TLS when supplied with a true value. This will most often cause an error related to authentication when used on a server that requires TLS Hello - hostname used in the EHLO command Port - port to connect to the SMTP service (defaults to 25) Timeout - Timeout for inital socket connection (defaults to 5, passed directly to IO::Socket::INET) User - username for SMTP AUTH Password - password for SMTP AUTH TLS and AUTHentication During construction of an Net::SMTP::TLS::ButMaintained instance, the full login process will occur. This involves first sending EHLO to the server, then initiating a TLS session through STARTTLS. Once this is complete, the module will attempt to login using the credentials supplied by the constructor, if such credentials have been supplied. The AUTH method will depend on the features returned by the server after the EHLO command. Based on that, CRAM-MD5 will be used if available, followed by LOGIN, followed by PLAIN. Please note that LOGIN is the only method of authentication that has been tested. CRAM-MD5 and PLAIN login functionality was taken directly from the script mentioned in the acknowledgements section, however, I have not tested them personally. ERROR HANDLING This module will croak in the event of an SMTP error. Should you wish to handle this gracefully in your application, you may wrap your mail transmission in an eval {} block and check $@ afterward. ACKNOWLEDGEMENTS This code was blatantly plagiarized from Michal Ludvig's smtp-client.pl script. See <http://www.logix.cz/michal/devel/smtp> for his excellent work. Improvements courtesy of Tomek Zielinski AUTHORS
o Alexander Christian Westholm <awestholm at verizon dawt net> o Fayland Lam <fayland@gmail.com> COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Alexander Christian Westholm, Fayland Lam. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2013-12-04 Net::SMTP::TLS::ButMaintained(3pm)
All times are GMT -4. The time now is 08:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy