LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-23-2006, 12:22 AM   #1
jantman
Member
 
Registered: Nov 2005
Location: New Jersey, USA
Distribution: SuSE
Posts: 492

Rep: Reputation: 31
Send email via auth'd IMAP from command line


Hello,

I was wondering whether there are any programs out there that will run from the command line and allow me to specify a subject, recipient, IMAP server, username, and password, and pipe in a file for the body of the message?

I need to setup email from a script on a remote server, but would rather not configure postfix if posible. I already have a fully functioning IMAP server at another location which is setup to use authentication. I'm looking for an easy way to have a shell script on a remote machine send email via a specific account on the IMAP server.

Does anything exist to do this?

Thanks,
Jason
 
Old 12-23-2006, 06:09 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
IMAP is a way to retrieve email, not send, so it's really not necessary in order to send your messages.

There are plenty of command line tools, utilities and or CLI email clients you can use to send email.

mail - CL
sendmail - CL
mutt - CL Client
elm - CL Client
pine - CL Client

and many many others.. and CL stands for Command Line.
 
Old 12-23-2006, 06:38 PM   #3
jantman
Member
 
Registered: Nov 2005
Location: New Jersey, USA
Distribution: SuSE
Posts: 492

Original Poster
Rep: Reputation: 31
Sorry... meant SMTP. sorry for the confusion.

And I mean actually from the COMMAND LINE, as in something I can call from a shell script like:

commandname server username password subject recipients < message.txt
 
Old 12-24-2006, 12:41 AM   #4
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
If your running a script you can send an email like this:

Code:
mail -s "Add sometext for subject here" someone@somewhere.com < /dev/null
The /dev/null is used if you are not sending any attachments. If you want to send an attachment:

Code:
mail -s "Add sometext for subject here" someone@somewhere.com < /some/file/somewhere.txt
Hope this is Helpful

Last edited by fotoguy; 12-24-2006 at 12:42 AM.
 
  


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
send email from command line djionel82 Programming 6 11-29-2005 12:12 AM
send email with mutt on command line naijaguy Linux - General 1 12-29-2004 06:33 PM
How to send an mime/html-email by command line ? fluppi Linux - Networking 0 07-08-2004 09:26 AM
trying to send internet email from a command line...is it possible rutman Linux - Newbie 8 06-26-2004 02:19 AM
Can Pine send an email without from the command line without.. rutman Linux - Newbie 2 06-11-2004 04:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:14 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