LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Mail MUA with external SMTP server (http://www.linuxquestions.org/questions/linux-software-2/mail-mua-with-external-smtp-server-652842/)

rahmad 07-01-2008 10:49 AM

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

unSpawn 07-01-2008 07:28 PM

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.

rahmad 07-02-2008 04:08 AM

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.

unSpawn 07-02-2008 07:18 AM

Quote:

Originally Posted by rahmad (Post 3201232)
cron job that send email using external smtp server not the local MTA.

Any compelling reasons why?


Quote:

Originally Posted by rahmad (Post 3201232)
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 (Post 3201232)
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.

rahmad 07-03-2008 06:12 AM

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.

unSpawn 07-03-2008 07:18 AM

Quote:

Originally Posted by rahmad (Post 3202782)
the links that you sent are general guides about shell programing

Yes, to support the "here" document stuff.


Quote:

Originally Posted by rahmad (Post 3202782)
I didnt find anything helpful.

Depends on what you're looking for...


Quote:

Originally Posted by rahmad (Post 3202782)
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.


All times are GMT -5. The time now is 08:04 AM.