Gnus development mailing list
 help / color / mirror / Atom feed
* Asynchronous Gnus?
@ 2005-06-03 13:30 David Abrahams
  2005-06-03 20:37 ` Gnus with Exim (was: Asynchronous Gnus?) David Abrahams
  0 siblings, 1 reply; 31+ messages in thread
From: David Abrahams @ 2005-06-03 13:30 UTC (permalink / raw)



Hi,

I have an immediate problem and a broader question.  The immediate
problem is that the SMTP server I'm forced (by my ISP) to talk to is
fairly unresponsive.  When sending mail with message-mail, it often
seems to stop cold before anything happens.  Often the best way to get
mail to go out is to try sending a few times and cancelling with `C-g'
until it wakes up.  For any dedicated mail program, this is no problem
as it does all its SMTP transactions in the background.  Is there some
way to get Gnus to act the same way?

The broader question is about why all of Gnus can't be more
asynchronous.  Most of the problems I have with Gnus are UI
responsiveness issues that could be solved that way.  I've been told
that it's because Emacs doesn't have any notion of threads or
concurrency, but I guess I don't understand why that's a huge
obstacle.  For one thing I note that we have gnus-demon-add-handler so
there is a way to get it to do work "between keystrokes," as it were.
Probably more importantly, there are all kinds of things Emacs does
concurrently with processes that don't cause the whole program to lock
up, e.g. pcl-cvs.

Thanks for your time,
Dave

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Gnus with Exim (was: Asynchronous Gnus?)
  2005-06-03 13:30 Asynchronous Gnus? David Abrahams
@ 2005-06-03 20:37 ` David Abrahams
  2005-06-03 22:28   ` Gnus with Exim Steven E. Harris
  0 siblings, 1 reply; 31+ messages in thread
From: David Abrahams @ 2005-06-03 20:37 UTC (permalink / raw)


David Abrahams <dave@boost-consulting.com> writes:

> Hi,
>
> I have an immediate problem and a broader question.  The immediate
> problem is that the SMTP server I'm forced (by my ISP) to talk to is
> fairly unresponsive.  When sending mail with message-mail, it often
> seems to stop cold before anything happens.  Often the best way to get
> mail to go out is to try sending a few times and cancelling with `C-g'
> until it wakes up.  For any dedicated mail program, this is no problem
> as it does all its SMTP transactions in the background.  Is there some
> way to get Gnus to act the same way?

It seemed to me that one possibility might be to run a local MTA (I'm
sorta half-guessing at that, so I might be way off base), so I
installed Cygwin's Exim on my machine.  However, I'm not sure how to
get Gnus to use it or how to set it up to send mail asynchronously, so
any hints would be much appreciated.

> The broader question is about why all of Gnus can't be more
> asynchronous.  Most of the problems I have with Gnus are UI
> responsiveness issues that could be solved that way.  I've been told
> that it's because Emacs doesn't have any notion of threads or
> concurrency, but I guess I don't understand why that's a huge
> obstacle.  For one thing I note that we have gnus-demon-add-handler so
> there is a way to get it to do work "between keystrokes," as it were.
> Probably more importantly, there are all kinds of things Emacs does
> concurrently with processes that don't cause the whole program to lock
> up, e.g. pcl-cvs.

Thanks again,

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-03 20:37 ` Gnus with Exim (was: Asynchronous Gnus?) David Abrahams
@ 2005-06-03 22:28   ` Steven E. Harris
  2005-06-04 13:47     ` David Abrahams
  0 siblings, 1 reply; 31+ messages in thread
From: Steven E. Harris @ 2005-06-03 22:28 UTC (permalink / raw)
  Cc: ding

David Abrahams <dave@boost-consulting.com> writes:

> I installed Cygwin's Exim on my machine.  However, I'm not sure how
> to get Gnus to use it or how to set it up to send mail
> asynchronously, so any hints would be much appreciated.

I can help you with this.

Do you send all your outgoing messages through a "smart host" --
meaning your ISP's SMTP server -- or can you send mail by connecting
directly to your recipient's SMTP server? The former is a more typical
configuration for dial-up and most broadband accounts.

Somewhere in your Gnus configuration, you should set the variable
`sendmail-program' to "exim", because even though exim can impersonate
sendmail, no such symlink is set up in Cygwin by default. (Debian
Linux does provide such a symlink, so calling "sendmail" works just
fine, with exim acting in its place.)

Have you changed the variable `message-send-mail-function' from its
default? To send mail through your local MTA you'll want the value to
be message-send-mail-with-sendmail.

Much of the difficulty I've had with exim on Cygwin relates to getting
the permission on /etc/exim.conf straight. At least as several months
ago, the file /etc/exim.conf must be owned by the SYSTEM account and
not be writable by anyone else. That makes trial-and-error editing of
the file a little frustrating. My bash history would accumulate
alternating entries like:

  $ F=/etc/exim.conf; chown seh.Users $F && chmod u+w $F
  # Edit...
  $ F=/etc/exim.conf; chown SYSTEM.Administrators $F && chmod a-w $F
  # Try it again...


If you don't need to exchange mail locally on your computer among
different users, the setup is really quite simple.

Have you tried running "exim-config"? You can read the script at
/usr/bin/exim-config. I just noticed that it will offer to set up the
sendmail symlink I mentioned above. It doesn't appear to set up the
routers and transports that you'll need to tweak for your particular
situation.

Let me know what you need help on next.

-- 
Steven E. Harris



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-03 22:28   ` Gnus with Exim Steven E. Harris
@ 2005-06-04 13:47     ` David Abrahams
  2005-06-04 15:29       ` Steven E. Harris
  0 siblings, 1 reply; 31+ messages in thread
From: David Abrahams @ 2005-06-04 13:47 UTC (permalink / raw)


"Steven E. Harris" <seh@panix.com> writes:

> David Abrahams <dave@boost-consulting.com> writes:
>
>> I installed Cygwin's Exim on my machine.  However, I'm not sure how
>> to get Gnus to use it or how to set it up to send mail
>> asynchronously, so any hints would be much appreciated.
>
> I can help you with this.

Thanks!

> Do you send all your outgoing messages through a "smart host" --
> meaning your ISP's SMTP server -- or can you send mail by connecting
> directly to your recipient's SMTP server? The former is a more typical
> configuration for dial-up and most broadband accounts.

The former is all my ISP will allow me :(
The host is not very smart, though.  That's why I need Exim.

> Somewhere in your Gnus configuration, you should set the variable
> `sendmail-program' to "exim", because even though exim can impersonate
> sendmail, no such symlink is set up in Cygwin by default. (Debian
> Linux does provide such a symlink, so calling "sendmail" works just
> fine, with exim acting in its place.)

Did that.  In fact, it's "/bin/exim-4.50-1.exe" because I'm running an
NTEmacs, so it can't (directly) launch programs through Cygwin
symlinks.

> Have you changed the variable `message-send-mail-function' from its
> default? To send mail through your local MTA you'll want the value to
> be message-send-mail-with-sendmail.

Did that too.

> Much of the difficulty I've had with exim on Cygwin relates to getting
> the permission on /etc/exim.conf straight. At least as several months
> ago, the file /etc/exim.conf must be owned by the SYSTEM account and
> not be writable by anyone else. That makes trial-and-error editing of
> the file a little frustrating. My bash history would accumulate
> alternating entries like:
>
>   $ F=/etc/exim.conf; chown seh.Users $F && chmod u+w $F
>   # Edit...
>   $ F=/etc/exim.conf; chown SYSTEM.Administrators $F && chmod a-w $F
>   # Try it again...

I'm not seeing that.

> If you don't need to exchange mail locally on your computer among
> different users, the setup is really quite simple.
>
> Have you tried running "exim-config"? 

Yep.  Had to; I had no /etc/exim.config until I did.


> You can read the script at
> /usr/bin/exim-config. I just noticed that it will offer to set up the
> sendmail symlink I mentioned above. 


Yeah, I told it to go ahead and do that.  But there are other settings
I don't know what to do with.  For example, there was something about
the value of CYGWIN and a value of "ntsec"?

> It doesn't appear to set up the routers and transports that you'll
> need to tweak for your particular situation.
>
> Let me know what you need help on next.

Maybe the routers and transports?

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-04 13:47     ` David Abrahams
@ 2005-06-04 15:29       ` Steven E. Harris
  2005-06-06  2:05         ` David Abrahams
  0 siblings, 1 reply; 31+ messages in thread
From: Steven E. Harris @ 2005-06-04 15:29 UTC (permalink / raw)
  Cc: ding

[-- Attachment #1: Type: text/plain, Size: 4263 bytes --]

David Abrahams <dave@boost-consulting.com> writes:

> The former is all my ISP will allow me :(

Plenty of ISPs block all traffic on port 25, except to the designated
ISP SMTP server.

[...]

> I'm not seeing that.

Take a look at /var/log/exim/exim_{main,panic,reject}.log and make
sure that it's not complaining about permissions on exim.conf. If it's
not complaining, then don't worry about it.

> For example, there was something about the value of CYGWIN and a
> value of "ntsec"?

Yes, I do have an environment variable "CYGWIN", set up in Windows so
it's there before any Cygwin programs run, with a current value of
"ntsec tty".

You can read all about the ntsec[1] in the Cygwin documentation. It
makes my head swim. I just know that running Cygwin in this mode
improves its integration with the Windows security system, and that
some programs like exim behave more to expectations when run with
ntsec enabled.

> Maybe the routers and transports?

I'm attaching a copy of my current exim.conf that I've modified for
what I expect you'll need. Note the comments marked "[dave]".

I'll run through some of them here, in order.

o primary_hostname
  I set this one up through Windows[2], so I prefer to have exim just
  pick up the same one that Windows uses.

o smart_route router
  This is the "smarthost" hook that takes all non-local mail and sends
  it out ever the "remote_smtp" transport.

  Note that the route_list must mention your ISP's SMTP server, which
  I looked up and found to be smtp.rcn.com. This server is mentioned
  several times later, so replace all occurrences if my guess in
  incorrect.

o userforward router
  I added a few settings here to enable exim's mail filtering
  facility[3] and maildir delivery.

o procmail router
  This router enables local delivery through procmail if a
  ~/.procmailrc file exists. If you don't have procmail installed, you
  can comment out this router. The note about local_part pertains to
  limiting the files that follow to the user specified in the local
  part of the destination address.[4] It didn't work on Cygwin as of
  the last time I fiddled with it, but ${home} does get set correctly,
  so the router works more or less as intended.

o remote_smtp transport
  This is an important setting. Here we specify (optionally) that all
  communication with your ISP's mail server should use TLS. The
  headers_rewrite and return_path options allow you to define mappings
  between local user names and externally-visible email addresses in
  the file /etc/email-addresses. That file may already be there. If
  it's not, you can create it with content like:

,----
| dave: dave@boost-consulting.com
`----

  Any outgoing messages that originate from user "dave" on your
  computer will appear to outsiders to have originated from
  dave@boost-consulting.com. You can also just set these addresses in
  your mail client, but this rewriting is useful if you also support
  local exchange of messages. It separates local identity from
  external identity.

o procmail_pipe transport
  Per the note, if you don't have procmail installed, you can just
  comment out this transport.

o address_directory transport
  Here we enable maildir for local delivery. That may be irrelevant
  for your needs.

o fixed_login and fixed_plain authenticators
  These two settings supply your credentials for TLS, and do require
  you to put your plain text password in exim.conf. If your ISP
  doesn't offer TLS, you can leave these out.


There are obviously some extraneous settings here, but I figured I'd
include them in case you later decide to get more ambitious with exim
(filtering, local user messages).

Try dropping this file into place, adjusting the smtp.rcn.com host and
your ISP user name and password, possibly adding entries to
/etc/email-addresses, and try sending some messages. Keep an eye on
/var/log/exim/exim_main.log and try "exim -bp" after sending to see if
the messages are stuck.

Let us know how you fare.


Footnotes: 
[1] http://cygwin.com/cygwin-ug-net/ntsec.html
[2] My Computer->Properties->Computer Name->
    More...->Primary DNS suffix...
[3] http://www.exim.org/exim-html-4.50/doc/html/filter_toc.html
[4] http://www.exim.org/exim-html-4.50/doc/html/spec_15.html#IX1642


[-- Attachment #2: exim.conf --]
[-- Type: text/plain, Size: 28897 bytes --]

######################################################################
#                  Runtime configuration file for Exim               #
######################################################################


# This is a default configuration file which will operate correctly in
# uncomplicated installations. Please see the manual for a complete list
# of all the runtime configuration options that can be included in a
# configuration file. There are many more than are mentioned here. The
# manual is in the file doc/spec.txt in the Exim distribution as a plain
# ASCII file. Other formats (PostScript, Texinfo, HTML, PDF) are available
# from the Exim ftp sites. The manual is also online at the Exim web sites.


# This file is divided into several parts, all but the first of which are
# headed by a line starting with the word "begin". Only those parts that
# are required need to be present. Blank lines, and lines starting with #
# are ignored.


########### IMPORTANT ########## IMPORTANT ########### IMPORTANT ###########
#                                                                          #
# Whenever you change Exim's configuration file, you *must* remember to    #
# HUP the Exim daemon, because it will not pick up the new configuration   #
# until you do. However, any other Exim processes that are started, for    #
# example, a process started by an MUA in order to send a message, will    #
# see the new configuration as soon as it is in place.                     #
#                                                                          #
# You do not need to HUP the daemon for changes in auxiliary files that    #
# are referenced from this file. They are read every time they are used.   #
#                                                                          #
# It is usually a good idea to test a new configuration for syntactic      #
# correctness before installing it (for example, by running the command    #
# "exim -C /config/file.new -bV").                                         #
#                                                                          #
########### IMPORTANT ########## IMPORTANT ########### IMPORTANT ###########



######################################################################
#                    MAIN CONFIGURATION SETTINGS                     #
######################################################################

# Specify your host's canonical name here. This should normally be the fully
# qualified "official" name of your host. If this option is not set, the
# uname() function is called to obtain the name. In many cases this does
# the right thing and you need not set anything explicitly.

# [dave] We can set this hostname through Windows instead, or
#        uncomment this line to force its value here.
#primary_hostname = i9300.luannboostocracy.com


# The next three settings create two lists of domains and one list of hosts.
# These lists are referred to later in this configuration using the syntax
# +local_domains, +relay_to_domains, and +relay_from_hosts, respectively. They
# are all colon-separated lists:

domainlist local_domains = @
domainlist relay_to_domains =
hostlist   relay_from_hosts = 127.0.0.1

# Most straightforward access control requirements can be obtained by
# appropriate settings of the above options. In more complicated situations, you
# may need to modify the Access Control List (ACL) which appears later in this
# file.

# The first setting specifies your local domains, for example:
#
#   domainlist local_domains = my.first.domain : my.second.domain
#
# You can use "@" to mean "the name of the local host", as in the default
# setting above. This is the name that is specified by primary_hostname,
# as specified above (or defaulted). If you do not want to do any local
# deliveries, remove the "@" from the setting above. If you want to accept mail
# addressed to your host's literal IP address, for example, mail addressed to
# "user@[192.168.23.44]", you can add "@[]" as an item in the local domains
# list. You also need to uncomment "allow_domain_literals" below. This is not
# recommended for today's Internet.

# The second setting specifies domains for which your host is an incoming relay.
# If you are not doing any relaying, you should leave the list empty. However,
# if your host is an MX backup or gateway of some kind for some domains, you
# must set relay_to_domains to match those domains. For example:
#
# domainlist relay_to_domains = *.myco.com : my.friend.org
#
# This will allow any host to relay through your host to those domains.
# See the section of the manual entitled "Control of relaying" for more
# information.

# The third setting specifies hosts that can use your host as an outgoing relay
# to any other host on the Internet. Such a setting commonly refers to a
# complete local network as well as the localhost. For example:
#
# hostlist relay_from_hosts = 127.0.0.1 : 192.168.0.0/16
#
# The "/16" is a bit mask (CIDR notation), not a number of hosts. Note that you
# have to include 127.0.0.1 if you want to allow processes on your host to send
# SMTP mail by using the loopback address. A number of MUAs use this method of
# sending mail.


# All three of these lists may contain many different kinds of item, including
# wildcarded names, regular expressions, and file lookups. See the reference
# manual for details. The lists above are used in the access control list for
# incoming messages. The name of this ACL is defined here:

acl_smtp_rcpt = acl_check_rcpt

# You should not change that setting until you understand how ACLs work.


# Specify the domain you want to be added to all unqualified addresses
# here. An unqualified address is one that does not contain an "@" character
# followed by a domain. For example, "caesar@rome.example" is a fully qualified
# address, but the string "caesar" (i.e. just a login name) is an unqualified
# email address. Unqualified addresses are accepted only from local callers by
# default. See the recipient_unqualified_hosts option if you want to permit
# unqualified addresses from remote sources. If this option is not set, the
# primary_hostname value is used for qualification.

# qualify_domain =


# If you want unqualified recipient addresses to be qualified with a different
# domain to unqualified sender addresses, specify the recipient domain here.
# If this option is not set, the qualify_domain value is used.

# qualify_recipient =

# When reading a user name from the gecos field in the passwd file, remove 
# the Cygwin specific information.

gecos_pattern = (.*?)(,U-|,S-|$)
gecos_name = $1 

# The following line must be uncommented if you want Exim to recognize
# addresses of the form "user@[10.11.12.13]" that is, with a "domain literal"
# (an IP address) instead of a named domain. The RFCs still require this form,
# but it makes little sense to permit mail to be sent to specific hosts by
# their IP address in the modern Internet. This ancient format has been used
# by those seeking to abuse hosts by using them for unwanted relaying. If you
# really do want to support domain literals, uncomment the following line, and
# see also the "domain_literal" router below.

# allow_domain_literals


# No deliveries will ever be run under the uids of these users (a colon-
# separated list). An attempt to do so causes a panic error to be logged, and
# the delivery to be deferred. This is a paranoic safety catch. There is an
# even stronger safety catch in the form of the FIXED_NEVER_USERS setting
# in the configuration for building Exim. The list of users that it specifies
# is built into the binary, and cannot be changed. The option below just adds
# additional users to the list. The default for FIXED_NEVER_USERS is "root",
# but just to be absolutely sure, the default here is also "root".

# Note that the default setting means you cannot deliver mail addressed to root
# as if it were a normal user. This isn't usually a problem, as most sites have
# an alias for root that redirects such mail to a human administrator.
# The default is disabled in Cygwin, not all installations have root.
  
# never_users = root


# The setting below causes Exim to do a reverse DNS lookup on all incoming
# IP calls, in order to get the true host name. If you feel this is too
# expensive, you can specify the networks for which a lookup is done, or
# remove the setting entirely.
# In Cygwin the localhost is not looked up (matching relay_from_hosts)

host_lookup = !127.0.0.1/8:*


# The settings below, which are actually the same as the defaults in the
# code, cause Exim to make RFC 1413 (ident) callbacks for all incoming SMTP
# calls. You can limit the hosts to which these calls are made, and/or change
# the timeout that is used. If you set the timeout to zero, all RFC 1413 calls
# are disabled. RFC 1413 calls are cheap and can provide useful information
# for tracing problem messages, but some hosts and firewalls have problems
# with them. This can result in a timeout instead of an immediate refused
# connection, leading to delays on starting up an SMTP session.

rfc1413_hosts = !127.0.0.1/8:*
rfc1413_query_timeout = 30s


# By default, Exim expects all envelope addresses to be fully qualified, that
# is, they must contain both a local part and a domain. If you want to accept
# unqualified addresses (just a local part) from certain hosts, you can specify
# these hosts by setting one or both of
#
# sender_unqualified_hosts =
# recipient_unqualified_hosts =
#
# to control sender and recipient addresses, respectively. When this is done,
# unqualified addresses are qualified using the settings of qualify_domain
# and/or qualify_recipient (see above).


# If you want Exim to support the "percent hack" for certain domains,
# uncomment the following line and provide a list of domains. The "percent
# hack" is the feature by which mail addressed to x%y@z (where z is one of
# the domains listed) is locally rerouted to x@y and sent on. If z is not one
# of the "percent hack" domains, x%y is treated as an ordinary local part. This
# hack is rarely needed nowadays; you should not enable it unless you are sure
# that you really need it.
#
# percent_hack_domains =
#
# As well as setting this option you will also need to remove the test
# for local parts containing % in the ACL definition below.


# When Exim can neither deliver a message nor return it to sender, it "freezes"
# the delivery error message (aka "bounce message"). There are also other
# circumstances in which messages get frozen. They will stay on the queue for
# ever unless one of the following options is set.

# This option unfreezes frozen bounce messages after two days, tries
# once more to deliver them, and ignores any delivery failures.

ignore_bounce_errors_after = 2d

# This option cancels (removes) frozen messages that are older than a week.

timeout_frozen_after = 7d



######################################################################
#                       ACL CONFIGURATION                            #
#         Specifies access control lists for incoming SMTP mail      #
######################################################################

begin acl

# This access control list is used for every RCPT command in an incoming
# SMTP message. The tests are run in order until the address is either
# accepted or denied.

acl_check_rcpt:

  # Accept if the source is local SMTP (i.e. not over TCP/IP). We do this by
  # testing for an empty sending host field.

  accept  hosts = :

  #############################################################################
  # The following section of the ACL is concerned with local parts that contain
  # @ or % or ! or / or | or dots in unusual places.
  #
  # The characters other than dots are rarely found in genuine local parts, but
  # are often tried by people looking to circumvent relaying restrictions.
  # Therefore, although they are valid in local parts, these rules lock them
  # out, as a precaution.
  #
  # Empty components (two dots in a row) are not valid in RFC 2822, but Exim
  # allows them because they have been encountered. (Consider local parts
  # constructed as "firstinitial.secondinitial.familyname" when applied to
  # someone like me, who has no second initial.) However, a local part starting
  # with a dot or containing /../ can cause trouble if it is used as part of a
  # file name (e.g. for a mailing list). This is also true for local parts that
  # contain slashes. A pipe symbol can also be troublesome if the local part is
  # incorporated unthinkingly into a shell command line.
  #
  # Two different rules are used. The first one is stricter, and is applied to
  # messages that are addressed to one of the local domains handled by this
  # host. It blocks local parts that begin with a dot or contain @ % ! / or |.
  # If you have local accounts that include these characters, you will have to
  # modify this rule.

  deny    message       = Restricted characters in address
          domains       = +local_domains
          local_parts   = ^[.] : ^.*[@%!/|]

  # The second rule applies to all other domains, and is less strict. This
  # allows your own users to send outgoing messages to sites that use slashes
  # and vertical bars in their local parts. It blocks local parts that begin
  # with a dot, slash, or vertical bar, but allows these characters within the
  # local part. However, the sequence /../ is barred. The use of @ % and ! is
  # blocked, as before. The motivation here is to prevent your users (or
  # your users' viruses) from mounting certain kinds of attack on remote sites.

  deny    message       = Restricted characters in address
          domains       = !+local_domains
          local_parts   = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
  #############################################################################

  # Accept mail to postmaster in any local domain, regardless of the source,
  # and without verifying the sender.

  accept  local_parts   = postmaster
          domains       = +local_domains

  # Deny unless the sender address can be verified.

  require verify        = sender

  #############################################################################
  # There are no checks on DNS "black" lists because the domains that contain
  # these lists are changing all the time. However, here are two examples of
  # how you could get Exim to perform a DNS black list lookup at this point.
  # The first one denies, while the second just warns.
  #
  # deny    message       = rejected because $sender_host_address is in a black list at $dnslist_domain\n$dnslist_text
  #         dnslists      = black.list.example
  #
  # warn    message       = X-Warning: $sender_host_address is in a black list at $dnslist_domain
  #         log_message   = found in $dnslist_domain
  #         dnslists      = black.list.example
  #############################################################################

  # Accept if the address is in a local domain, but only if the recipient can
  # be verified. Otherwise deny. The "endpass" line is the border between
  # passing on to the next ACL statement (if tests above it fail) or denying
  # access (if tests below it fail).

  accept  domains       = +local_domains
          endpass
          verify        = recipient

  # Accept if the address is in a domain for which we are relaying, but again,
  # only if the recipient can be verified.

  accept  domains       = +relay_to_domains
          endpass
          verify        = recipient

  # If control reaches this point, the domain is neither in +local_domains
  # nor in +relay_to_domains.

  # Accept if the message comes from one of the hosts for which we are an
  # outgoing relay. Recipient verification is omitted here, because in many
  # cases the clients are dumb MUAs that don't cope well with SMTP error
  # responses. If you are actually relaying out from MTAs, you should probably
  # add recipient verification here.

  accept  hosts         = +relay_from_hosts

  # Accept if the message arrived over an authenticated connection, from
  # any host. Again, these messages are usually from MUAs, so recipient
  # verification is omitted.

  accept  authenticated = *

  # Reaching the end of the ACL causes a "deny", but we might as well give
  # an explicit message.

  deny    message       = relay not permitted



######################################################################
#                      ROUTERS CONFIGURATION                         #
#               Specifies how addresses are handled                  #
######################################################################
#     THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT!       #
# An address is passed to each router in turn until it is accepted.  #
######################################################################

begin routers

# [dave]
# If outbound SMTP wasn't blocked, we could put this router after the
# dnslookup router below, using it only for addresses that fail DNS
# lookups and would hence require routing assistance.
#
# Since SMTP is blocked, there's no reason to bother giving exim a
# chance to send messages directly to other hosts on its own.
smart_route:
  driver = manualroute
  domains = ! +local_domains
  transport = remote_smtp
  route_list = * smtp.rcn.com

# This router routes to remote hosts over SMTP by explicit IP address,
# when an email address is given in "domain literal" form, for example,
# <user@[192.168.35.64]>. The RFCs require this facility. However, it is
# little-known these days, and has been exploited by evil people seeking
# to abuse SMTP relays. Consequently it is commented out in the default
# configuration. If you uncomment this router, you also need to uncomment
# allow_domain_literals above, so that Exim can recognize the syntax of
# domain literal addresses.

# domain_literal:
#   driver = ipliteral
#   domains = ! +local_domains
#   transport = remote_smtp


# This router routes addresses that are not in local domains by doing a DNS
# lookup on the domain name. Any domain that resolves to 0.0.0.0 or to a
# loopback interface address (127.0.0.0/8) is treated as if it had no DNS
# entry. Note that 0.0.0.0 is the same as 0.0.0.0/32, which is commonly treated
# as the local host inside the network stack. It is not 0.0.0.0/0, the default
# route. If the DNS lookup fails, no further routers are tried because of
# the no_more setting, and consequently the address is unrouteable.

dnslookup:
  driver = dnslookup
  domains = ! +local_domains
  transport = remote_smtp
  ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
# If the first host starts with '+', fallback on DEFER or FAIL.
# If the first host starts with '=', fallback on FAIL only.
# If neither, fallback on DEFER only.
# The first cases are Cygwin extensions for users with dynamic ip addresses.
  fallback_hosts = + : smtp.rcn.com
  no_more


# The remaining routers handle addresses in the local domain(s).


# This router handles aliasing using a linearly searched alias file with the
# name /etc/aliases. When this configuration is installed automatically,
# the name gets inserted into this file from whatever is set in Exim's
# build-time configuration. The default path is the traditional /etc/aliases.
# If you install this configuration by hand, you need to specify the correct
# path in the "data" setting below.
#
##### NB  You must ensure that the alias file exists. It used to be the case
##### NB  that every Unix had that file, because it was the Sendmail default.
##### NB  These days, there are systems that don't have it. Your aliases
##### NB  file should at least contain an alias for "postmaster".
#
# If any of your aliases expand to pipes or files, you will need to set
# up a user and a group for these deliveries to run under. You can do
# this by uncommenting the "user" option below (changing the user name
# as appropriate) and adding a "group" option if necessary. Alternatively, you
# can specify "user" on the transports that are used. Note that the transports
# listed below are the same as are used for .forward files; you might want
# to set up different ones for pipe and file deliveries from aliases.

system_aliases:
  driver = redirect
  allow_fail
  allow_defer
  data = ${lookup{$local_part}lsearch{/etc/aliases}}
# user = exim
  file_transport = address_file
  pipe_transport = address_pipe


# This router handles forwarding using traditional .forward files in users'
# home directories. If you want it also to allow mail filtering when a forward
# file starts with the string "# Exim filter" or "# Sieve filter", uncomment
# the "allow_filter" option.

# If you want this router to treat local parts with suffixes introduced by "-"
# or "+" characters as if the suffixes did not exist, uncomment the two local_
# part_suffix options. Then, for example, xxxx-foo@your.domain will be treated
# in the same way as xxxx@your.domain by this router. You probably want to make
# the same change to the localuser router.

# The no_verify setting means that this router is skipped when Exim is
# verifying addresses. Similarly, no_expn means that this router is skipped if
# Exim is processing an EXPN command.

# The check_ancestor option means that if the forward file generates an
# address that is an ancestor of the current one, the current one gets
# passed on instead. This covers the case where A is aliased to B and B
# has a .forward file pointing to A.

# The three transports specified at the end are those that are used when
# forwarding generates a direct delivery to a file, or to a pipe, or sets
# up an auto-reply, respectively.

userforward:
  driver = redirect
  check_local_user
# local_part_suffix = +* : -*
# local_part_suffix_optional
  file = $home/.forward
  no_verify
  no_expn
  check_ancestor
  # [dave]
  allow_filter
  file_transport = address_file
  # [dave]
  directory_transport = address_directory
  pipe_transport = address_pipe
  reply_transport = address_reply


# [dave]
procmail:
  driver = accept
  check_local_user
  # Putting ${local_part} at the beginnig of this list does
  # not work properly in Cygwin (with ntsec).
  require_files = +${home}/.procmailrc:+/usr/bin/procmail
  transport = procmail_pipe


# This router matches local user mailboxes. If the router fails, the error
# message is "Unknown user".

# If you want this router to treat local parts with suffixes introduced by "-"
# or "+" characters as if the suffixes did not exist, uncomment the two local_
# part_suffix options. Then, for example, xxxx-foo@your.domain will be treated
# in the same way as xxxx@your.domain by this router.

localuser:
  driver = accept
  check_local_user
# local_part_suffix = +* : -*
# local_part_suffix_optional
  transport = local_delivery
  cannot_route_message = Unknown user



######################################################################
#                      TRANSPORTS CONFIGURATION                      #
######################################################################
#                       ORDER DOES NOT MATTER                        #
#     Only one appropriate transport is called for each delivery.    #
######################################################################

# A transport is used only when referenced from a router that successfully
# handles an address.

begin transports


# This transport is used for delivering messages over SMTP connections.

remote_smtp:
  driver = smtp
# [dave] The following two lines force TLS; comment them out if your
#        ISP's mail server does not offer TLS.
  hosts_try_auth = smtp.rcn.com
  hosts_require_tls = smtp.rcn.com
# [dave] The following two lines enable rewriting local addresses in
#        outbound messages via /etc/email-addresses, per Debian's example.
  headers_rewrite = *@$primary_hostname ${lookup{$local_part}lsearch{/etc/email-addresses}{$value}fail}
  return_path = ${if match{$return_path}{^([^@]+)@${rxquote:$primary_hostname}\$}\
                {${lookup{$1}lsearch{/etc/email-addresses}{$value}fail}}fail}


# This transport is used for local delivery to user mailboxes in traditional
# BSD mailbox format. By default it will be run under the uid and gid of the
# local user, and requires the sticky bit to be set on the /var/mail directory.
# On Windows this can be done setting permissions RWE, but NOT DELETE, 
# for Everyone, on /var/spool/mail. 
# Some systems use the alternative approach of running mail deliveries under a
# particular group instead of using the sticky bit. The commented options below
# show how this can be done.
# The default on Cygwin is to allow maximum access and not check owner & group
# Turning initgroups on is very inefficient. It should only be done if 
# supplementary groups are needed during deliveries, e.g. to run filters. 
local_delivery:
  driver = appendfile
  file = /var/spool/mail/$local_part
  delivery_date_add
  envelope_to_add
  return_path_add
# group = mail
  initgroups = no
  mode = 0666
  mode_fail_narrower = no
  check_group = no
  check_owner = no


# [dave] If you don't have procmail installed, you can comment out
#        this whole transport.
procmail_pipe:
  driver = pipe
  command = /usr/bin/procmail -d $local_part
  return_path_add
  delivery_date_add
  envelope_to_add
  check_string = "From "
  escape_string = ">From "
  user = $local_part
# group = mail


# This transport is used for handling pipe deliveries generated by alias or
# .forward files. If the pipe generates any standard output, it is returned
# to the sender of the message as a delivery error. Set return_fail_output
# instead of return_output if you want this to happen only when the pipe fails
# to complete normally. You can set different transports for aliases and
# forwards if you want to - see the references to address_pipe in the routers
# section above.

address_pipe:
  driver = pipe
  return_output


# This transport is used for handling deliveries directly to files that are
# generated by aliasing or forwarding.

address_file:
  driver = appendfile
  delivery_date_add
  envelope_to_add
  return_path_add


# [dave] This adds maildir support for local delivery. If you don't
#        intend to support local delivery, you can comment out this transport.
address_directory:
  driver = appendfile
  delivery_date_add
  envelope_to_add
  return_path_add
  maildir_format


# This transport is used for handling autoreplies generated by the filtering
# option of the userforward router.

address_reply:
  driver = autoreply



######################################################################
#                      RETRY CONFIGURATION                           #
######################################################################

begin retry

# This single retry rule applies to all domains and all errors. It specifies
# retries every 15 minutes for 2 hours, then increasing retry intervals,
# starting at 1 hour and increasing each time by a factor of 1.5, up to 16
# hours, then retries every 6 hours until 4 days have passed since the first
# failed delivery.

# Address or Domain    Error       Retries
# -----------------    -----       -------

*                      *           F,2h,15m; G,16h,1h,1.5; F,4d,6h



######################################################################
#                      REWRITE CONFIGURATION                         #
######################################################################

# There are no rewriting specifications in this default configuration file.

begin rewrite



######################################################################
#                   AUTHENTICATION CONFIGURATION                     #
######################################################################

# There are no authenticator specifications in this default configuration file.

begin authenticators

# [dave] If you want to use SMTP over TLS, provide your ISP account
#        username and password here. Just be sure to protect access
#        to this exim.conf file.
fixed_login:
  driver = plaintext
  public_name = LOGIN
  client_send = : dave : daves_pwd


fixed_plain:
  driver = plaintext
  public_name = PLAIN
  client_send = ^dave^daves_pwd



######################################################################
#                   CONFIGURATION FOR local_scan()                   #
######################################################################

# If you have built Exim to include a local_scan() function that contains
# tables for private options, you can define those options here. Remember to
# uncomment the "begin" line. It is commented by default because it provokes
# an error with Exim binaries that are not built with LOCAL_SCAN_HAS_OPTIONS
# set in the Local/Makefile.

# begin local_scan


# End of Exim configuration file

[-- Attachment #3: Type: text/plain, Size: 22 bytes --]


-- 
Steven E. Harris

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-04 15:29       ` Steven E. Harris
@ 2005-06-06  2:05         ` David Abrahams
  2005-06-06 17:04           ` Steven E. Harris
  0 siblings, 1 reply; 31+ messages in thread
From: David Abrahams @ 2005-06-06  2:05 UTC (permalink / raw)


"Steven E. Harris" <seh@panix.com> writes:

> David Abrahams <dave@boost-consulting.com> writes:
>
>> The former is all my ISP will allow me :(
>
> Plenty of ISPs block all traffic on port 25, except to the designated
> ISP SMTP server.
>
> [...]
>
>> I'm not seeing that.
>
> Take a look at /var/log/exim/exim_{main,panic,reject}.log and make
> sure that it's not complaining about permissions on exim.conf. If it's
> not complaining, then don't worry about it.

It's not.

>> For example, there was something about the value of CYGWIN and a
>> value of "ntsec"?
>
> Yes, I do have an environment variable "CYGWIN", set up in Windows so
> it's there before any Cygwin programs run, with a current value of
> "ntsec tty".

Done.  Although exim-config sets it to 

  ntsec notraverse

for the exim daemon by default.  That seems to work.

> You can read all about the ntsec[1] in the Cygwin documentation. It
> makes my head swim. I just know that running Cygwin in this mode
> improves its integration with the Windows security system, and that
> some programs like exim behave more to expectations when run with
> ntsec enabled.

Thanks.

>> Maybe the routers and transports?
>
> I'm attaching a copy of my current exim.conf that I've modified for
> what I expect you'll need. Note the comments marked "[dave]".
>
> I'll run through some of them here, in order.
>
> o primary_hostname
>   I set this one up through Windows[2], so I prefer to have exim just
>   pick up the same one that Windows uses.

Done that way, thanks.

> o smart_route router
>   This is the "smarthost" hook that takes all non-local mail and sends
>   it out ever the "remote_smtp" transport.

I think this was the key thing I was missing.  Interestingly, it's
completely missing from the deafult exim.conf that you get with Cygwin
and from what exim-config sets up.

>   Note that the route_list must mention your ISP's SMTP server, which
>   I looked up and found to be smtp.rcn.com. This server is mentioned
>   several times later, so replace all occurrences if my guess in
>   incorrect.

Perfect guess, thanks.

> o userforward router
>   I added a few settings here to enable exim's mail filtering
>   facility[3] and maildir delivery.

I don't see how either of these can help me.  I'm basically only using
Exim to send mail, and to send it outside my LAN.

> o procmail router
>   This router enables local delivery through procmail if a
>   ~/.procmailrc file exists. If you don't have procmail installed, you
>   can comment out this router. The note about local_part pertains to
>   limiting the files that follow to the user specified in the local
>   part of the destination address.[4] It didn't work on Cygwin as of
>   the last time I fiddled with it, but ${home} does get set correctly,
>   so the router works more or less as intended.

I use procmail as part of the spam filtering setup on my IMAP server,
so I'm familiar with it, but again I don't see how it can be much use
to me on my personal (client) machine.

> o remote_smtp transport
>   This is an important setting. Here we specify (optionally) that all
>   communication with your ISP's mail server should use TLS. 

2005-06-05 21:45:33 IHN3JX-0003DC-0F a TLS session is required for smtp.mail.rcn.net [207.172.4.99], but the server did not offer TLS support
2005-06-05 21:45:33 IHN3JX-0003DC-0F == dave@boost-consulting.com R=smart_route T=remote_smtp defer (-38): a TLS session is required for smtp.mail.rcn.net [207.172.4.99], but the server did not offer TLS support

'fraid not.

>   The
>   headers_rewrite and return_path options allow you to define mappings
>   between local user names and externally-visible email addresses in
>   the file /etc/email-addresses. That file may already be there. If
>   it's not, you can create it with content like:
>
> ,----
> | dave: dave@boost-consulting.com
> `----
>
>   Any outgoing messages that originate from user "dave" on your
>   computer will appear to outsiders to have originated from
>   dave@boost-consulting.com. You can also just set these addresses in
>   your mail client, but this rewriting is useful if you also support
>   local exchange of messages. It separates local identity from
>   external identity.

If you mean "local exchange" on this one computer, then no, it's not
important to me.

> There are obviously some extraneous settings here, but I figured I'd
> include them in case you later decide to get more ambitious with exim
> (filtering, local user messages).
>
> Try dropping this file into place, adjusting the smtp.rcn.com host and
> your ISP user name and password, possibly adding entries to
> /etc/email-addresses, and try sending some messages. Keep an eye on
> /var/log/exim/exim_main.log and try "exim -bp" after sending to see if
> the messages are stuck.
>
> Let us know how you fare.

It's working!  This is fantastic, thank you!


A few more questions

1. I allowed exim-config to start it as a service:

      Do you want to install the exim daemon as a service? (yes/no) yes
      Enter the period of the queue runner, in minutes: [15] 1
      Enter the value of CYGWIN for the daemon: [ntsec notraverse]

      Do you want to start the exim daemon as a service now? (yes/no) yes
      OK. The mail daemon is now accepting mail.

   I figured that's what I needed to do in order to get the
   asynchronous sending behavior I'm after (remember that my SMTP
   server is not responsive enough for me).  Is that right, or is
   there a way to do this that only causes exim to run
   (asynchronously) when it's time to actually send something?

2. Of course, my ISP not only insists that I use their SMTP server
   when I'm at home, but their server refuses to respond when I'm
   away.  So I have to use smtp.boost-consulting.com.  I don't want to
   edit my exim-config and restart the daemon in those cases if
   possible.  Any ideas?

3. My IMAP server is not super fast either.  It's running Exim too,
   coincidentally.  Ideally I'd like to set up a mirror of my IMAP
   server on a local Linux machine so I can search messages more
   quickly and have redundant message storage.  Do you happen to know
   of a means to that end?  I imagine this isn't something people want
   to do every day.

Thanks again for all your help.
-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-06  2:05         ` David Abrahams
@ 2005-06-06 17:04           ` Steven E. Harris
  2005-06-06 18:31             ` David Abrahams
  0 siblings, 1 reply; 31+ messages in thread
From: Steven E. Harris @ 2005-06-06 17:04 UTC (permalink / raw)
  Cc: ding

David Abrahams <dave@boost-consulting.com> writes:

> It's working!  This is fantastic, thank you!

Great news.

> A few more questions
>
> 1. I allowed exim-config to start it as a service:

[...]

>    I figured that's what I needed to do in order to get the
>    asynchronous sending behavior I'm after (remember that my SMTP
>    server is not responsive enough for me).  Is that right, or is
>    there a way to do this that only causes exim to run
>    (asynchronously) when it's time to actually send something?

I assume you mean that no service runs until it's time to send a
message? Exim will work fine that way, but the problem comes right
back around to your raison d'etre for setting up exim in the first
place: When a sending attempt fails, the message will be queued, but
there will be no automatic retrying and dispatching of that
queue.

That is, you are free to call on exim at any time to send an outbound
message, but if that first attempt fails you may be on your own for
triggering exim to try again later. Some experimentation may reveal
that the /next/ time exim tries to send another message, it will also
process any other pending messages in the queue. I'm not sure about
that.

One thing that does seem helpful, observable through casual
experimentation, is that even when exim is invoked to accept an
outbound message with no daemon running, it accepts and sends the
message with two different processes, so the calling program doesn't
block through the sending attempt.

> 2. Of course, my ISP not only insists that I use their SMTP server
>    when I'm at home, but their server refuses to respond when I'm
>    away.  So I have to use smtp.boost-consulting.com.  I don't want to
>    edit my exim-config and restart the daemon in those cases if
>    possible.  Any ideas?

I used to have this problem, and my solution was barely mentionable: I
had a script that flipped the permissions on exim.conf, swapped a
symlink to one of three nearly-identical configuration files, and
restored the permissions. I could have ran sed or similar over the
file to swap the server names, but I didn't like seeing the
modification times change on the file(s).

Debian has a system wherein the actual exim.conf file is generated
from a separate set of settings and small template files. With that
arrangement, it would be possible to change the server setting and
regenerate the file. Again, though, that's a hack.

Exim does have all sorts of read-and-search-this-file-or-database
capabilities. Debian uses it for the /etc/email-addresses lookup, and
also to plug in the user name and password for SMTP AUTH/TLS, instead
of the in-line specification I showed you. Perhaps we could figure out
how to get exim to read the smart host server from a separate file,
and you could just change that separate file when your computer
roams. If you're interested in pursuing this idea, I can help with the
research.

When I mentioned that I "used to" have this problem, I only "solved"
it by discovering that my ISP (Panix) runs its SMTP server on several
alternate ports. That allows me to use the Panix server at home with
my cable modem despite SMTP being blocked, and to use it when out in a
cafe or library because again the alternate SMTP port isn't usually
blocked.

> 3. My IMAP server is not super fast either.  It's running Exim too,
>    coincidentally.  Ideally I'd like to set up a mirror of my IMAP
>    server on a local Linux machine so I can search messages more
>    quickly and have redundant message storage.  Do you happen to know
>    of a means to that end?  I imagine this isn't something people want
>    to do every day.

I have never attempted this, but I'd imagine it would involve having
something like fetchmail poll your ISP's mail server, download local
copies of the messages to the IMAP server, while leaving the messages
on the ISP's server. However, that would not handle the problem of
synchronizing message deletion, copies, moves, and flag
alteration. Suddenly the problem gets much harder.

> Thanks again for all your help.

No problem. I've been a casual exim tinkerer for a while now, and
always enjoy the chance (or the excuse) to learn a little more about
it.

-- 
Steven E. Harris



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-06 17:04           ` Steven E. Harris
@ 2005-06-06 18:31             ` David Abrahams
  2005-06-06 19:59               ` Steven E. Harris
  0 siblings, 1 reply; 31+ messages in thread
From: David Abrahams @ 2005-06-06 18:31 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 5398 bytes --]

"Steven E. Harris" <seh@panix.com> writes:

> David Abrahams <dave@boost-consulting.com> writes:
>
>> It's working!  This is fantastic, thank you!
>
> Great news.
>
>> A few more questions
>>
>> 1. I allowed exim-config to start it as a service:
>
> [...]
>
>>    I figured that's what I needed to do in order to get the
>>    asynchronous sending behavior I'm after (remember that my SMTP
>>    server is not responsive enough for me).  Is that right, or is
>>    there a way to do this that only causes exim to run
>>    (asynchronously) when it's time to actually send something?
>
> I assume you mean that no service runs until it's time to send a
> message? Exim will work fine that way, but the problem comes right
> back around to your raison d'etre for setting up exim in the first
> place: When a sending attempt fails, the message will be queued, but
> there will be no automatic retrying and dispatching of that
> queue.
>
> That is, you are free to call on exim at any time to send an outbound
> message, but if that first attempt fails you may be on your own for
> triggering exim to try again later. Some experimentation may reveal
> that the /next/ time exim tries to send another message, it will also
> process any other pending messages in the queue. I'm not sure about
> that.

Hmm.  

> One thing that does seem helpful, observable through casual
> experimentation, is that even when exim is invoked to accept an
> outbound message with no daemon running, it accepts and sends the
> message with two different processes, so the calling program doesn't
> block through the sending attempt.

Well, actually that's probably enough.  I don't normally have errors;
it just seems like my emacs session sometimes locks up for up to a
minute when trying to send mail.

The only thing that worries me is what happens in the rare case where
sending *does* actually fail.

>> 2. Of course, my ISP not only insists that I use their SMTP server
>>    when I'm at home, but their server refuses to respond when I'm
>>    away.  So I have to use smtp.boost-consulting.com.  I don't want to
>>    edit my exim-config and restart the daemon in those cases if
>>    possible.  Any ideas?
>
> I used to have this problem, and my solution was barely mentionable: I
> had a script that flipped the permissions on exim.conf, swapped a
> symlink to one of three nearly-identical configuration files, and
> restored the permissions. I could have ran sed or similar over the
> file to swap the server names, but I didn't like seeing the
> modification times change on the file(s).

Actually, I think there's a better answer.  See the enclosed message.
I just need to figure out how to apply what he says there.  You might
want to modify your use of &/+ accordingly.

> Debian has a system wherein the actual exim.conf file is generated
> from a separate set of settings and small template files. With that
> arrangement, it would be possible to change the server setting and
> regenerate the file. Again, though, that's a hack.

It's called exim-config on cygwin ;-)

> Exim does have all sorts of read-and-search-this-file-or-database
> capabilities. Debian uses it for the /etc/email-addresses lookup, and
> also to plug in the user name and password for SMTP AUTH/TLS, instead
> of the in-line specification I showed you. Perhaps we could figure out
> how to get exim to read the smart host server from a separate file,
> and you could just change that separate file when your computer
> roams. If you're interested in pursuing this idea, I can help with the
> research.

The ideal thing would be to get the fallback stuff working.
Unfortunately I have to take my computer down the block to test it ;-)

> When I mentioned that I "used to" have this problem, I only "solved"
> it by discovering that my ISP (Panix) runs its SMTP server on several
> alternate ports. That allows me to use the Panix server at home with
> my cable modem despite SMTP being blocked, and to use it when out in a
> cafe or library because again the alternate SMTP port isn't usually
> blocked.

Oh, well *that* might be a better option.  I could get the guy who
administers smtp.boost-consulting.com to open a different port for
outgoing SMTP so I can send email that way.  Then I wouldn't need exim
at all, would I?  In fact, I could probably test this by going through
smtp.panix.com if you tell me what port you're using.

>> 3. My IMAP server is not super fast either.  It's running Exim too,
>>    coincidentally.  Ideally I'd like to set up a mirror of my IMAP
>>    server on a local Linux machine so I can search messages more
>>    quickly and have redundant message storage.  Do you happen to know
>>    of a means to that end?  I imagine this isn't something people want
>>    to do every day.
>
> I have never attempted this, but I'd imagine it would involve having
> something like fetchmail poll your ISP's mail server, download local
> copies of the messages to the IMAP server, while leaving the messages
> on the ISP's server. However, that would not handle the problem of
> synchronizing message deletion, copies, moves, and flag
> alteration. Suddenly the problem gets much harder.

Yep.

>> Thanks again for all your help.
>
> No problem. I've been a casual exim tinkerer for a while now, and
> always enjoy the chance (or the excuse) to learn a little more about
> it.

Maybe the enclosed will help.


[-- Attachment #2: Type: message/rfc822, Size: 2678 bytes --]

From: "Pierre A. Humblet" <Pierre.Humblet@ieee.org>
To: "David Abrahams" <dave@boost-consulting.com>
Subject: Re: Can't get Exim to send mail
Date: Mon, 06 Jun 2005 11:58:57 -0400
Message-ID: <099901c56ab0$a610e2c0$3e0010ac@wirelessworld.airvananet.com>


----- Original Message ----- 
From: "David Abrahams" <dave@boost-consulting.com>
To: "Pierre A. Humblet" <Pierre.Humblet@ieee.org>
Sent: Monday, June 06, 2005 11:48 AM
Subject: Re: Can't get Exim to send mail


> "Pierre A. Humblet" <Pierre.Humblet@ieee.org> writes:
>
> > It's possible to have several fallbacks, trying them sequentially.
> > I have never tried that together with the special Cygwin patch to allow
> > fallback on failure (native exim only fallbacks on defer).
> > People have suggested making the fallback_host dependent on where
> > you are, but doing that reliably is a non-trivial change.
> > What does your ISP do when you try to connect directly to the
> > destination?
>
> I suppose you mean, e.g. this:
>
> bash-2.05b$ telnet smtp.boost-consulting.com 25
> Connecting To smtp.boost-consulting.com...
> <long delay here>
> Connecting To smtp.boost-consulting.com...Could not open connection to the
host, on port 25: Connect
>  failed
> bash-2.05b$
>
> > Does it intercept the call and return an error (failure outcome), or
> > does it let you hang until you time-out (defer outcome)?
>
> I think this is defer outcome, yes?

Yes.

> Can I set up exim to fallback on defer?  This is what I have now:
>
> dnslookup:
>   driver = dnslookup
>   domains = ! +local_domains
>   transport = remote_smtp
>   ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
> # If the first host starts with '&', fallback on DEFER or FAIL.
> # If the first host starts with '=', fallback on FAIL only.
> # If neither, fallback on DEFER only.
> # The first cases are Cygwin extensions for users with dynamic ip
addresses.
>   fallback_hosts = + : smtp.rcn.com
>   no_more

According to your telnet experiment, you want to fallback on DEFER,
but just in case things change, you might as well defer on FAIL.
So I would use a "&".
I don't think a + is appropriate there. Native exim interprets it literally,
trying to fallback to host "+". But with the Cygwin patch, it's interpreted
(or was interpreted) as a "&" (for historical reasons).
It's always interesting to do a
exim -d xxxx@smtp.boost-consulting.com as explained in an earlier
e-mail, to really see what's going on.
Let me know how it goes.

Pierre



[-- Attachment #3: Type: text/plain, Size: 62 bytes --]



-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-06 18:31             ` David Abrahams
@ 2005-06-06 19:59               ` Steven E. Harris
  2005-06-06 20:43                 ` David Abrahams
  0 siblings, 1 reply; 31+ messages in thread
From: Steven E. Harris @ 2005-06-06 19:59 UTC (permalink / raw)
  Cc: ding

David Abrahams <dave@boost-consulting.com> writes:

> Well, actually that's probably enough.  I don't normally have errors;
> it just seems like my emacs session sometimes locks up for up to a
> minute when trying to send mail.

That was my original motivation for setting up exim too. But after
running exim for several years, I have seen sending errors arise where
the queuing and retrying capability turns out to be very convenient. I
run my exim daemon with a queue run interval of 10 minutes. Given that
my queue is usually empty, the daemon does virtually no work. On the
other hand, on the odd chance that a message can't be sent out right
away, I don't have to worry much about attending to it later.

> The only thing that worries me is what happens in the rare case where
> sending *does* actually fail.

Exim will send a message back to the sender (you) when it's ready to
give up on delivery, or if delivery is taking a very long time. To
discuss failure behavior, though, we need to distinguish between
transient failures and permanent failures.

> Actually, I think there's a better answer.  See the enclosed message.
> I just need to figure out how to apply what he says there.  You might
> want to modify your use of &/+ accordingly.

I don't think the intentions are the same. While it is nice that the
fallback_hosts option can accept multiple hosts, you have to go
through the sure-to-fail direct DNS lookup first, wait for that to
fail, and only then start trying the list of obliging servers.

> It's called exim-config on cygwin ;-)

No, the exim4-config package on Debian goes way, way beyond the
exim-config in Cygwin. For my setup at home in Debian, the only
hand-tweaking I had to do was to get my ISP's unusual SMTP server port
specified; at present, despite a few bug reports to the contrary, the
server port is not considered to be an important configurable setting.

> The ideal thing would be to get the fallback stuff working.
> Unfortunately I have to take my computer down the block to test it ;-)

I have the fallback stuff set up on my computer at work ("=" for
"fallback on FAIL only"), but the fallback scenario never gets
triggered. The work setup is different than the one I shared with
you. I can make direct connections to /almost/ any SMTP server out
there, but, paradoxically, I can't send mail to my coworkers by coming
back in to our own SMTP server as pointed to in the public MX
records. So, for internal mail, I use a corporate server as a "smart
host", but for external mail I use the dnslookup driver to connect
directly, and fallback on FAIL to our internal "smart host".

> Oh, well *that* might be a better option.  I could get the guy who
> administers smtp.boost-consulting.com to open a different port for
> outgoing SMTP so I can send email that way.

That will work in environments that block port 25, and that do /not/
block all ports besides, say, HTTP and HTTPS. Panix runs on port
2525¹. I have yet to find that port blocked anywhere I use my computer.

> Then I wouldn't need exim at all, would I?

I would still recommend running it. It solves problems that your MUA
alone doesn't solve. You started out this inquiry looking for
asynchronous sending behavior from Gnus, and getting that extra SMTP
port opened won't grant you that behavior. It will make configuring
exim to fit your roaming scenario easier.

> In fact, I could probably test this by going through smtp.panix.com
> if you tell me what port you're using.

It's mail.panix.com on port 2525, but you'll need to authenticate if
you're not coming in through a Panix connection.

[...]

> Maybe the enclosed will help.

Oh, I see they changed the "+ for DEFER or FAIL" to "&".

[...]

>> bash-2.05b$ telnet smtp.boost-consulting.com 25
>> Connecting To smtp.boost-consulting.com...
>> <long delay here>
>> Connecting To smtp.boost-consulting.com...Could not open connection to the
> host, on port 25: Connect
>>  failed
>> bash-2.05b$
>>
>> > Does it intercept the call and return an error (failure outcome), or
>> > does it let you hang until you time-out (defer outcome)?
>>
>> I think this is defer outcome, yes?
>
> Yes.
>
>> Can I set up exim to fallback on defer?  This is what I have now:

It looks to me as though your ISP is blocking port 25 traffic, so it
doesn't make sense to even try using the dnslookup router when you're
stuck behind this connection. The "smart host" one is a short-circuit
pessimistic version of your dnslookup+fallback: Don't even bother
trying to connect directly, and just send it out through smtp.rcn.com.


Footnotes: 
¹ http://www.panix.com/panix/help/mail.smtp-outside.html

-- 
Steven E. Harris



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-06 19:59               ` Steven E. Harris
@ 2005-06-06 20:43                 ` David Abrahams
  2005-06-06 22:44                   ` Steven E. Harris
  0 siblings, 1 reply; 31+ messages in thread
From: David Abrahams @ 2005-06-06 20:43 UTC (permalink / raw)


"Steven E. Harris" <seh@panix.com> writes:

> David Abrahams <dave@boost-consulting.com> writes:
>
>> Well, actually that's probably enough.  I don't normally have errors;
>> it just seems like my emacs session sometimes locks up for up to a
>> minute when trying to send mail.
>
> That was my original motivation for setting up exim too. But after
> running exim for several years, I have seen sending errors arise where
> the queuing and retrying capability turns out to be very convenient. I
> run my exim daemon with a queue run interval of 10 minutes. Given that
> my queue is usually empty, the daemon does virtually no work. On the
> other hand, on the odd chance that a message can't be sent out right
> away, I don't have to worry much about attending to it later.

That's probably a good idea for me, too.

>> The only thing that worries me is what happens in the rare case where
>> sending *does* actually fail.
>
> Exim will send a message back to the sender (you) when it's ready to
> give up on delivery, or if delivery is taking a very long time. To
> discuss failure behavior, though, we need to distinguish between
> transient failures and permanent failures.
>
>> Actually, I think there's a better answer.  See the enclosed message.
>> I just need to figure out how to apply what he says there.  You might
>> want to modify your use of &/+ accordingly.
>
> I don't think the intentions are the same. While it is nice that the
> fallback_hosts option can accept multiple hosts, you have to go
> through the sure-to-fail direct DNS lookup first, wait for that to
> fail, and only then start trying the list of obliging servers.

I don't care *too* much how long long it takes as long as it's going
on in the background.

>> It's called exim-config on cygwin ;-)
>
> No, the exim4-config package on Debian goes way, way beyond the
> exim-config in Cygwin. For my setup at home in Debian, the only
> hand-tweaking I had to do was to get my ISP's unusual SMTP server port
> specified; at present, despite a few bug reports to the contrary, the
> server port is not considered to be an important configurable setting.

OK.

>> The ideal thing would be to get the fallback stuff working.
>> Unfortunately I have to take my computer down the block to test it ;-)
>
> I have the fallback stuff set up on my computer at work ("=" for
> "fallback on FAIL only"), but the fallback scenario never gets
> triggered. The work setup is different than the one I shared with
> you. I can make direct connections to /almost/ any SMTP server out
> there, but, paradoxically, I can't send mail to my coworkers by coming
> back in to our own SMTP server as pointed to in the public MX
> records. So, for internal mail, I use a corporate server as a "smart
> host", but for external mail I use the dnslookup driver to connect
> directly, and fallback on FAIL to our internal "smart host".
>
>> Oh, well *that* might be a better option.  I could get the guy who
>> administers smtp.boost-consulting.com to open a different port for
>> outgoing SMTP so I can send email that way.
>
> That will work in environments that block port 25, and that do /not/
> block all ports besides, say, HTTP and HTTPS. Panix runs on port
> 2525¹. I have yet to find that port blocked anywhere I use my computer.

Cool, telnet works from here.  I'll try sending you this message on
that port.

220 mailspool3.panix.com ESMTP Postfix
EHLO I9300.boost-consulting.com
250-mailspool3.panix.com
250-PIPELINING
250-SIZE 27525120
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250 8BITMIME
MAIL FROM:<dave@boost-consulting.com> SIZE=5781
250 Ok
RCPT TO:<dave@boost-consulting.com>
554 <dave@boost-consulting.com>: Recipient address rejected: Access denied
QUIT
221 Bye

Heh, that was my Bcc: to myself.  I guess it won't let me send to
anyone outside Panix unless I can login there?

>> Then I wouldn't need exim at all, would I?
>
> I would still recommend running it. It solves problems that your MUA
> alone doesn't solve. You started out this inquiry looking for
> asynchronous sending behavior from Gnus, and getting that extra SMTP
> port opened won't grant you that behavior. 

Yeah, but if it's responsive enough, I don't care much.  What am I
missing?

> It will make configuring exim to fit your roaming scenario easier.

>> In fact, I could probably test this by going through smtp.panix.com
>> if you tell me what port you're using.
>
> It's mail.panix.com on port 2525, but you'll need to authenticate if
> you're not coming in through a Panix connection.

Hum, you mean I'd need a Panix username and password?

> [...]
>
>> Maybe the enclosed will help.
>
> Oh, I see they changed the "+ for DEFER or FAIL" to "&".

Yah.

> It looks to me as though your ISP is blocking port 25 traffic, 

Unless it goes to their server, yes.

> so it doesn't make sense to even try using the dnslookup router when
> you're stuck behind this connection.

I'm not always stuck there.  When I roam, won't I want that in effect?

> The "smart host" one is a short-circuit pessimistic version of your
> dnslookup+fallback: Don't even bother trying to connect directly,
> and just send it out through smtp.rcn.com.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-06 20:43                 ` David Abrahams
@ 2005-06-06 22:44                   ` Steven E. Harris
  2005-06-06 23:08                     ` David Abrahams
  0 siblings, 1 reply; 31+ messages in thread
From: Steven E. Harris @ 2005-06-06 22:44 UTC (permalink / raw)
  Cc: ding

David Abrahams <dave@boost-consulting.com> writes:

> I don't care *too* much how long long it takes as long as it's going
> on in the background.

I thought you might care because you seemed picky about running exim
as a daemon, suggesting that you're suspicious of any spurious wasting
of resources. I just wanted to make sure you understood the difference
between the smarthost and dnslookup routers.

> Cool, telnet works from here.  I'll try sending you this message on
> that port.

[...]

> Heh, that was my Bcc: to myself.  I guess it won't let me send to
> anyone outside Panix unless I can login there?

I think it was just being lazy in reporting that authentication is
required for any transaction. As far as I know, you need to login with
a valid Panix account in order to be able to send a message to anyone.

> Yeah, but if it's responsive enough, I don't care much.

Wait, now I'm confused. Are you suggesting that sending messages out
from your MUA directly to some server of your choice /is/ responsive
enough? I thought we started out with you saying that this direct
sending often caused your MUA to hang, and that's where the idea came
up of sticking an asynchronous sending, possibly queuing MTA in
between.

> What am I missing?

If you take exim out of the picture, your MUA must talk directly to
the remote SMTP server, which may cause annoying delays.

> Hum, you mean I'd need a Panix username and password?

Yes.

> I'm not always stuck there. When I roam, won't I want that in
> effect?

That depends on whether the connections you roam to allow SMTP
traffic. Most cafes I've been to block port 25, assuming for some
reason that the whole world is satisfied with Web mail. If the normal
SMTP port is blocked, the dnslookup router will always try and fail,
and only then get around to your fallback alternates.

-- 
Steven E. Harris



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-06 22:44                   ` Steven E. Harris
@ 2005-06-06 23:08                     ` David Abrahams
  2005-06-06 23:47                       ` Steven E. Harris
  0 siblings, 1 reply; 31+ messages in thread
From: David Abrahams @ 2005-06-06 23:08 UTC (permalink / raw)


"Steven E. Harris" <seh@panix.com> writes:

> David Abrahams <dave@boost-consulting.com> writes:
>
>> I don't care *too* much how long long it takes as long as it's going
>> on in the background.
>
> I thought you might care because you seemed picky about running exim
> as a daemon, suggesting that you're suspicious of any spurious wasting
> of resources. 

Well, I am a little.  When I said I don't care how long it takes I
meant I don't care how long I have to wait, not that I don't care how
many CPU cycles get burned.

> I just wanted to make sure you understood the difference
> between the smarthost and dnslookup routers.

I guess I'm confused.

>> Cool, telnet works from here.  I'll try sending you this message on
>> that port.
>
> [...]
>
>> Heh, that was my Bcc: to myself.  I guess it won't let me send to
>> anyone outside Panix unless I can login there?
>
> I think it was just being lazy in reporting that authentication is
> required for any transaction. As far as I know, you need to login with
> a valid Panix account in order to be able to send a message to anyone.

Oh, well.

>> Yeah, but if it's responsive enough, I don't care much.
>
> Wait, now I'm confused. Are you suggesting that sending messages out
> from your MUA

Sorry, I should be clear that I'm an ignoramus.  What's an MUA?  Mail
User Agent?  A email client program?

> directly to some server of your choice /is/ responsive
> enough? 

Yes, it's only smtp.rcn.com, AFAIK, that's unresponsive.  Except that
port 25 is blocked to anywhere but smtp.rcn.com

> I thought we started out with you saying that this direct
> sending often caused your MUA to hang, 

If by "direct sending" you mean sending directly to the recipients
smtp server, I'm not allowed by my ISP to do that unless the recipient
happens to have an rcn.com email address.  In other words, I can only
send to smtp.rcn.com on port 25.

> and that's where the idea came up of sticking an asynchronous
> sending, possibly queuing MTA in between.
>
>> What am I missing?
>
> If you take exim out of the picture, your MUA must talk directly to
> the remote SMTP server, which may cause annoying delays.

I've only.

>> Hum, you mean I'd need a Panix username and password?
>
> Yes.
>
>> I'm not always stuck there. When I roam, won't I want that in
>> effect?
>
> That depends on whether the connections you roam to allow SMTP
> traffic. Most cafes I've been to block port 25, 

Not mine.  In Massachusetts most Cafes don't even make you pay for
connectivity.  Some barista just brings in a linksys box, hooks it to
the cable, and everyone connects.

> assuming for some reason that the whole world is satisfied with Web
> mail. If the normal SMTP port is blocked, the dnslookup router will
> always try and fail, and only then get around to your fallback
> alternates.

Sounds like a reasonable approach to me, unless it soaks a lot of
cycles to try DNSLookup.  The queue should be empty most of the time,
so it's probably okay.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-06 23:08                     ` David Abrahams
@ 2005-06-06 23:47                       ` Steven E. Harris
  2005-06-07  1:36                         ` David Abrahams
  0 siblings, 1 reply; 31+ messages in thread
From: Steven E. Harris @ 2005-06-06 23:47 UTC (permalink / raw)
  Cc: ding

David Abrahams <dave@boost-consulting.com> writes:

> I guess I'm confused.

I think we fell out of step in our dialogue, so I'll just await any
other specific questions you pose.

> Sorry, I should be clear that I'm an ignoramus.

That's what I know of you from Boost circles.

> What's an MUA?  Mail User Agent?  A email client program?

Yes, Mail User Agent. In this case, it's Gnus.

> Yes, it's only smtp.rcn.com, AFAIK, that's unresponsive.  Except
> that port 25 is blocked to anywhere but smtp.rcn.com

Good summary.

>> I thought we started out with you saying that this direct
>> sending often caused your MUA to hang, 
>
> If by "direct sending" you mean sending directly to the recipients
> smtp server, I'm not allowed by my ISP to do that unless the recipient
> happens to have an rcn.com email address.  In other words, I can only
> send to smtp.rcn.com on port 25.

In this case, by "direct sending" I meant having Gnus talk directly
with some remote SMTP server rather than only talking to your local
exim MTA. I missed your characterization that smtp.rcn.com is the only
SMTP server that you perceive to be slow. I thought you were annoyed
by the lag waiting on any remote SMTP server.

[...]

> Sounds like a reasonable approach to me, unless it soaks a lot of
> cycles to try DNSLookup.  The queue should be empty most of the time,
> so it's probably okay.

I doubt it's cycles so much as just waiting through some tolerant
timeout.

Another drawback I've found with using the dnslookup/non-smarthost
setup: Some ISPs such as AOL will not accept inbound messages if they
can't do a reverse-DNS lookup on your IP address. When I try to send a
message to a recipient at AOL, exim connects to AOL's SMTP server
which in turn examines my IP address. Since my company does not expose
names for all the internally-assigned IP addresses, the reverse-lookup
fails and AOL rejects the inbound message. I therefore have AOL and a
few others on an exclusion list that forgo the direct SMTP connection
in favor of a smart host.

Here's a sketch of that router. It says that any mail not destined for
a local user and to anyone at mycompany.com or aol.com should use the
smart host mail.mycompany.com. This router precedes the dnslookup
router we've been discussing.

,----
| non_local_corporate:
|   driver = manualroute
|   domains = !+local_domains : *mycompany.com : *aol.com
|   transport = remote_smtp
|   route_list = * mail.mycompany.com
`----

I include this just to point out that it's hard to make a firm choice
between smart host relaying and direct SMTP connections. Lots of
policies out of your control govern what you'll find to be possible.

-- 
Steven E. Harris



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-06 23:47                       ` Steven E. Harris
@ 2005-06-07  1:36                         ` David Abrahams
  2005-06-08 18:14                           ` Steven E. Harris
  0 siblings, 1 reply; 31+ messages in thread
From: David Abrahams @ 2005-06-07  1:36 UTC (permalink / raw)


"Steven E. Harris" <seh@panix.com> writes:

> David Abrahams <dave@boost-consulting.com> writes:
>
>> I guess I'm confused.
>
> I think we fell out of step in our dialogue, so I'll just await any
> other specific questions you pose.

Okay, I'm going to ask you "what should I do next to configure Exim so
that I can send mail from anywhere?"

>> Sorry, I should be clear that I'm an ignoramus.
>
> That's what I know of you from Boost circles.
>
>> What's an MUA?  Mail User Agent?  A email client program?
>
> Yes, Mail User Agent. In this case, it's Gnus.
>
>> Yes, it's only smtp.rcn.com, AFAIK, that's unresponsive.  Except
>> that port 25 is blocked to anywhere but smtp.rcn.com
>
> Good summary.
>>> I thought we started out with you saying that this direct
>>> sending often caused your MUA to hang, 
>>
>> If by "direct sending" you mean sending directly to the recipients
>> smtp server, I'm not allowed by my ISP to do that unless the recipient
>> happens to have an rcn.com email address.  In other words, I can only
>> send to smtp.rcn.com on port 25.
>
> In this case, by "direct sending" I meant having Gnus talk directly
> with some remote SMTP server rather than only talking to your local
> exim MTA. I missed your characterization that smtp.rcn.com is the only
> SMTP server that you perceive to be slow. I thought you were annoyed
> by the lag waiting on any remote SMTP server.

OK, truth be told some others are a little slow.  And if I have
something big to send it doesn't really matter how slow the server is
because Gnus or my internet connection will limit things.  So OK, I
want to run Exim.

> [...]
>
>> Sounds like a reasonable approach to me, unless it soaks a lot of
>> cycles to try DNSLookup.  The queue should be empty most of the time,
>> so it's probably okay.
>
> I doubt it's cycles so much as just waiting through some tolerant
> timeout.
>
> Another drawback I've found with using the dnslookup/non-smarthost
> setup: Some ISPs such as AOL will not accept inbound messages if they
> can't do a reverse-DNS lookup on your IP address. When I try to send a
> message to a recipient at AOL, exim connects to AOL's SMTP server
> which in turn examines my IP address. Since my company does not expose
> names for all the internally-assigned IP addresses, the reverse-lookup
> fails and AOL rejects the inbound message. I therefore have AOL and a
> few others on an exclusion list that forgo the direct SMTP connection
> in favor of a smart host.

Yes, I've run into that.  What's worse, my sysadmin at
boost-consulting.com has inserted an intentional response delay to
foil spammers (he says it's incredibly effective) and other sysadmins
are lowering their reverse-lookup timeout to foil spammers.

> Here's a sketch of that router. It says that any mail not destined for
> a local user and to anyone at mycompany.com or aol.com should use the
> smart host mail.mycompany.com. This router precedes the dnslookup
> router we've been discussing.
>
> ,----
> | non_local_corporate:
> |   driver = manualroute
> |   domains = !+local_domains : *mycompany.com : *aol.com
> |   transport = remote_smtp
> |   route_list = * mail.mycompany.com
> `----
>
> I include this just to point out that it's hard to make a firm choice
> between smart host relaying and direct SMTP connections. Lots of
> policies out of your control govern what you'll find to be possible.

Well, I guess I've also occasionally run into places where I can't
reach my favorite smtp servers, but I'd be satisfied with a
configuration that tried smtp.rcn.com and then fell back to
smtp.boost-consulting.com.  That scheme seems to work in 99% of all
locations.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-07  1:36                         ` David Abrahams
@ 2005-06-08 18:14                           ` Steven E. Harris
  2005-06-08 19:45                             ` David Abrahams
  0 siblings, 1 reply; 31+ messages in thread
From: Steven E. Harris @ 2005-06-08 18:14 UTC (permalink / raw)
  Cc: ding

David Abrahams <dave@boost-consulting.com> writes:

> Okay, I'm going to ask you "what should I do next to configure Exim
> so that I can send mail from anywhere?"

After thinking it over for a few days, I think I'd take advantage of
some of exim's new configuration file "preprocessor-like" features and
use a swappable smart host setup, skipping the dnslookup stuff.

You could define a router like the "smart_route" one defined in the
first exim.conf I shared, but rather than specifying smtp.rcn.com
directly, use file inclusion to pull in a one- or two-line snippet
from a separate file that defines your current SMTP server. It's only
a slightly less ugly version of the multiple exim.conf file scheme I
mentioned a few days ago, but I think it best captures your
requirements.

Rather than using this directly,

,----
| smart_route:
|   driver = manualroute
|   domains = ! +local_domains
|   transport = remote_smtp
|   route_list = * smtp.rcn.com
`----

you could use this¹:

,----
| smart_route:
|   driver = manualroute
|   domains = ! +local_domains
|   transport = remote_smtp
|   .include /etc/exim_smarthost_route_list
`----

The file /etc/exim_smarthost_route_list could be a symlink that
pointed to one of two files:

,----[ /etc/exim_rcn_route_list ]
| route_list = * smtp.rcn.com
`----

,----[ /etc/exim_bc_route_list ]
| route_list = * smtp.boost-consulting.com
`----

You'd have to flip that symlink each time you changed your computer's
physical location.

Alternately, why not try this first and see if it suits your
needs. Specify multiple servers in your smart host route list, and let
them be tried in order:

,----
| smart_route:
|   driver = manualroute
|   domains = ! +local_domains
|   transport = remote_smtp
|   route_list = * smtp.rcn.com:smtp.boost-consulting.com
`----

The only trouble there arises if one of those servers operates on a
non-standard port, or rather if they operate on different ports. The
SMTP port is specified as part of the remote_smtp transport.² That
means that if the two smart hosts operate on different ports, they
need different remote_smtp transport specifications:

,----
| smart_route:
|   driver = manualroute
|   domains = ! +local_domains
|   transport = remote_smtp
|   route_list = * smtp.rcn.com
|   host_find_failed = pass
|
| smart_route_fallback:
|   driver = manualroute
|   domains = ! +local_domains
|   transport = remote_smtp_special
|   route_list = * smtp.boost-consulting.com
`----

,----[ Transport to handle non-standard SMTP port ]
| remote_smtp_special:
|   driver = smtp
|   port = 2525
`----

I have not tested this configuration -- host_find_failed in particular
-- but it matches my reading of the manualroute router documentation.³


[...]

> I'd be satisfied with a configuration that tried smtp.rcn.com and
> then fell back to smtp.boost-consulting.com.  That scheme seems to
> work in 99% of all locations.

Please consider the proposals above and let me know what you think.


Footnotes: 
¹ http://www.exim.org/exim-html-4.50/doc/html/spec_6.html#SECT6.3
² http://www.exim.org/exim-html-4.50/doc/html/spec_30.html#IX2248
³ http://www.exim.org/exim-html-4.50/doc/html/spec_20.html#IX1733

-- 
Steven E. Harris



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-08 18:14                           ` Steven E. Harris
@ 2005-06-08 19:45                             ` David Abrahams
  2005-06-08 20:14                               ` Steven E. Harris
  0 siblings, 1 reply; 31+ messages in thread
From: David Abrahams @ 2005-06-08 19:45 UTC (permalink / raw)


"Steven E. Harris" <seh@panix.com> writes:

> David Abrahams <dave@boost-consulting.com> writes:
>
>> Okay, I'm going to ask you "what should I do next to configure Exim
>> so that I can send mail from anywhere?"
>
> After thinking it over for a few days, I think I'd take advantage of
> some of exim's new configuration file "preprocessor-like" features and
> use a swappable smart host setup, skipping the dnslookup stuff.

I'm just putting smart_route first at the moment.  I figure dnslookup
might work somewhere that my regular servers are unreachable.

> You could define a router like the "smart_route" one defined in the
> first exim.conf I shared, but rather than specifying smtp.rcn.com
> directly, use file inclusion to pull in a one- or two-line snippet
> from a separate file that defines your current SMTP server. It's only
> a slightly less ugly version of the multiple exim.conf file scheme I
> mentioned a few days ago, but I think it best captures your
> requirements.
>
> Rather than using this directly,
>
> ,----
> | smart_route:
> |   driver = manualroute
> |   domains = ! +local_domains
> |   transport = remote_smtp
> |   route_list = * smtp.rcn.com
> `----
>
> you could use this¹:
>
> ,----
> | smart_route:
> |   driver = manualroute
> |   domains = ! +local_domains
> |   transport = remote_smtp
> |   .include /etc/exim_smarthost_route_list
> `----
>
> The file /etc/exim_smarthost_route_list could be a symlink that
> pointed to one of two files:
>
> ,----[ /etc/exim_rcn_route_list ]
> | route_list = * smtp.rcn.com
> `----
>
> ,----[ /etc/exim_bc_route_list ]
> | route_list = * smtp.boost-consulting.com
> `----
>
> You'd have to flip that symlink each time you changed your computer's
> physical location.

Cool, I was thinking something like that might be possible

> Alternately, why not try this first and see if it suits your
> needs. Specify multiple servers in your smart host route list, and let
> them be tried in order:
>
> ,----
> | smart_route:
> |   driver = manualroute
> |   domains = ! +local_domains
> |   transport = remote_smtp
> |   route_list = * smtp.rcn.com:smtp.boost-consulting.com
> `----

Actually that's what I have running right now.  I was having bad smtp
response this morning so I decided to bite the bullet and set
everything up as best I could before hearing from you.

[BTW, how do you make those nice callouts?]

I was thinking that the ideal would be 

,----
| smart_route:
|   driver = manualroute
|   domains = ! +local_domains
|   transport = remote_smtp
|   .include /etc/exim_smarthost_route_list
`----

with

,----[ /etc/exim_smarthost_route_list ]
| route_list = * smtp.rcn.com:smtp.boost-consulting.com
`----

or

,----[ /etc/exim_smarthost_route_list ]
| route_list = * smtp.boost-consulting.com:smtp.rcn.com
`----

depending on which server had succeeded the last time.  But I don't
know how to do that.  Parsing the log file?  That's a frightening
thought.

> The only trouble there arises if one of those servers operates on a
> non-standard port, or rather if they operate on different ports. The
> SMTP port is specified as part of the remote_smtp transport.² 

Fortunately I don't have that problem.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-08 19:45                             ` David Abrahams
@ 2005-06-08 20:14                               ` Steven E. Harris
  2005-06-08 20:48                                 ` David Abrahams
  0 siblings, 1 reply; 31+ messages in thread
From: Steven E. Harris @ 2005-06-08 20:14 UTC (permalink / raw)
  Cc: ding

David Abrahams <dave@boost-consulting.com> writes:

> I'm just putting smart_route first at the moment.  I figure dnslookup
> might work somewhere that my regular servers are unreachable.

Sure, that's fine, so long as you don't mind "maintaining" the similar
settings in more than one router.

> Cool, I was thinking something like that might be possible

I'm pretty sure the Debian people pushed or at least suggested this
option to the exim maintainers; I had never noticed it until about a
month ago.

> Actually that's what I have running right now.  I was having bad
> smtp response this morning so I decided to bite the bullet and set
> everything up as best I could before hearing from you.

Is the two-host route list working properly?

> [BTW, how do you make those nice callouts?]

It's boxquote.el¹. I used the functions `boxquote-region' and
`boxquote-title' where appropriate.

> I was thinking that the ideal would be 
>
> ,----
> | smart_route:
> |   driver = manualroute
> |   domains = ! +local_domains
> |   transport = remote_smtp
> |   .include /etc/exim_smarthost_route_list
> `----
>
> with
>
> ,----[ /etc/exim_smarthost_route_list ]
> | route_list = * smtp.rcn.com:smtp.boost-consulting.com
> `----
>
> or
>
> ,----[ /etc/exim_smarthost_route_list ]
> | route_list = * smtp.boost-consulting.com:smtp.rcn.com
> `----
>
> depending on which server had succeeded the last time.  But I don't
> know how to do that.  Parsing the log file?  That's a frightening
> thought.

Yow. I don't know how to do that either. You'd need some kind of hook
function that ran upon success or failure when sending. Cursory
reading of the exim manual suggests that perhaps with some chaining of
transports one could write something to a file based on whether some
other transport succeeded or failed, but for now it's beyond me. I
think that's one to take to a dedicated exim mailing list.

By the way, not this helps much, but the order of the hosts mentioned
in the route_list can be randomized.²

> Fortunately I don't have that problem.

Well, we'll leave that solution in the archives for some other unlucky
person.


Footnotes: 
¹ http://www.davep.org/emacs/boxquote.el
² http://www.exim.org/exim-html-4.50/doc/html/spec_20.html#SECT20.6

-- 
Steven E. Harris



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-08 20:14                               ` Steven E. Harris
@ 2005-06-08 20:48                                 ` David Abrahams
  2005-06-08 21:20                                   ` Steven E. Harris
  0 siblings, 1 reply; 31+ messages in thread
From: David Abrahams @ 2005-06-08 20:48 UTC (permalink / raw)


"Steven E. Harris" <seh@panix.com> writes:

> David Abrahams <dave@boost-consulting.com> writes:
>
>> I'm just putting smart_route first at the moment.  I figure dnslookup
>> might work somewhere that my regular servers are unreachable.
>
> Sure, that's fine, so long as you don't mind "maintaining" the similar
> settings in more than one router.
>
>> Cool, I was thinking something like that might be possible
>
> I'm pretty sure the Debian people pushed or at least suggested this
> option to the exim maintainers; I had never noticed it until about a
> month ago.
>
>> Actually that's what I have running right now.  I was having bad
>> smtp response this morning so I decided to bite the bullet and set
>> everything up as best I could before hearing from you.
>
> Is the two-host route list working properly?

I don't know; I've never had to fall back, and I haven't gone outside
my ISP.  I guess I could switch the order and see what happens.  Or go
down the hill to a cafe.

>> [BTW, how do you make those nice callouts?]
>
> It's boxquote.el¹. I used the functions `boxquote-region' and
> `boxquote-title' where appropriate.

Ah, nice.

>> I was thinking that the ideal would be 
>>
>> ,----
>> | smart_route:
>> |   driver = manualroute
>> |   domains = ! +local_domains
>> |   transport = remote_smtp
>> |   .include /etc/exim_smarthost_route_list
>> `----
>>
>> with
>>
>> ,----[ /etc/exim_smarthost_route_list ]
>> | route_list = * smtp.rcn.com:smtp.boost-consulting.com
>> `----
>>
>> or
>>
>> ,----[ /etc/exim_smarthost_route_list ]
>> | route_list = * smtp.boost-consulting.com:smtp.rcn.com
>> `----
>>
>> depending on which server had succeeded the last time.  But I don't
>> know how to do that.  Parsing the log file?  That's a frightening
>> thought.
>
> Yow. I don't know how to do that either. You'd need some kind of hook
> function that ran upon success or failure when sending. Cursory
> reading of the exim manual suggests that perhaps with some chaining of
> transports one could write something to a file based on whether some
> other transport succeeded or failed, but for now it's beyond me. I
> think that's one to take to a dedicated exim mailing list.

Good idea.

> By the way, not this helps much, but the order of the hosts mentioned
> in the route_list can be randomized.²

I know.  But like you said, doesn't help much.

>> Fortunately I don't have that problem.
>
> Well, we'll leave that solution in the archives for some other unlucky
> person.
>
>
> Footnotes: 
> ¹ http://www.davep.org/emacs/boxquote.el
> ² http://www.exim.org/exim-html-4.50/doc/html/spec_20.html#SECT20.6

Do you have a footnote.el, too?
<does `M-x load-library footnote'>
Oh my gosh, you do!

What other tricks am I missing?  Too many to tell, I'm sure.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-08 20:48                                 ` David Abrahams
@ 2005-06-08 21:20                                   ` Steven E. Harris
  2005-06-23 18:49                                     ` David Abrahams
  2005-07-19 11:05                                     ` func-menu David Abrahams
  0 siblings, 2 replies; 31+ messages in thread
From: Steven E. Harris @ 2005-06-08 21:20 UTC (permalink / raw)
  Cc: ding

David Abrahams <dave@boost-consulting.com> writes:

> I guess I could switch the order and see what happens.  Or go down
> the hill to a cafe.

Treat yourself to a drink and bill it to research.

> Good idea.

If you post on this topic elsewhere, please let me know so that I can
follow the thread.

> Do you have a footnote.el, too?
> <does `M-x load-library footnote'>
> Oh my gosh, you do!

From my ~/.xemacs/packages.el:

,----
| (require 'footnote)
| (setq footnote-body-tag-spacing 1
|       footnote-spaced-footnotes nil
|       footnote-style 'numeric-latin)
| (add-hook 'message-mode-hook 'footnote-mode)
`----

From there, use `C-c ! a' to add a footnote.

> What other tricks am I missing?  Too many to tell, I'm sure.

Those are two of my favorites for mail and news.

Let's see. You write a lot of C++. Do you use func-menu?

,----
| (require 'func-menu)
| (add-hook 'find-file-hooks 'fume-setup-buffer)
`----

Check out the coverage:

,----[ From func-menu.el (version 2.66) ]
| ;; Modes supported:
| ;; ================
| ;; Ada, Assembly, BibTex, C++, C, Dired, Ehdm, ELisp, FORTRAN, Ksh,
| ;; Latex, Lelisp, Makefile, Maple, Modula2, Modula3, Outline,
| ;; Objective-C, Pascal, Perl, Postscript, Prolog, PVS, Python, SGML,
| ;; Scheme, Tcl, Verilog, Manual, Ruby, JavaScript
`----

Once loaded, I like these keys:

  C-c C-f g     `fume-prompt-function-goto'
  C-c C-f l     `fume-list-functions'

-- 
Steven E. Harris



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-08 21:20                                   ` Steven E. Harris
@ 2005-06-23 18:49                                     ` David Abrahams
  2005-06-24 17:14                                       ` Steven E. Harris
  2005-07-19 11:05                                     ` func-menu David Abrahams
  1 sibling, 1 reply; 31+ messages in thread
From: David Abrahams @ 2005-06-23 18:49 UTC (permalink / raw)



Hey Steven,

I just got back from a trip on which I was occasionally disconnected,
and it looks like there were some messages that never got delivered.
They are showing up in /var/spool/exim/input/, and in fact I am seeing
about 50 of those, and I'm not certain how many may have been deleted
due to 

   ignore_bounce_errors_after = 2d
   timeout_frozen_after = 7d

In my exim.conf.  I gather they've been "frozen."

Well, with some googling I found that I can 

      exim -qff

to get them all sent, but I'm wondering what the most effective way of
dealing with this is.  It seems kinda silly that a notice can fail to
be delivered *to me* by an exim running on this machine, and the
messages will get thrown out eventually!

Oh, look:

  2005-06-22 09:28:08 IIHMQV-0002DG-CL ** dave@boost-consulting.com R=smart_route T=remote_smtp: SMTP error from remote mailer after MAIL FROM:<dave@boost-consulting.com> SIZE=2969: host smtp.mail.rcn.net [207.172.4.99]: 530 Authentication required
  2005-06-22 09:28:08 IIHMQW-0004MO-AF <= <> R=IIHMQV-0002DG-CL U=dave P=local S=2900
  2005-06-22 09:28:08 IIHMQV-0002DG-CL Completed
  2005-06-22 09:28:09 IIHMQW-0004MO-AF ** dave@boost-consulting.com R=smart_route T=remote_smtp: SMTP error from remote mailer after MAIL FROM:<> SIZE=3998: host smtp.mail.rcn.net [207.172.4.99]: 530 Authentication required
  2005-06-22 09:28:09 IIHMQW-0004MO-AF Frozen (delivery error message)

So my use of

  smart_route:
    driver = manualroute
    domains = ! +local_domains
    transport = remote_smtp
    route_list = * smtp.rcn.com:smtp.boost-consulting.com

Is not helping because it reaches smtp.rcn.com, but then that server
asks for authentication!  AFAIK there's no authentication I can
actually give it that will work from outside my cable modem, and it
forbids authentication from behind my cable modem :(

This is a little discouraging!  Got any sage words for me?

Thanks,
-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-23 18:49                                     ` David Abrahams
@ 2005-06-24 17:14                                       ` Steven E. Harris
  2005-06-24 18:09                                         ` David Abrahams
  0 siblings, 1 reply; 31+ messages in thread
From: Steven E. Harris @ 2005-06-24 17:14 UTC (permalink / raw)
  Cc: ding

David Abrahams <dave@boost-consulting.com> writes:

[...]

> I'm wondering what the most effective way of dealing with this is.
> It seems kinda silly that a notice can fail to be delivered *to me*
> by an exim running on this machine, and the messages will get thrown
> out eventually!

When you say "to me", do you mean to you as your local account on that
computer, or to you as a remote account such as boost-consulting.com?
Seeing the log messages below, I think you mean the latter, though it
is worth noting that exim may have also sent some delay or failure
warnings to your /local/ account. That would depend on whether exim
thinks the message originated from a local account.

> Oh, look:

[...]

> Is not helping because it reaches smtp.rcn.com, but then that server
> asks for authentication!  AFAIK there's no authentication I can
> actually give it that will work from outside my cable modem, and it
> forbids authentication from behind my cable modem :(

Have you tried specifying authentication credentials for rcn.com in
your exim.conf, but not citing their use as mandatory? You may recall
that earlier on our discussion we looked at the hosts_try_auth¹ and
hosts_require_tls² options for the remote_smtp transport. Perhaps you
can include rcn.com in a hosts_try_auth option but not include the TLS
stipulation:

,----[ Augmented transport ]
| remote_smtp:
|   driver = smtp
|   hosts_try_auth = smtp.rcn.com
`----

Later in the authenticators section, you'd need to specify one or two
credentials using LOGIN or PLAIN authentication:

,----[ Authenticators ]
| begin authenticators
| 
| fixed_login:
|   driver = plaintext
|   public_name = LOGIN
|   client_send = : dave : password
| 
| 
| fixed_plain:
|   driver = plaintext
|   public_name = PLAIN
|   client_send = ^dave^password
`----

Here we just cite the user name and password as global. It's probably
possible to make them host-specific, but I don't have an example on
hand.

> This is a little discouraging!  Got any sage words for me?

What a nice surprise to come home to. Can you try the suggestions
above from outside your cable modem connection and report back?


Footnotes: 
¹ http://www.exim.org/exim-html-4.50/doc/html/spec_30.html#IX2239
² http://www.exim.org/exim-html-4.50/doc/html/spec_30.html#IX2236

-- 
Steven E. Harris




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-24 17:14                                       ` Steven E. Harris
@ 2005-06-24 18:09                                         ` David Abrahams
  2005-06-25 15:33                                           ` Steven E. Harris
  0 siblings, 1 reply; 31+ messages in thread
From: David Abrahams @ 2005-06-24 18:09 UTC (permalink / raw)


"Steven E. Harris" <seh@panix.com> writes:

> David Abrahams <dave@boost-consulting.com> writes:
>
> [...]
>
>> I'm wondering what the most effective way of dealing with this is.
>> It seems kinda silly that a notice can fail to be delivered *to me*
>> by an exim running on this machine, and the messages will get thrown
>> out eventually!
>
> When you say "to me", do you mean to you as your local account on that
> computer, or to you as a remote account such as
> boost-consulting.com?

I just mean "to me."  Of course it's technically logical when you
account for the fact that going to me involves a remote IMAP server.
But then the messages disappear eventually, which seems kinda dumb.

> Seeing the log messages below, I think you mean the latter, though it
> is worth noting that exim may have also sent some delay or failure
> warnings to your /local/ account. 

I don't even know what a local account might be on my laptop.

> That would depend on whether exim
> thinks the message originated from a local account.
>
>> Oh, look:
>
> [...]
>
>> Is not helping because it reaches smtp.rcn.com, but then that server
>> asks for authentication!  AFAIK there's no authentication I can
>> actually give it that will work from outside my cable modem, and it
>> forbids authentication from behind my cable modem :(
>
> Have you tried specifying authentication credentials for rcn.com in
> your exim.conf, but not citing their use as mandatory? 

Nope; it's worth a shot.  Maybe it's time to go down the street to
that cafe.

> You may recall
> that earlier on our discussion we looked at the hosts_try_auth¹ 

Say, how do you get footnote to superscript?  Do you need to do
anything special to make sure that the receiver doesn't have problems
with the coding system you send?

> and hosts_require_tls² options for the remote_smtp
> transport. Perhaps you can include rcn.com in a hosts_try_auth
> option but not include the TLS stipulation:
>
> ,----[ Augmented transport ]
> | remote_smtp:
> |   driver = smtp
> |   hosts_try_auth = smtp.rcn.com
> `----
>
> Later in the authenticators section, you'd need to specify one or two
> credentials using LOGIN or PLAIN authentication:
>
> ,----[ Authenticators ]
> | begin authenticators
> | 
> | fixed_login:
> |   driver = plaintext
> |   public_name = LOGIN
> |   client_send = : dave : password
> | 
> | 
> | fixed_plain:
> |   driver = plaintext
> |   public_name = PLAIN
> |   client_send = ^dave^password
> `----
>
> Here we just cite the user name and password as global. It's probably
> possible to make them host-specific, but I don't have an example on
> hand.

No need; I'm using the same password on all smtp servers.

>> This is a little discouraging!  Got any sage words for me?
>
> What a nice surprise to come home to. 

Sarcasm, or...?

> Can you try the suggestions
> above from outside your cable modem connection and report back?

I sure will.  Probably a little later this afternoon.

Thanks for all your help!

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Gnus with Exim
  2005-06-24 18:09                                         ` David Abrahams
@ 2005-06-25 15:33                                           ` Steven E. Harris
  0 siblings, 0 replies; 31+ messages in thread
From: Steven E. Harris @ 2005-06-25 15:33 UTC (permalink / raw)
  Cc: ding

David Abrahams <dave@boost-consulting.com> writes:

> I don't even know what a local account might be on my laptop.

When we first started discussing your exim configuration I asked if
you intended to exchange local mail. Whether you want to or not, exim
will deliver mail locally to your account. You may never look at it,
and may not have any of your mail clients set up to read it or even to
be able to send to it, but it's there.

[...]

> Sarcasm, or...?

Indeed. Just when we thought we had this all figured out.

We'll take this off-list now.

-- 
Steven E. Harris



^ permalink raw reply	[flat|nested] 31+ messages in thread

* func-menu
  2005-06-08 21:20                                   ` Steven E. Harris
  2005-06-23 18:49                                     ` David Abrahams
@ 2005-07-19 11:05                                     ` David Abrahams
  2005-07-19 14:01                                       ` func-menu J. David Boyd
  2005-07-19 14:21                                       ` func-menu Ted Zlatanov
  1 sibling, 2 replies; 31+ messages in thread
From: David Abrahams @ 2005-07-19 11:05 UTC (permalink / raw)


Hi Steven,

"Steven E. Harris" <seh@panix.com> writes:

> Let's see. You write a lot of C++. Do you use func-menu?
>
> ,----
> | (require 'func-menu)
> | (add-hook 'find-file-hooks 'fume-setup-buffer)
> `----
>
> Check out the coverage:
>
> ,----[ From func-menu.el (version 2.66) ]
> | ;; Modes supported:
> | ;; ================
> | ;; Ada, Assembly, BibTex, C++, C, Dired, Ehdm, ELisp, FORTRAN, Ksh,
> | ;; Latex, Lelisp, Makefile, Maple, Modula2, Modula3, Outline,
> | ;; Objective-C, Pascal, Perl, Postscript, Prolog, PVS, Python, SGML,
> | ;; Scheme, Tcl, Verilog, Manual, Ruby, JavaScript
> `----
>
> Once loaded, I like these keys:
>
>   C-c C-f g     `fume-prompt-function-goto'
>   C-c C-f l     `fume-list-functions'

Finally tracked this package down.  Unfortunately the only version I
can find is only compatible with XEmacs, and I'm using Gnu.  Got a
link?

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: func-menu
  2005-07-19 11:05                                     ` func-menu David Abrahams
@ 2005-07-19 14:01                                       ` J. David Boyd
  2005-07-19 14:21                                       ` func-menu Ted Zlatanov
  1 sibling, 0 replies; 31+ messages in thread
From: J. David Boyd @ 2005-07-19 14:01 UTC (permalink / raw)


David Abrahams <dave@boost-consulting.com> writes:

> Hi Steven,
>
> "Steven E. Harris" <seh@panix.com> writes:
>
>> Let's see. You write a lot of C++. Do you use func-menu?
>>
>> ,----
>> | (require 'func-menu)
>> | (add-hook 'find-file-hooks 'fume-setup-buffer)
>> `----
>>
>> Check out the coverage:
>>
>> ,----[ From func-menu.el (version 2.66) ]
>> | ;; Modes supported:
>> | ;; ================
>> | ;; Ada, Assembly, BibTex, C++, C, Dired, Ehdm, ELisp, FORTRAN, Ksh,
>> | ;; Latex, Lelisp, Makefile, Maple, Modula2, Modula3, Outline,
>> | ;; Objective-C, Pascal, Perl, Postscript, Prolog, PVS, Python, SGML,
>> | ;; Scheme, Tcl, Verilog, Manual, Ruby, JavaScript
>> `----
>>
>> Once loaded, I like these keys:
>>
>>   C-c C-f g     `fume-prompt-function-goto'
>>   C-c C-f l     `fume-list-functions'
>
> Finally tracked this package down.  Unfortunately the only version I
> can find is only compatible with XEmacs, and I'm using Gnu.  Got a
> link?
>
> -- 
> Dave Abrahams
> Boost Consulting
> www.boost-consulting.com

Try imenu under Gnu emacs.


Dave




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: func-menu
  2005-07-19 11:05                                     ` func-menu David Abrahams
  2005-07-19 14:01                                       ` func-menu J. David Boyd
@ 2005-07-19 14:21                                       ` Ted Zlatanov
  2005-07-19 14:35                                         ` func-menu David Abrahams
  1 sibling, 1 reply; 31+ messages in thread
From: Ted Zlatanov @ 2005-07-19 14:21 UTC (permalink / raw)
  Cc: ding

On Tue, 19 Jul 2005, dave@boost-consulting.com wrote:

> Finally tracked this package down.  Unfortunately the only version I
> can find is only compatible with XEmacs, and I'm using Gnu.  Got a
> link?

Have you tried which-func-mode in GNU Emacs?  I'm honestly not sure if
it supercedes or coexists with func-menu, but it works pretty well for
me.

On a slightly related note, can anyone think of an interesting way to
use which-func-mode with Gnus?  Maybe in the groups buffer it should
show the current topic; in the articles buffer it can show the thread
subject.

Ted



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: func-menu
  2005-07-19 14:21                                       ` func-menu Ted Zlatanov
@ 2005-07-19 14:35                                         ` David Abrahams
  2005-07-19 15:20                                           ` func-menu Ted Zlatanov
  0 siblings, 1 reply; 31+ messages in thread
From: David Abrahams @ 2005-07-19 14:35 UTC (permalink / raw)


"Ted Zlatanov" <tzz@lifelogs.com> writes:

> On Tue, 19 Jul 2005, dave@boost-consulting.com wrote:
>
>> Finally tracked this package down.  Unfortunately the only version I
>> can find is only compatible with XEmacs, and I'm using Gnu.  Got a
>> link?
>
> Have you tried which-func-mode in GNU Emacs?  

Just now.

> I'm honestly not sure if
> it supercedes or coexists with func-menu, but it works pretty well for
> me.

What does it do other than try to display the current function name?
That particular feature is totally broken when it comes to C++.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: func-menu
  2005-07-19 14:35                                         ` func-menu David Abrahams
@ 2005-07-19 15:20                                           ` Ted Zlatanov
  2005-07-19 15:41                                             ` func-menu David Abrahams
  0 siblings, 1 reply; 31+ messages in thread
From: Ted Zlatanov @ 2005-07-19 15:20 UTC (permalink / raw)
  Cc: ding

On Tue, 19 Jul 2005, dave@boost-consulting.com wrote:

> "Ted Zlatanov" <tzz@lifelogs.com> writes:
> 
>> Have you tried which-func-mode in GNU Emacs?  
> 
> What does it do other than try to display the current function name?

Nothing.  I'm sorry for posting before my coffee :) I know and use
imenu, but somehow ended up writing about which-func-mode.

You can also look at the speedbar, which is nice (I've used it with
Java).  I don't know if the code it uses to recognize functions is
different from imenu.

> That particular feature is totally broken when it comes to C++.

Really?  Can you submit a bug to the Emacs team, if you have the time?

Sorry for drifting off-topic :)

Ted



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: func-menu
  2005-07-19 15:20                                           ` func-menu Ted Zlatanov
@ 2005-07-19 15:41                                             ` David Abrahams
  2005-07-20  1:03                                               ` func-menu Danny Siu
  0 siblings, 1 reply; 31+ messages in thread
From: David Abrahams @ 2005-07-19 15:41 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1052 bytes --]

"Ted Zlatanov" <tzz@lifelogs.com> writes:

> On Tue, 19 Jul 2005, dave@boost-consulting.com wrote:
>
>> "Ted Zlatanov" <tzz@lifelogs.com> writes:
>> 
>>> Have you tried which-func-mode in GNU Emacs?  
>> 
>> What does it do other than try to display the current function name?
>
> Nothing.  I'm sorry for posting before my coffee :) I know and use
> imenu, but somehow ended up writing about which-func-mode.

I don't know what imenu is either.

> You can also look at the speedbar, which is nice (I've used it with
> Java).  I don't know if the code it uses to recognize functions is
> different from imenu.
>
>> That particular feature is totally broken when it comes to C++.
>
> Really?  Can you submit a bug to the Emacs team, if you have the time?

I really don't have time to do that for a thing you just asked me
to try and I had no other reason to use.  However I'll give you a file
that contains one class with inline member functions, where the only
thing you ever see in the mode line is the class name.  Voilà.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: keyword.hpp --]
[-- Type: text/x-c++, Size: 3349 bytes --]

// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
// distribution is subject to the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifndef KEYWORD_050328_HPP
#define KEYWORD_050328_HPP

#include <boost/parameter/aux_/unwrap_cv_reference.hpp>
#include <boost/parameter/aux_/tag.hpp>
#include <boost/parameter/aux_/default.hpp>
#include <boost/noncopyable.hpp>

namespace boost { namespace parameter {

// Instances of unique specializations of keyword<...> serve to
// associate arguments with parameter names.  For example:
//
//    struct rate_;           // parameter names
//    struct skew_;
//    namespace
//    {
//      keyword<rate_> rate;  // keywords
//      keyword<skew_> skew;
//    }
//
//    ...
//
//    f(rate = 1, skew = 2.4);
//
template <class Tag>
struct keyword : noncopyable
{
    template <class T>
    typename aux::tag<Tag, T>::type
    operator=(T& x) const
    {
        typedef typename aux::tag<Tag, T>::type result;
        return result(x);
    }

    template <class Default>
    aux::default_<Tag, Default>
    operator|(Default& default_) const
    {
        return aux::default_<Tag, Default>(default_);
    }

    template <class Default>
    aux::lazy_default<Tag, Default>
    operator||(Default& default_) const
    {
        return aux::lazy_default<Tag, Default>(default_);
    }

#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1200)  // avoid partial ordering bugs
    template <class T>
    typename aux::tag<Tag, T const>::type
    operator=(T const& x) const
    {
        typedef typename aux::tag<Tag, T const>::type result;
        return result(x);
    }
#endif 

#if !BOOST_WORKAROUND(BOOST_MSVC, == 1200)  // avoid partial ordering bugs
    template <class Default>
    aux::default_<Tag, const Default>
    operator|(const Default& default_) const
#if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
        volatile
#endif 
    {
        return aux::default_<Tag, const Default>(default_);
    }

    template <class Default>
    aux::lazy_default<Tag, Default>
    operator||(Default const& default_) const
#if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
        volatile
#endif 
    {
        return aux::lazy_default<Tag, Default>(default_);
    }
#endif

 public: // Insurance against ODR violations
    
    // People will need to define these keywords in header files.  To
    // prevent ODR violations, it's important that the keyword used in
    // every instantiation of a function template is the same object.
    // We provide a reference to a common instance of each keyword
    // object and prevent construction by users.
    
    static keyword<Tag>& get()
    {
        static keyword<Tag> result;
        return result;
    }
    
 private:
    keyword() {}
};

// Reduces boilerplate required to declare and initialize keywords
// without violating ODR.  Declares a keyword tag type with the given
// name in namespace tag_namespace, and declares and initializes a 
// 
#define BOOST_PARAMETER_KEYWORD(tag_namespace,name)             \
   namespace tag_namespace { struct name; }                     \
   ::boost::parameter::keyword<tag_namespace::name>& name       \
   = ::boost::parameter::keyword<tag_namespace::name>::get();


}} // namespace boost::parameter

#endif // KEYWORD_050328_HPP


[-- Attachment #3: Type: text/plain, Size: 61 bytes --]


-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: func-menu
  2005-07-19 15:41                                             ` func-menu David Abrahams
@ 2005-07-20  1:03                                               ` Danny Siu
  2005-07-22 14:55                                                 ` func-menu David Abrahams
  0 siblings, 1 reply; 31+ messages in thread
From: Danny Siu @ 2005-07-20  1:03 UTC (permalink / raw)


[-- Attachment #1: Type: TEXT/PLAIN, Size: 351 bytes --]

David,

ECB does a nice job parsing Boost library headers plus it has an outline
view for the source file which making my code browsing much easier.

See my attached screen shot.

ECB can be obtained from:
   http://ecb.sourceforge.net/

-- 
Danny Dick-Fung Siu             mailto:dsiu@adobe.com
Advanced Technology Labs @ Adobe Systems Incorporated


[-- Attachment #2: ecb-boost.jpg --]
[-- Type: image/jpeg, Size: 126412 bytes --]

[-- Attachment #3: Type: text/plain, Size: 5364 bytes --]


David Abrahams writes:

  David> "Ted Zlatanov" <tzz@lifelogs.com> writes:
  >> On Tue, 19 Jul 2005, dave@boost-consulting.com wrote:
  >> 
  >>> "Ted Zlatanov" <tzz@lifelogs.com> writes:
  >>> 
  >>>> Have you tried which-func-mode in GNU Emacs?
  >>> 
  >>> What does it do other than try to display the current function name?
  >> 
  >> Nothing.  I'm sorry for posting before my coffee :) I know and use
  >> imenu, but somehow ended up writing about which-func-mode.

  David> I don't know what imenu is either.

  >> You can also look at the speedbar, which is nice (I've used it with
  >> Java).  I don't know if the code it uses to recognize functions is
  >> different from imenu.
  >> 
  >>> That particular feature is totally broken when it comes to C++.
  >> 
  >> Really?  Can you submit a bug to the Emacs team, if you have the time?

  David> I really don't have time to do that for a thing you just asked me
  David> to try and I had no other reason to use.  However I'll give you a
  David> file that contains one class with inline member functions, where
  David> the only thing you ever see in the mode line is the class name.
  David> Voilà.


  David> // Copyright Daniel Wallin, David Abrahams 2005. Use, modification
  David> // and distribution is subject to the Boost Software License,
  David> // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  David> // http://www.boost.org/LICENSE_1_0.txt)

  David> #ifndef KEYWORD_050328_HPP define KEYWORD_050328_HPP

  David> #include <boost/parameter/aux_/unwrap_cv_reference.hpp> include
  David> #<boost/parameter/aux_/tag.hpp> include
  David> #<boost/parameter/aux_/default.hpp> include <boost/noncopyable.hpp>

  David> namespace boost { namespace parameter {

  David> // Instances of unique specializations of keyword<...> serve to
  David> // associate arguments with parameter names.  For example:
  David> //
  David> //    struct rate_; // parameter names struct skew_; namespace {
  David> //      keyword<rate_> rate; // keywords keyword<skew_> skew;
  David> //    }
  David> //
  David> //    ...
  David> //
  David> //    f(rate = 1, skew = 2.4);
  David> //
  David> template <class Tag> struct keyword : noncopyable {
  David>     template <class T> typename aux::tag<Tag, T>::type operator=(T&
  David>     x) const {
  David>         typedef typename aux::tag<Tag, T>::type result; return
  David>         result(x);
  David>     }

  David>     template <class Default> aux::default_<Tag, Default>
  David>     operator|(Default& default_) const {
  David>         return aux::default_<Tag, Default>(default_);
  David>     }

  David>     template <class Default> aux::lazy_default<Tag, Default>
  David>     operator||(Default& default_) const {
  David>         return aux::lazy_default<Tag, Default>(default_);
  David>     }

  David> #if !BOOST_WORKAROUND(BOOST_MSVC, <= 1200) // avoid partial
  David> #ordering bugs
  David>     template <class T> typename aux::tag<Tag, T const>::type
  David>     operator=(T const& x) const {
  David>         typedef typename aux::tag<Tag, T const>::type result;
  David>         return result(x);
  David>     }
  David> #endif

  David> #if !BOOST_WORKAROUND(BOOST_MSVC, == 1200) // avoid partial
  David> #ordering bugs
  David>     template <class Default> aux::default_<Tag, const Default>
  David>     operator|(const Default& default_) const
  David> #if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
  David>         volatile
  David> #endif
  David>     {
  David>         return aux::default_<Tag, const Default>(default_);
  David>     }

  David>     template <class Default> aux::lazy_default<Tag, Default>
  David>     operator||(Default const& default_) const
  David> #if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
  David>         volatile
  David> #endif
  David>     {
  David>         return aux::lazy_default<Tag, Default>(default_);
  David>     }
  David> #endif

  David>  public: // Insurance against ODR violations
    
  David>     // People will need to define these keywords in header files.
  David>     // To prevent ODR violations, it's important that the keyword
  David>     // used in every instantiation of a function template is the
  David>     // same object.  We provide a reference to a common instance of
  David>     // each keyword object and prevent construction by users.
    
  David>     static keyword<Tag>& get() {
  David>         static keyword<Tag> result; return result;
  David>     }
    
  David>  private:
  David>     keyword() {}
  David> };

  David> // Reduces boilerplate required to declare and initialize keywords
  David> // without violating ODR.  Declares a keyword tag type with the
  David> // given name in namespace tag_namespace, and declares and
  David> // initializes a
  David> // 
  David> #define BOOST_PARAMETER_KEYWORD(tag_namespace,name) \
  David>    namespace tag_namespace { struct name; } \
  David>    ::boost::parameter::keyword<tag_namespace::name>& name \ =
  David>    ::boost::parameter::keyword<tag_namespace::name>::get();


  David> }} // namespace boost::parameter

  David> #endif // KEYWORD_050328_HPP



  David> -- Dave Abrahams Boost Consulting www.boost-consulting.com

-- 
Danny Siu

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: func-menu
  2005-07-20  1:03                                               ` func-menu Danny Siu
@ 2005-07-22 14:55                                                 ` David Abrahams
  0 siblings, 0 replies; 31+ messages in thread
From: David Abrahams @ 2005-07-22 14:55 UTC (permalink / raw)


Danny Siu <dsiu@adobe.com> writes:

> David,
>
> ECB does a nice job parsing Boost library headers plus it has an outline
> view for the source file which making my code browsing much easier.
>
> See my attached screen shot.

That's pretty nifty!

> ECB can be obtained from:
>    http://ecb.sourceforge.net/
>

I'll take a look at it, thanks.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2005-07-22 14:55 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-03 13:30 Asynchronous Gnus? David Abrahams
2005-06-03 20:37 ` Gnus with Exim (was: Asynchronous Gnus?) David Abrahams
2005-06-03 22:28   ` Gnus with Exim Steven E. Harris
2005-06-04 13:47     ` David Abrahams
2005-06-04 15:29       ` Steven E. Harris
2005-06-06  2:05         ` David Abrahams
2005-06-06 17:04           ` Steven E. Harris
2005-06-06 18:31             ` David Abrahams
2005-06-06 19:59               ` Steven E. Harris
2005-06-06 20:43                 ` David Abrahams
2005-06-06 22:44                   ` Steven E. Harris
2005-06-06 23:08                     ` David Abrahams
2005-06-06 23:47                       ` Steven E. Harris
2005-06-07  1:36                         ` David Abrahams
2005-06-08 18:14                           ` Steven E. Harris
2005-06-08 19:45                             ` David Abrahams
2005-06-08 20:14                               ` Steven E. Harris
2005-06-08 20:48                                 ` David Abrahams
2005-06-08 21:20                                   ` Steven E. Harris
2005-06-23 18:49                                     ` David Abrahams
2005-06-24 17:14                                       ` Steven E. Harris
2005-06-24 18:09                                         ` David Abrahams
2005-06-25 15:33                                           ` Steven E. Harris
2005-07-19 11:05                                     ` func-menu David Abrahams
2005-07-19 14:01                                       ` func-menu J. David Boyd
2005-07-19 14:21                                       ` func-menu Ted Zlatanov
2005-07-19 14:35                                         ` func-menu David Abrahams
2005-07-19 15:20                                           ` func-menu Ted Zlatanov
2005-07-19 15:41                                             ` func-menu David Abrahams
2005-07-20  1:03                                               ` func-menu Danny Siu
2005-07-22 14:55                                                 ` func-menu David Abrahams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).