LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-30-2010, 04:12 PM   #1
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Rep: Reputation: 30
nail not respnding


I run this script but it hangs at the nail command like it's expecting a response. Any ideas how to get it to send automatically?

Code:
#!/bin/bash
emailadd="aaa@aaa.co.uk"
usern="testcert"

cd /etc/openvpn/
cd /etc/openvpn/easy-rsa/2.0/
source ./vars

#create certificates
./pkitool $usern

#zip files
cd /etc/openvpn/easy-rsa/2.0/keys/
zip $usern.zip ca.crt $usern.crt $usern.csr $usern.key client.ovpn

#email files
nail -r sales@aaa.co.uk -s "Proxyserver VPN Keys" -a $usern.zip $emailadd

#delete any unecessary files
rm -rf $usern.zip

Last edited by qwertyjjj; 03-30-2010 at 05:20 PM.
 
Old 03-30-2010, 04:25 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

nail is waiting for the message body. If you don't want to write anything in the body, just redirect /dev/null into message:
Code:
nail -r sales@proxyplayer.co.uk -s "Proxyserver VPN Keys" -a $usern.zip $emailadd < /dev/null
Regards
 
Old 03-30-2010, 05:11 PM   #3
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by bathory View Post
Hi,

nail is waiting for the message body. If you don't want to write anything in the body, just redirect /dev/null into message:
Code:
nail -r sales@aaa.co.uk -s "Proxyserver VPN Keys" -a $usern.zip $emailadd < /dev/null
Regards
If I need text in the body is there any command line option like --body or do I just type the message after $emailadd?

Last edited by qwertyjjj; 03-30-2010 at 05:20 PM.
 
Old 03-30-2010, 05:19 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
No, but you use any of the following:
Code:
nail -r sales@proxyplayer.co.uk -s "Proxyserver VPN Keys" -a $usern.zip $emailadd < message.txt
cat message.txt|nail -r sales@proxyplayer.co.uk -s "Proxyserver VPN Keys" -a $usern.zip $emailadd
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
nail with smtp The_Spider Linux - Software 2 08-01-2007 07:17 PM
nail not sending mail thedlw Linux - General 1 08-31-2006 05:32 PM
mutt vs. nail Berhanie Linux - Software 3 09-02-2004 07:48 PM
Setting up nail NonSumPisces Linux - Newbie 0 07-03-2004 05:28 PM
Getting Nail to work on a network mattp Linux - Networking 0 03-27-2004 12:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration