getting mail to use the smtp server
I have a question for a mail program wiz. I'm using 'mail' to send out a message from within a program using "/usr/bin/mail -s "subject" < "filename &" How do I make it talk to the network's smtp server? It works fine is I have the local sendmail running (except, of course that it can't get out thru the firewall :) ) When I was using elm to do this, it used the smtp server without any intervention from me, so I'm a bit at a loss... alan -- http://www.ibgames.net/alan Registered Linux user #6822 http://counter.li.org Winding Down - Weekly Tech Newsletter - subscribe at http://www.ibgames.net/alan/winding/mailing.html
On Sunday 30 May 2004 22:40, alan@ibgames.com wrote:
I have a question for a mail program wiz.
I'm using 'mail' to send out a message from within a program using
"/usr/bin/mail -s "subject" < "filename &"
How do I make it talk to the network's smtp server? It works fine is I have the local sendmail running (except, of course that it can't get out thru the firewall :) )
When I was using elm to do this, it used the smtp server without any intervention from me, so I'm a bit at a loss...
alan -- http://www.ibgames.net/alan Registered Linux user #6822 http://counter.li.org Winding Down - Weekly Tech Newsletter - subscribe at http://www.ibgames.net/alan/winding/mailing.html
Well presumably you can get out somehow, if not thru the firewall than via an internal mail server. In that case, set your MTA in your box to use a smarthost (the same host you configure for when sending mail from behind the firewall). Yast has settings for this I believe. -- _____________________________________ John Andersen
The Monday 2004-05-31 at 07:40 +0100, alan@ibgames.com wrote:
I have a question for a mail program wiz.
I'm using 'mail' to send out a message from within a program using
"/usr/bin/mail -s "subject" < "filename &"
How do I make it talk to the network's smtp server? It works fine is I have the local sendmail running (except, of course that it can't get out thru the firewall :) )
I think "mail" calls the sendmail program for sending mail - that's why postfix has a "sendmail" binary - then you have to configure your local MTA (postfix, I suppose) to send mail through your network server. -- Cheers, Carlos Robinson
Carlos E. R. wrote:
The Monday 2004-05-31 at 07:40 +0100, alan@ibgames.com wrote:
I have a question for a mail program wiz.
I'm using 'mail' to send out a message from within a program using
"/usr/bin/mail -s "subject" < "filename &"
How do I make it talk to the network's smtp server? It works fine is I have the local sendmail running (except, of course that it can't get out thru the firewall :) )
I think "mail" calls the sendmail program for sending mail - that's why postfix has a "sendmail" binary - then you have to configure your local MTA (postfix, I suppose) to send mail through your network server.
According to man mail, a command like 'set smtp=smtp.your_isp.com' should do it. "Normally, nail invokes sendmail(8) directly to transfer messages. If smtp is set, a SMTP connection to the server specified by the value of this variable is used instead." However, after studying 'man mail' I haven't succeeded to send *any* message with 'mail' yet. After pressing Ctrl-D at the beginning of a line, 'EOT' appears, the bash prompt is back and nothing has been sent. So if your attempts have been successful, I'd be interested in how you did it. SH
The Tuesday 2004-06-01 at 21:51 +0200, Sjoerd Hiemstra wrote: Sorry, I forgot to answer this one.
I'm using 'mail' to send out a message from within a program using
"/usr/bin/mail -s "subject" < "filename &"
How do I make it talk to the network's smtp server? It works fine is I have the local sendmail running (except, of course that it can't get out thru the firewall :) )
I think "mail" calls the sendmail program for sending mail - that's why postfix has a "sendmail" binary - then you have to configure your local MTA (postfix, I suppose) to send mail through your network server.
According to man mail, a command like 'set smtp=smtp.your_isp.com' should do it.
That would have to go into the $HOME/.mailrc file.
"Normally, nail invokes sendmail(8) directly to transfer messages. If smtp is set, a SMTP connection to the server specified by the value of this variable is used instead."
Mmm. Just a note: The program "mail" included in recent versions of SuSE (since perhaps 8.1 or 8.2) is in fact, "nail" - as can be seen from "man mail". This new mail program is way more powerfull than the old, standard, "mail" program.
However, after studying 'man mail' I haven't succeeded to send *any* message with 'mail' yet. After pressing Ctrl-D at the beginning of a line, 'EOT' appears, the bash prompt is back and nothing has been sent. So if your attempts have been successful, I'd be interested in how you did it.
Let me think. You are trying to use an external SMTP server, because if you use you local sendmail it doesn't get out because of the firewall. My guess would be that "mail" can't also get out, because of the firewall: after all, it needs to use the same port as sendmail/postfix would use. If your setup is diferent or I missunderstood, please explain. -- Cheers, Carlos Robinson
On Sat 12 June, Carlos E. R. wrote: On Tue 1 June, I wrote: On Mon 31 May, Carlos E.R. wrote: On Mon 31 May, alan@ibgames.com wrote:
I'm using 'mail' to send out a message from within a program using
"/usr/bin/mail -s "subject" < "filename &"
How do I make it talk to the network's smtp server? It works fine is I have the local sendmail running (except, of course that it can't get out thru the firewall :) )
I think "mail" calls the sendmail program for sending mail - that's why postfix has a "sendmail" binary - then you have to configure your local MTA (postfix, I suppose) to send mail through your network server.
According to man mail, a command like 'set smtp=smtp.your_isp.com' should do it.
That would have to go into the $HOME/.mailrc file.
Ah - that appears to be the missing link! I can have 'mail' send messages now. Thanks!
Just a note: The program "mail" included in recent versions of SuSE (since perhaps 8.1 or 8.2) is in fact, "nail" - as can be seen from "man mail". This new mail program is way more powerfull than the old, standard, "mail" program.
(Running 8.2 here) sh: ~> file /bin/mail /bin/mail: symbolic link to ../usr/bin/nail sh: ~> file /usr/bin/Mail /usr/bin/Mail: symbolic link to nail sh: ~> file /usr/bin/mail /usr/bin/mail: symbolic link to nail sh: ~> file /usr/bin/mailx /usr/bin/mailx: symbolic link to nail sh: ~> rpm -qf /usr/bin/nail mailx-10.3-31 Everything is just the same, eh?
However, after studying 'man mail' I haven't succeeded to send *any* message with 'mail' yet. After pressing Ctrl-D at the beginning of a line, 'EOT' appears, the bash prompt is back and nothing has been sent. So if your attempts have been successful, I'd be interested in how you did it.
Let me think. You are trying to use an external SMTP server, because if you use you local sendmail it doesn't get out because of the firewall. My guess would be that "mail" can't also get out, because of the firewall: after all, it needs to use the same port as sendmail/postfix would use.
If your setup is diferent or I missunderstood, please explain.
Uhm, I just never took the effort to install the local mail system and find out how to set more than one provider and that sort of things. With wvdial and wvdial.conf it's very clear and easy, so I'd rather stick with that. Regards, Sjoerd
The Monday 2004-06-14 at 21:13 +0200, Sjoerd Hiemstra wrote:
According to man mail, a command like 'set smtp=smtp.your_isp.com' should do it.
That would have to go into the $HOME/.mailrc file.
Ah - that appears to be the missing link! I can have 'mail' send messages now. Thanks!
Welcome!
Just a note: The program "mail" included in recent versions of SuSE (since perhaps 8.1 or 8.2) is in fact, "nail" - as can be seen from "man mail". This new mail program is way more powerfull than the old, standard, "mail" program.
(Running 8.2 here) sh: ~> file /bin/mail /bin/mail: symbolic link to ../usr/bin/nail sh: ~> file /usr/bin/Mail /usr/bin/Mail: symbolic link to nail sh: ~> file /usr/bin/mail /usr/bin/mail: symbolic link to nail sh: ~> file /usr/bin/mailx /usr/bin/mailx: symbolic link to nail sh: ~> rpm -qf /usr/bin/nail mailx-10.3-31
Everything is just the same, eh?
Yes, now they are. Previously they were different, and I had to download and compile "nail" myself to get the extra features it has compared to the "mail" that came with the system.
Uhm, I just never took the effort to install the local mail system and find out how to set more than one provider and that sort of things. With wvdial and wvdial.conf it's very clear and easy, so I'd rather stick with that.
Getting mail from different providers (accounts) is very easy, with almost anything. I use fetchmail. Sending from different accounts is more dificult. Programs like "mozilla" have the possibility to send trhough different smtp servers, acording to the identity used to write the email. Tuning the local smtp machine to do the same is more difficult: it is far easier to simply use sendmail or postfix to send directly to each destination - with a problem, because recently, as a side efect of spammers and viruses, more and more servers are rejecting mail sent from dynamic addresses. :-/ However, now postfix seems to admit configuration of different smtp servers to relay mail to, according to the from address - I still have not tried that: and the default postfix on suse 8.2 can not do that. -- Cheers, Carlos Robinson
* Carlos E. R. <xx@xx.xx> [06-14-04 19:23]:
Tuning the local smtp machine to do the same is more difficult: it is far easier to simply use sendmail or postfix to send directly to each destination - with a problem, because recently, as a side efect of spammers and viruses, more and more servers are rejecting mail sent from dynamic addresses. :-/
However, now postfix seems to admit configuration of different smtp servers to relay mail to, according to the from address - I still have not tried that: and the default postfix on suse 8.2 can not do that.
Are you sure the default postfix on suse 8.2 cannot? I could with the default on 8.1 and am presently on 9.0. edit /etc/postifx/transport instructions are in the 'transport' file as root 'postmap /etc/postfix/transport' as root 'rcpostfix restart' and you are there.... -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/photos
The Monday 2004-06-14 at 20:48 -0500, Patrick Shanahan wrote:
However, now postfix seems to admit configuration of different smtp servers to relay mail to, according to the from address - I still have not tried that: and the default postfix on suse 8.2 can not do that.
Are you sure the default postfix on suse 8.2 cannot? I could with the default on 8.1 and am presently on 9.0.
edit /etc/postifx/transport instructions are in the 'transport' file
as root 'postmap /etc/postfix/transport' as root 'rcpostfix restart'
and you are there....
Yes, that's correct; but you can only choose transport based on the destination. The ability to choose smtp server based on the origin of the email is new. Or was - I don't know when it appeared, but SuSE 8.2 couldn't (unless you update from people/choeger/, as I did). -- Cheers, Carlos Robinson
participants (5)
-
alan@ibgames.com
-
Carlos E. R.
-
John Andersen
-
Patrick Shanahan
-
Sjoerd Hiemstra