Discussion:
Cygwin Mail and Exchange Server
Ronald Fischer
2008-05-19 12:04:11 UTC
Permalink
Hello,

at a customer's site, I would like to be able to send email from
bash scripts. The setup of the software is pretty standard: Usually
mail is sent and read using Outlook, and there is an Exchange server
lurking somewhere to do the job. What do I have to do in such an
environment in order to be able to send mail from cygwin?

I thought this is such a common setup that there must be somewhere a
"howto" for this subject, but I searched the Cygwin FAQ, the Cygwin
User Guide, and /usr/doc/cygwin without success. Isn't there a Cygwin
utility which simply uses the settings in Outlook to send the mail?

Ronald
Dave Korn
2008-05-19 12:16:26 UTC
Permalink
Post by Ronald Fischer
Hello,
at a customer's site, I would like to be able to send email from
bash scripts. The setup of the software is pretty standard: Usually
mail is sent and read using Outlook, and there is an Exchange server
lurking somewhere to do the job. What do I have to do in such an
environment in order to be able to send mail from cygwin?
You need to ask your admins for POP and SMTP access details of your
exchangeserver, then you'd probably enter those details into your
/etc/ssmtp/ssmtp.conf (or equivalent depending what mailer you're using).
Post by Ronald Fischer
I thought this is such a common setup that there must be somewhere a
"howto" for this subject, but I searched the Cygwin FAQ, the Cygwin
User Guide, and /usr/doc/cygwin without success. Isn't there a Cygwin
utility which simply uses the settings in Outlook to send the mail?
Nope. It's not like Microsoft have documented how any of that stuff is
stored, after all. And since Cygwin is mostly ports of Linux stuff, and
Linux doesn't have any such things as outlook or exchange server, none of
the linux software that gets ported is written to even consider it.


cheers,
DaveK
--
Can't think of a witty .sigline today....
Ronald Fischer
2008-05-19 12:28:29 UTC
Permalink
Post by Dave Korn
Post by Ronald Fischer
at a customer's site, I would like to be able to send email from
bash scripts. The setup of the software is pretty standard: Usually
mail is sent and read using Outlook, and there is an Exchange server
lurking somewhere to do the job. What do I have to do in such an
environment in order to be able to send mail from cygwin?
You need to ask your admins for POP and SMTP access details of your
exchangeserver,
I guess in my case (sending only) I just need SMTP. Or is it necessary
that ssmtp.conf always contains POP too? And, AFIK, the access method
to the exchange server is not POP, but IMAP...
Post by Dave Korn
then you'd probably enter those details into your
/etc/ssmtp/ssmtp.conf (or equivalent depending what mailer you're using).
Is there a simpler command line utility for sending mail - I mean,
simpler than ssmtp -, which you could recommend?
Post by Dave Korn
Post by Ronald Fischer
I thought this is such a common setup that there must be somewhere a
"howto" for this subject, but I searched the Cygwin FAQ, the Cygwin
User Guide, and /usr/doc/cygwin without success. Isn't there a Cygwin
utility which simply uses the settings in Outlook to send the mail?
Nope. It's not like Microsoft have documented how any of that stuff is
stored, after all.
And since Cygwin is mostly ports of Linux stuff, and
Linux doesn't have any such things as outlook or exchange server, none of
the linux software that gets ported is written to even consider it.
Understandable...

Thanks a lot,

Ronald Fischer
Dave Korn
2008-05-19 12:52:15 UTC
Permalink
Post by Ronald Fischer
Post by Dave Korn
Post by Ronald Fischer
at a customer's site, I would like to be able to send email from
bash scripts. The setup of the software is pretty standard: Usually
mail is sent and read using Outlook, and there is an Exchange server
lurking somewhere to do the job. What do I have to do in such an
environment in order to be able to send mail from cygwin?
You need to ask your admins for POP and SMTP access details of your
exchangeserver,
I guess in my case (sending only) I just need SMTP. Or is it necessary
that ssmtp.conf always contains POP too? And, AFIK, the access method
to the exchange server is not POP, but IMAP...
Sorry for the lack of clarity; yes, if all you're doing is sending, all
you need is an SMTP server.
Post by Ronald Fischer
Post by Dave Korn
then you'd probably enter those details into your
/etc/ssmtp/ssmtp.conf (or equivalent depending what mailer you're using).
Is there a simpler command line utility for sending mail - I mean,
simpler than ssmtp -, which you could recommend?
ssmtp is the only one I've used, I'll leave it to the list for their
recommendations.


cheers,
DaveK
--
Can't think of a witty .sigline today....
Reid Thompson
2008-05-19 13:24:10 UTC
Permalink
I generally use mutt on the command line

ssmtp must still be configured and you need to answer YES to linking
sstmp to sendmail

$ mutt -x -s "the subject" ***@domain.com

$ mutt -x -s "the subject" -a "/path/to/file/to/attach" ***@domain.com

$ (uuencode afile afile) | mutt -x -s "subject" ***@domain.com

etc,etc

see the mutt page on the web for more info.

I often use cygwin mutt to read my exchange mail via imap when other email clients aren't available.

reid
Post by Ronald Fischer
Post by Dave Korn
Post by Ronald Fischer
at a customer's site, I would like to be able to send email from
bash scripts. The setup of the software is pretty standard: Usually
mail is sent and read using Outlook, and there is an Exchange server
lurking somewhere to do the job. What do I have to do in such an
environment in order to be able to send mail from cygwin?
You need to ask your admins for POP and SMTP access details of your
exchangeserver,
I guess in my case (sending only) I just need SMTP. Or is it necessary
that ssmtp.conf always contains POP too? And, AFIK, the access method
to the exchange server is not POP, but IMAP...
Post by Dave Korn
then you'd probably enter those details into your
/etc/ssmtp/ssmtp.conf (or equivalent depending what mailer you're using).
Is there a simpler command line utility for sending mail - I mean,
simpler than ssmtp -, which you could recommend?
Post by Dave Korn
Post by Ronald Fischer
I thought this is such a common setup that there must be somewhere a
"howto" for this subject, but I searched the Cygwin FAQ, the Cygwin
User Guide, and /usr/doc/cygwin without success. Isn't there a Cygwin
utility which simply uses the settings in Outlook to send the mail?
Nope. It's not like Microsoft have documented how any of that stuff is
stored, after all.
And since Cygwin is mostly ports of Linux stuff, and
Linux doesn't have any such things as outlook or exchange server, none of
the linux software that gets ported is written to even consider it.
Understandable...
Thanks a lot,
Ronald Fischer
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
Samuel Robb
2008-05-19 13:49:16 UTC
Permalink
Post by Ronald Fischer
Is there a simpler command line utility for sending mail - I mean,
simpler than ssmtp -, which you could recommend?
In a past life, I've used blat:

http://www.blat.net/

It's a public-domain Win32 console program, though, not a Cygwin
utility. As the blat FAQ points out, too, if you have perl installed,
it's simple enough send mail via smtp (using Net::SMTP, for example.)

-Samrobb
Andrew DeFaria
2008-05-19 14:31:38 UTC
Permalink
Post by Ronald Fischer
Post by Dave Korn
Post by Ronald Fischer
at a customer's site, I would like to be able to send email from
bash scripts. The setup of the software is pretty standard: Usually
mail is sent and read using Outlook, and there is an Exchange server
lurking somewhere to do the job. What do I have to do in such an
environment in order to be able to send mail from cygwin?
You need to ask your admins for POP and SMTP access details of your
exchangeserver,
I guess in my case (sending only) I just need SMTP. Or is it necessary
that ssmtp.conf always contains POP too? And, AFIK, the access method
to the exchange server is not POP, but IMAP...
No need to ask the admins, you can lookup these settings directly in
Outlook under Tools: Email accounts. It probably won't say anything
about POP/IMAP but you can just do "telnet <mail server> POP" or "telnet
<mail server> IMAP". If it responds with a server at the other end then
you know it's up. I'd recommend IMAP and I usually just through that
server name into Thunderbird and I'm good to go. You can enter the same
settings into your /etc/ssmtp/ssmtp.conf file too..
--
Andrew DeFaria <http://defaria.com>
Always borrow money from pessimists. They don't expect to be paid back.
Ronald Fischer
2008-05-19 15:21:53 UTC
Permalink
Post by Andrew DeFaria
No need to ask the admins, you can lookup these settings directly in
Outlook under Tools: Email accounts. It probably won't say anything
about POP/IMAP but you can just do "telnet <mail server> POP" or "telnet
<mail server> IMAP". If it responds with a server at the other end then
you know it's up.
Thanks a lot, to all who have helped!

Ronald
Reid Thompson
2008-05-19 13:38:09 UTC
Permalink
Post by Ronald Fischer
Hello,
at a customer's site, I would like to be able to send email from
bash scripts. The setup of the software is pretty standard: Usually
mail is sent and read using Outlook, and there is an Exchange server
lurking somewhere to do the job. What do I have to do in such an
environment in order to be able to send mail from cygwin?
I thought this is such a common setup that there must be somewhere a
"howto" for this subject, but I searched the Cygwin FAQ, the Cygwin
User Guide, and /usr/doc/cygwin without success. Isn't there a Cygwin
utility which simply uses the settings in Outlook to send the mail?
These types of things can be done from scripts

***@raker ~ $ cat ./testmail.sh
#!/bin/bash

echo "this is a script email test" | mutt -x -s testscript ***@domain.com

cat "testfile" | mutt -x -s testscript ***@domain.com



etc, etc
Frank Fesevur
2008-05-19 17:39:45 UTC
Permalink
Post by Ronald Fischer
at a customer's site, I would like to be able to send email from
bash scripts. The setup of the software is pretty standard: Usually
mail is sent and read using Outlook, and there is an Exchange server
lurking somewhere to do the job. What do I have to do in such an
environment in order to be able to send mail from cygwin?
I thought this is such a common setup that there must be somewhere a
"howto" for this subject, but I searched the Cygwin FAQ, the Cygwin
User Guide, and /usr/doc/cygwin without success. Isn't there a Cygwin
utility which simply uses the settings in Outlook to send the mail?
Have you tried the cygwin "email" package? It talks directly to an SMTP server.

Regards,
Frank
Ronald Fischer
2008-05-20 13:39:36 UTC
Permalink
Post by Frank Fesevur
Have you tried the cygwin "email" package? It talks directly to an SMTP server.
Good suggestion. I think I'll stick with this.

Ronald

Loading...