Subject: feature request: choose smtp server

From: Joel Boonstra <[email-masked]>
Date: Tue, 25 Dec 2001 12:06:15 -0500 (EST)

Hey,

I, and others I work with, have found ourselves taking advantage of pine's
ability to define multiple smtp servers, since we work both from the
office and from home.  However, I constantly find myself forgetting to
shuffle the appropriate server name up and down depending on where I'm
working from.  This leads to the first message I send failing, and me
having to remember to re-shuffle my server names.

Would it be valuable to allow you to choose which smtp server to use for a
particular message, much like a sending filter?  That way, when I send a
message, I could shuffle through my smtp servers to decide which one to
use upon sending.  This could, of course, be configurable, so if I didn't
want the choice, I wouldn't have it.  Or maybe this would only be
available if multiple smtp servers were defined in the config.

Thinking about this, now that I've written this down, this may end up
being more of a pain than a feature.  Have other people found this to be
something they might need?

Joel

-- 
[ joel boonstra | [email-masked] ]

-- 
-----------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/pine/pine-info/
-----------------------------------------------------------------

---

From: Eduardo Chappa <[email-masked]>
Date: Wed, 26 Dec 2001 14:27:54 -0800 (PST)

*** Joel Boonstra ([email-masked]) wrote in the pine-info list on...:

:) I, and others I work with, have found ourselves taking advantage of
:) pine's ability to define multiple smtp servers, since we work both from
:) the office and from home. However, I constantly find myself forgetting
:) to shuffle the appropriate server name up and down depending on where
:) I'm working from. This leads to the first message I send failing, and
:) me having to remember to re-shuffle my server names.
:) [snip]
:) Thinking about this, now that I've written this down, this may end up
:) being more of a pain than a feature. Have other people found this to be
:) something they might need?

Hello Joel,

  You can't do this as you ask for. Given that you know that smtp-server
is a list, and that doesn't work for you, you can try a patch that I have
in my web page which allows you to "define your own rules...". Among other
things you can do this.

  If you apply the patch then all you need to do is to define the new
variable "smtp-rules" to be something like

	_ROLE_ == {nick of role} => _SMTP_{some.smtp.server}
        _ADDRESSTO_ == [email-masked]} => _SMTP_{another.smtp.server}
	_TO_ == {Fred Flinstones} => _SMTP_{smtp.bedrock.foo}

 What the patch will do is to add all the smtp servers where it finds a
match to the top of the list of stmp-servers (so the first match will be
the first smtp server in your new list, the second match the second in
your list, and so on, and all that is followed by your list of smtp
servers).

 As you point out, it would also be nice to be able to choose the smtp
server among a list of possible smtp servers, in the same way that one
chooses a printer when you print from pine, but that today is not possible
yet.

-- 
Eduardo
http://www.math.washington.edu/~chappa/pine/

---

From: Nancy McGough <[email-masked]>
Date: Thu, 27 Dec 2001 11:06:25 +0000 (GMT Normalzeit)

On 25 Dec 2001 Joel Boonstra ([email-masked]) wrote:
> I, and others I work with, have found ourselves taking
> advantage of pine's ability to define multiple smtp servers,
> since we work both from the office and from home.  However, I
> constantly find myself forgetting to shuffle the appropriate
> server name up and down depending on where I'm working from.
> This leads to the first message I send failing, and me having
> to remember to re-shuffle my server names.

I also have this problem and I don't understand why Pine doesn't
step to the next SMTP server in the list and try that one when
the first fails. Could someone on the Pine team explain how the
smtp-server list is supposed to work so I can update my Power
Pine page so it accurately describes how this list variable
works.

> Would it be valuable to allow you to choose which smtp server
> to use for a particular message, much like a sending filter?

I also would really like this and it's my first wish in my Pine
wish list, which is here

 http://www.ii.com/internet/messaging/pine/#wishesMisc

Can you describe more about your setup? Do you have a laptop that
you move back and forth between work and home? What operating
system is it running? What version of Pine are you running? Does
one or both of your SMTP servers reside on a system that you can
SSH to? Depending on your answers, I may have some suggestions
for easy ways to set things up so you don't need to worry about
swapping your smtp-server list.

  -Nancy

-- 
ii Main Pine Page: <http://www.ii.com/internet/messaging/pine/>

Nancy McGough           <http://www.ii.com/>           Infinite Ink
--= Sent via Pine 4.43: IMAP, NNTP & ESMTP for Unix/Win/MacOS X =--

---

From: Joel Boonstra <[email-masked]>
Date: Thu, 27 Dec 2001 10:37:29 -0800 (PST)

> I also have this problem and I don't understand why Pine doesn't step to
> the next SMTP server in the list and try that one when the first fails.
> Could someone on the Pine team explain how the smtp-server list is
> supposed to work so I can update my Power Pine page so it accurately
> describes how this list variable works.

Actually, I should amend this slightly.  I have found that Pine tries the
next server when the first one fails, at least sometimes.  But I don't
know under what conditions it does this.  It may be a function of not
being able to locate the SMTP server, or perhaps the server denying
relaying, or something else.

>  http://www.ii.com/internet/messaging/pine/#wishesMisc

Cool, I'm glad I'm not the only one ;)

> swapping your smtp-server list.

I have a laptop that I bring to and from the office with me.  It uses RH
7.1, with Pine 4.43, patched with Eduardo's excellent fancy thread patch.

At the office, since I'm connected from the proper IP address, I am
immediately authenticated on our SMTP server, and can freely relay mail
with it.  However, we also try to provide our SMTP server to our
Ministries (we are a non-profit, providing free hosting to online
Ministries) in a secure and intelligent manner.  The method we've chosen
is to require POP (or IMAP) authentication before sending.  Once you've
successfully authenticated on our POP server (which you can only do if you
have an email account with us, of course), your IP address is recorded on
our SMTP server, and that IP is allowed a 30-minute window to send email.
Once that 30 minutes is up, you need to re-authenticate.

So, from my apartment, this normally wouldn't be a problem, since I'm
usually doing a lot with email whenever I'm online.  However, there are
times when I'm not authenticated, and my send fails.  It's a simple matter
to re-check mail and send again.  However, ATT@Home also provides a SMTP
server that I can use, and since I'm connecting from an ATT IP from home,
no further authentication is needed.  Thus, from home, I prefer to use
their smtp server to eliminate any potential sending barriers.

I can definitely not SSH into the ATT server.  I can SSH into the work
one, but I'd rather not use that for pine, since I prefer running it on a
local machine (especially when I'm on a dialup, as I am now).  I'm willing
to accept the extra overhead of shuffling SMTP servers if the only other
option is using pine on a remote server.

Thanks for your time -- if you have any suggestions, please don't hesitate
to let me know.  Sorry for the rather lengthy email.

---

From: Joel Boonstra <[email-masked]>
Date: Thu, 27 Dec 2001 10:42:13 -0800 (PST)

<snip>
> your list, and so on, and all that is followed by your list of smtp

I looked at the patch before posting, but it didn't seem to me that it
solved my problem.  My criteria for choosing which SMTP server to use is
my physical location, not which role I'm using, or which person I'm
sending to, or anything like that.  So, if this patch could somehow use my
system's external IP address as an operand in the conditional test, that
would solve the problem.  However, many times I'm connected from behind a
firewall, so my own machine's IP address would be a 10.*.*.* address.  In
fact, nothing about my network settings change from when I connect at work
or connect at home -- the two networks are setup almost identically, from
my machine's perspective.

So I guess I don't know if that would be an option or not.

> chooses a printer when you print from pine, but that today is not
> possible yet.

Okay, I figured I'd ask, and see if others shared the feature wish.

Thanks for everyone's helpful comments.

---

From: Eduardo Chappa <[email-masked]>
Date: Thu, 27 Dec 2001 12:15:21 -0800 (PST)

*** Nancy McGough ([email-masked]) wrote in the...:

:) On 25 Dec 2001 Joel Boonstra ([email-masked]) wrote:
:) > I, and others I work with, have found ourselves taking advantage of
:) > pine's ability to define multiple smtp servers, since we work both
:) > from the office and from home. However, I constantly find myself
:) > forgetting to shuffle the appropriate server name up and down
:) > depending on where I'm working from. This leads to the first message
:) > I send failing, and me having to remember to re-shuffle my server
:) > names.
:)
:) I also have this problem and I don't understand why Pine doesn't step
:) to the next SMTP server in the list and try that one when the first
:) fails.

A quick reading of the smtp code shows that pine will step to the second
server if (and only if) a connection to the first server fails. This is
different than if the first server fails to send.

---

From: Nancy McGough <[email-masked]>
Date: Mon, 31 Dec 2001 10:40:28 +0000 (GMT Normalzeit)

> 7.1, with Pine 4.43, patched with Eduardo's excellent fancy thread patch.

Here are 3 possible solutions.

1] In your pinerc, set

smtp-server=localhost

and then set up ssh port forwarding to forward your machine's
port 25 to your work machine's SMTP server. This should then work
whether you are at home or work because the requests to your work
SMTP server will appear to be local.

I've done this with PC-Pine and SecureCRT port forwarding but
I've never done it from a Linux box. If anyone has successfully
done this on *nix, I'd appreciate info so I can 1) try it and 2)
add info about it in my Using Port Forwarding with Pine, which is
here

 <http://www.ii.com/internet/messaging/pine/pc/#ssh>

2] Set your SMTP server to your work smtp server

smtp-server=work.smtp.server

And also set things up so that Pine always does an
IMAP-before-SMTP authentication before it attempts to send. The
way I do this is by putting my Pine address book on the IMAP
server and then when I start the composition of a message, Pine
checks the remote abook on the IMAP server and authenticates. You
then need to compose the message in less than 30 minutes! Another
possibility is to have the Fcc mailbox be on the IMAP server --
this will also make Pine do an IMAP-before-SMTP authentication
before sending.

3] Set up three pine aliases

pine echo "use pinehome or pinework"
pinehome "\pine -x .pinercexHome"
pinework "\pine -x .pinercexWork"

and then put the appropriate smtp-server setting (and any other
location-specific settings) in the pine exception files. I
discuss this kind of thing in Compartmentalizing and Sharing Your
Pine Settings, which is here

<http://www.ii.com/internet/messaging/pine/sharing/>

Hope one of these works for you!
Nancy
^x

---

From: Kenneth Crudup <[email-masked]>
Date: Mon, 31 Dec 2001 02:50:00 -0800 (PST)

> this will also make Pine do an IMAP-before-SMTP authentication

These methods work only in 4.33; some of the optimizations done in the 4.4X
series means IB4S doesn't work anymore. Thankfully, my ISP went to SMTP
AUTH and I didn't have the problem anymore.

	-Kenny

-- 
Kenneth R. Crudup   Sr. SW Engineer, Scott County Consulting, Washington, D.C.
Home1: PO Box 914         Silver Spring, MD 20910-0914         [email-masked]
Home2: 38010 Village Cmn. #217  Fremont, CA 94536-7525          (510) 745-0101

---

From: Nancy McGough <[email-masked]>
Date: Mon, 31 Dec 2001 11:11:52 +0000 (GMT Normalzeit)

> AUTH and I didn't have the problem anymore.

Thanks for the info Kenneth. Here are some questions...

* In Pine 4.43, does *any* method work to do IB4S, e.g., opening
  an IMAP mailbox within 30 minutes (or whatever the window is)?

* What about PB4S -- can Pine 4.43 do that?

* Are IB4S and PB4S common acronyms?? (This is the first I've
  heard of them!)

Side Question: I see you have a panix account -- what do you
think of their IMAP setup? I include them in my IMAP service
provider list, which is here

<http://www.ii.com/internet/messaging/pine/changing_from/#publicAddress>

but their description of IMAP access sounds odd.

Thanks for any info!
Nancy
^x

---

From: Kenneth Crudup <[email-masked]>
Date: Mon, 31 Dec 2001 11:20:22 -0800 (PST)

>   an IMAP mailbox within 30 minutes (or whatever the window is)?

Yeah. What I'd do is that when my SMTP session window expired and I'd get
an error on "send", I'd "pOstpone" the message, which would re-login to
the IMAP server, then I'd do a "Compose/continue postponed" and get a
new 30min window as well.

> * What about PB4S -- can Pine 4.43 do that?

Can't say for sure.

> * Are IB4S and PB4S common acronyms?? (This is the first I've

Hey! I've started a new acronym!

> think of their IMAP setup?

They use a funky way of filling the INBOX, but it works well for me. Now
that they have SMTP AUTH (spurred in part by the failure of the 4.4X
series to do IB4S consistently) I'm completely satisfied.

	-Kenny