<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>MemberManual/Email/SMTPClients</title><revhistory><revision><revnumber>7</revnumber><date>2013-01-14 09:16:31</date><authorinitials>ClintonEbadi</authorinitials><revremark>cat / needs work</revremark></revision><revision><revnumber>6</revnumber><date>2008-07-07 04:27:49</date><authorinitials>localhost</authorinitials><revremark>converted to 1.6 markup</revremark></revision><revision><revnumber>5</revnumber><date>2008-04-30 14:59:53</date><authorinitials>AdamChlipala</authorinitials><revremark>deleuze -&gt; mail</revremark></revision><revision><revnumber>4</revnumber><date>2007-11-29 14:47:52</date><authorinitials>hectobyte.rcac.purdue.edu</authorinitials><revremark>Draw attention to particular lines in Exim conf --mwolson</revremark></revision><revision><revnumber>3</revnumber><date>2007-11-21 02:06:26</date><authorinitials>MichaelOlson</authorinitials><revremark>Add Exim config</revremark></revision><revision><revnumber>2</revnumber><date>2007-11-21 01:57:31</date><authorinitials>MichaelOlson</authorinitials><revremark>Turn sect numbers off</revremark></revision><revision><revnumber>1</revnumber><date>2007-11-21 01:57:00</date><authorinitials>MichaelOlson</authorinitials><revremark>Initial contents</revremark></revision></revhistory></articleinfo><para>This page contains some examples of how to set up various email clients and mail servers to send mail through the HCoop SMTP server. </para><section><title>Emacs</title><para>This particular section explains only how to send email using HCoop's mail server with Emacs.  Browsing email with most Emacs mail packages is not covered here, and should be less difficult.  Please read the <emphasis>Sending email</emphasis> section of the <ulink url="https://wiki.hcoop.net/MemberManual/Email/SMTPClients/MemberManual/Email#">MemberManual/Email</ulink> page before doing what is described here. </para><para>To send mail through HCoop using Emacs's <code>smtpmail</code> you can use the following configuration. </para><screen><![CDATA[(require 'smtpmail)
(setq message-send-mail-function 'smtpmail-send-it
      smtpmail-smtp-server "mail.hcoop.net"
      smtpmail-smtp-service 25
      smtpmail-starttls-credentials '(("mail.hcoop.net" 25 nil nil))
      smtpmail-debug-info t ; optional, but handy in case something goes wrong
      smtpmail-auth-supported '(plain))]]></screen><para>Put your authentication information into <code>~/.authinfo</code> which is in the netrc(5) format (make sure to supply port 25 or else <code>smtpmail</code> won't read the entry), and ensure that it is readable only by your user.  An example of a netrc line follows.  Replace <emphasis role="strong">$YOURNAME</emphasis> with your HCoop login name, <emphasis role="strong">$YOURPASSWORD</emphasis> with your password. </para><screen><![CDATA[machine mail.hcoop.net login $YOURNAME password $YOURPASSWORD port 25]]></screen><para>If you are using a vmail account, then use the form &quot;<code>yourname@domain.tld</code>&quot; for <emphasis role="strong">$YOURNAME</emphasis> in the above. </para><para>This will work for any mail client that uses <code>message-mode</code> for editing and sending mail (e.g. Gnus). </para></section><section><title>Exim smarthost</title><para>This section explains how to set up a local Exim daemon on your computer to use our mail server as a smarthost. </para><para>First, run <code>dpkg-reconfigure exim4</code> and choose to use <code>mail.hcoop.net</code>.  In case you missed anything, here is a known working <code>/etc/exim4/update-exim4.conf.conf</code> file.  <emphasis role="strong">$HOSTNAME</emphasis> is the hostname of your local machine. </para><screen><![CDATA[dc_eximconfig_configtype='satellite'
dc_other_hostnames='$HOSTNAME'
dc_local_interfaces='127.0.0.1'
dc_readhost='$HOSTNAME'
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='mail.hcoop.net'
CFILEMODE='644'
dc_use_split_config='true'
dc_hide_mailname='true'
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool']]></screen><para>Then, modify the <code>/etc/exim4/passwd.client</code> file to add a mapping for your HCoop username and password. </para><screen><![CDATA[mail.hcoop.net:$USERNAME:$PASSWORD]]></screen><para>Finally, modify <code>/etc/exim4/conf.d/transport/30_exim4-config_remote_smtp_smarthost</code> as follows.  The <emphasis role="strong">hosts_require_auth</emphasis> and <emphasis role="strong">tls_tempfail_tryclear</emphasis> lines are the most important. </para><screen><![CDATA[remote_smtp_smarthost:
  debug_print = "T: remote_smtp_smarthost for $local_part@$domain"
  driver = smtp
  # NOTE: Force the connection to be authenticated.
  hosts_require_auth = <; ${if exists{CONFDIR/passwd.client} \
        {\
        ${lookup{$host}nwildlsearch{CONFDIR/passwd.client}{$host_address}}\
        }\
        {} \
      }
.ifdef REMOTE_SMTP_SMARTHOST_HOSTS_AVOID_TLS
  hosts_avoid_tls = REMOTE_SMTP_SMARTHOST_HOSTS_AVOID_TLS
.endif
.ifdef REMOTE_SMTP_HEADERS_REWRITE
  headers_rewrite = REMOTE_SMTP_HEADERS_REWRITE
.endif
.ifdef REMOTE_SMTP_RETURN_PATH
  return_path = REMOTE_SMTP_RETURN_PATH
.endif
  # NOTE: Force the connection to use TLS.
  tls_tempfail_tryclear = false]]></screen><!--rule (<hr>) is not applicable to DocBook--><para> <ulink url="https://wiki.hcoop.net/MemberManual/Email/SMTPClients/CategoryMemberManual#">CategoryMemberManual</ulink> <ulink url="https://wiki.hcoop.net/MemberManual/Email/SMTPClients/CategoryNeedsWork#">CategoryNeedsWork</ulink> </para></section></article>