LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 06-11-2007, 12:28 PM   #1
Casey
LQ Newbie
 
Registered: Feb 2007
Location: Durban, South Africa
Distribution: Ubuntu / Debian / Suse
Posts: 9

Rep: Reputation: 0
Syntax using nail (mailx) for smtp without postfix or sendmail


We have a database server that does not have a mail system configured.
Some remote endusers have asked if they can have their reports emailed to them.

Can I use mailx without a mailserver. No Postfix/Sendmail configured on the unit.
All mail will be outgoing smtp. No incoming.
Having never used it before I cannot seem to get the syntax right.
The command I need to get working is something like:


nail -s "Requested Report" -smtp smtp.my.isp -a report.txt joe@soap.com


But everytime I run it it just hangs. No error message, nothing.
I then have to Ctrl-C twice to get back to the command line.

Distro is OpenSuse Linux 9.2 (Soon to be upgraded I hope)
Do I have to configure a .mailrc directory for every user in their home directory?
Do I have to configure Sendmail or Postfix?
I would rather avoid that if possible.
There must be a simple solution!

Casey.
 
Old 06-11-2007, 07:24 PM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Put your ISP's mail server in /etc/nail.rc:
Code:
set smtp=smtp.my.isp
Then, to send the mail you wanted, you would write:
Code:
nail -s "Requested Report" -a report.txt joe@soap.com < /dev/null
Quote:
But everytime I run it it just hangs. No error message, nothing.
It was waiting for you to write your message. That's why the /dev/null part is there, to tell it that there is no message. If you want to write a message, you can end it with a line beginning with <Control>-D or with a line containing only a dot (.), assuming you have set dot in your config.

Last edited by Berhanie; 06-11-2007 at 09:20 PM.
 
Old 06-12-2007, 01:41 AM   #3
Casey
LQ Newbie
 
Registered: Feb 2007
Location: Durban, South Africa
Distribution: Ubuntu / Debian / Suse
Posts: 9

Original Poster
Rep: Reputation: 0
Sorted...

Thanks Berhanie,

On this distro the config file is /etc/mail.rc where I had to add
set smtp=smtp.myisp.com
set from=my.email.address


Also using < /dev/null gave me the idea to use < /usr/local/message.body

The first test mail worked!
I will write the full implementation later in the week.

Thanks
Casey.

PS. Like all things Linux, it is only hard the first time.
You guys save us a lot of that first-time stress.
 
  


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
can I use sendmail for SMTP instead of my ISP's SMTP server? fcdev Linux - Networking 1 02-05-2007 01:27 AM
sendmail...pine...nail...problem stitchman Slackware 8 12-08-2005 05:31 PM
Nail looking for Sendmail in /usr/lib/sendmail Berhanie Slackware 2 02-22-2005 11:18 AM
Postfix - Only SMTP? Thinkgeekness Linux - Software 12 03-11-2003 03:39 PM
Help with Postfix and SMTP????? graystarr Linux - Software 1 03-10-2003 12:55 PM

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

All times are GMT -5. The time now is 09:31 AM.

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