Sunday, July 10, 2011

Installing sendmail in Cygwin

To enable the ability to send email from Cygwin, you must install sendmail. Cygwin provides two implementations of sendmail: exim and ssmtp. Either one can be used. The following text shows how to configure exim after it has been installed. In a future post, I will discuss how to send mail using sendmail.

Run the Cygwin setup.exe program, and install the exim package.

Open the Cygwin terminal with administrator privileges. To do this, right click on Cygwin.bat and select "Run as administrator." When the User Account Control dialog box is displayed, click Yes. In the Cygwin terminal, type the following commands.

localhost % exim-config
This script sets some key parameters of the exim
installation and starts the exim daemon.
See the details in /usr/share/doc/Cygwin/exim-X-Y.README.
    Interrupt with ^D.

OK. No usernames contain spaces.

OK. The /etc/aliases file contains "postmaster".

Looking for the fully qualified primary hostname.
Is it "localhost"? (yes/no) yes
OK. Exim will autodiscover that name.

INFO: This version of Exim supports ipv6 by default.
      This feature is currently enabled.
Do you want to change that setting? (yes/no) no
INFO: Some programs expect /usr/sbin/sendmail to handle mail.
      Currently it does not exist.
Linking to exim may affect other programs such as cron.
Do you want to link /usr/sbin/sendmail to /usr/bin/exim ? (yes/no) yes
OK. Done.

Do you want to install the exim daemon as a service? (yes/no) no
WARNING: If running exim as a job, it may stop when you log out.

Do you want to start the exim daemon as a job now? (yes/no) no
OK. Type "/usr/bin/exim -bd -q15m" to start the exim daemon job.

INFO: The exim log files are in /var/log/exim.

When everything else fails,
    read /usr/share/doc/Cygwin/exim-X-Y.README,
    or look up the documentation on
Many happy mailings :)