LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-01-2008, 10:49 AM   #1
rahmad
Member
 
Registered: Aug 2007
Location: Jordan
Distribution: RHEL, Centos, Debian
Posts: 65

Rep: Reputation: 15
Mail MUA with external SMTP server


hi,

anyone knows how can i configure mail command to send e-mails using external smtp server?? i think there should be a way to configure it using .mailrc file... any thoughts?

many thanks
Rami
 
Old 07-01-2008, 07:28 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,140
Blog Entries: 54

Rep: Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791
If you mean "/bin/mail" aka "mailx" then I haven't seen any way to configure the MTA address like you would expect in a CLI MUA, so you likely need to set the "smarthost" or equivalent directive in your MTA.
 
Old 07-02-2008, 04:08 AM   #3
rahmad
Member
 
Registered: Aug 2007
Location: Jordan
Distribution: RHEL, Centos, Debian
Posts: 65

Original Poster
Rep: Reputation: 15
thanks unSpawn,

the thing is, i want to write a cron job that send email using external smtp server not the local MTA.

is there away to install command based smtp clints that can be configured to send from external smtp??

I dont prefer to modify my local sendmail daemon configuration.
 
Old 07-02-2008, 07:18 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,140
Blog Entries: 54

Rep: Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791
Quote:
Originally Posted by rahmad View Post
cron job that send email using external smtp server not the local MTA.
Any compelling reasons why?


Quote:
Originally Posted by rahmad View Post
is there away to install command based smtp clints that can be configured to send from external smtp??
One option could be to install Alpine (formerly "pine") which allows you to configure a MTA for sending (and specify another config on the commandline so you can still use it for day to day mail reading) but if you're going to script it you don't have to: you can use telnet, netcat or maybe Bash itself (/dev/tcp/mailserveraddress/port) to connect to the MTA and use a "here" document (http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html, http://www.tldp.org/LDP/Bash-Beginne...tml/index.html, http://www.tldp.org/LDP/abs/html/) to add the data.


Quote:
Originally Posted by rahmad View Post
I dont prefer to modify my local sendmail daemon configuration.
Ah. If that's the only real reason why, then another option could be to run Sendmail on another port with another configuration (real easy). Note you're expected to use your providers MTA as "smarthost" and not just any random MTA you found: sane administrators would frown on that practice and prohibit it anyway.
 
Old 07-03-2008, 06:12 AM   #5
rahmad
Member
 
Registered: Aug 2007
Location: Jordan
Distribution: RHEL, Centos, Debian
Posts: 65

Original Poster
Rep: Reputation: 15
the links that you sent are general guides about shell programing I didnt find anything helpful. also in my server I didnt find /dev/tcp/ path.

my question now is, if I configured sendmail smarthost feature to point to my external smtp server can I use the /bin/mail to send emails using the external smtp.
 
Old 07-03-2008, 07:18 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,140
Blog Entries: 54

Rep: Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791
Quote:
Originally Posted by rahmad View Post
the links that you sent are general guides about shell programing
Yes, to support the "here" document stuff.


Quote:
Originally Posted by rahmad View Post
I didnt find anything helpful.
Depends on what you're looking for...


Quote:
Originally Posted by rahmad View Post
if I configured sendmail smarthost feature to point to my external smtp server can I use the /bin/mail to send emails using the external smtp.
Enabling "smarthost" means your MTA will send e-mail through your providers remote MTA so yes, it will be sending e-mail using the external MTA.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
cone mua smtp problem mlsfit Linux - Software 0 10-05-2005 06:22 PM
Cron mail sending using outside SMTP mail server Utah Linux - Software 6 08-24-2005 07:44 PM
Postfix mail server not accepting incoming mail from the external interface rexmundi Linux - Networking 7 12-22-2003 03:41 PM
SMTP Mail Server How To facefullofsnow Linux - Software 5 07-16-2003 01:03 AM
smtp? mua? mta? lda?postfix? AWWWW hotrodowner Linux - Networking 22 06-13-2003 10:08 AM


All times are GMT -5. The time now is 03:09 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration