# Test/net/imap/test\_imap.rb

**URL:** <https://www.ruby-forum.com/t/test-net-imap-test-imap-rb/188139>\
**Category:** Development\
**Created:** [May 6, 2010, 1:47pm UTC](https://www.ruby-forum.com/t/test-net-imap-test-imap-rb/188139 "2010-05-06T13:47:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Takahiro\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/76d3ee/32.png) [@Takahiro\_K](https://www.ruby-forum.com/u/Takahiro_K)\
**Post date:** [May 6, 2010, 1:47pm UTC](https://www.ruby-forum.com/t/test-net-imap-test-imap-rb/188139/1 "2010-05-06T13:47:29Z")

</div>

e$B$3$s$P$s$O!#e(B

trunke$B$Ne(Bimape$B$N%F%9%H$G!“e(B1e$B2U=j$@$1e(B “localhost”  
e$B$G$O$J$/!“e(B"127.0.0.1"e$B$He(B  
e$B;XDj$7$F$$$k$H$3$m$,$”$j$^$9!#$3$l$C$F!“e(BIPv4e$B$J%”%I%l%9I=5-$G$”$kI,MW$,e(B  
e$B$"$k$N$G$7$g$&$+e(B?

localhoste$B$,e(B ::1  
e$B$H$J$C$F!"$3$A$i$@$1e(Blistene$B$7$F$$$k\>uBV$G!"e(B127.0.0.1e$B$Ke(B  
e$B@\B3$7$K9T$C$F$+$J$j$N%F%9%H$,e(Bfaile$B$7$F$$$k5$$,$7$^$9!#e(B

–  
e$B?@8Me(B e$BN4Gne(B / Takahiro K.

# Index: test/net/imap/test\_imap.rb

— test/net/imap/test\_imap.rb (revision 27645)  
+++ test/net/imap/test\_imap.rb (working copy)  
@@ -83,7 +83,7 @@  
if defined?(OpenSSL)  
assert\_raise(OpenSSL::SSL::SSLError) do  
imaps\_test do |port|

- 

```
     Net::IMAP.new("127.0.0.1",

```

- 

```
     Net::IMAP.new("localhost", # ""127.0.0.1",
                   :port => port,
                   :ssl => { :ca_file => CA_FILE })
   end
```

---

<div class="post-metadata">

**Author:** ![Takahiro\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/76d3ee/32.png) [@Takahiro\_K](https://www.ruby-forum.com/u/Takahiro_K)\
**Post date:** [May 9, 2010, 1:57am UTC](https://www.ruby-forum.com/t/test-net-imap-test-imap-rb/188139/2 "2010-05-09T01:57:11Z")

</div>

e$BA0ED$G$9!#e(B

2010e$BG/e(B5e$B7ne(B6e$BF|e(B20:46 Takahiro K.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> e$B$3$s$P$s$O!#e(B
> 
> trunke$B$Ne(Bimape$B$N%F%9%H$G!“e(B1e$B2U=j$@$1e(B “localhost” e$B$G$O$J$/!“e(B"127.0.0.1"e$B$He(B  
> e$B;XDj$7$F$$$k$H$3$m$,$”$j$^$9!#$3$l$C$F!“e(BIPv4e$B$J%”%I%l%9I=5-$G$”$kI,MW$,e(B  
> e$B$"$k$N$G$7$g$&$+e(B?
> 
> localhoste$B$,e(B ::1 e$B$H$J$C$F!"$3$A$i$@$1e(Blistene$B$7$F$$$k\>uBV$G!"e(B127.0.0.1e$B$Ke(B  
> e$B@\B3$7$K9T$C$F$+$J$j$N%F%9%H$,e(Bfaile$B$7$F$$$k5$$,$7$^$9!#e(B

IPv4e$B$G$“$kI,MW$O$”$j$^$;$s$,!“e(B"localhost"e$B$@$H$^$:$$$G$9!#e(B  
e$B$H$$$&$N$O!”\>ZL@=q$KF~$C$F$$$kL\>A0e(B(localhost)e$B$H0c$&L\>A0$G%"%/%;%9$7$?;~$K!"e(B  
post\_connection\_checke$B$GNc30$,H/@8$9$k$3$H$r3NG’$9$k%F%9%H$@$+$i$G$9!#e(B  
e$B$$$?$@$$$?%Q%C%A$@$He(Btest\_imaps\_post\_connection\_checke$B$,e(BFe$B$K$J$C$F$7$^$&e(B  
e$B$H;W$$$^$9!#e(B

e$B0J2\<$N$h$&$Ke(BTCPServer.newe$B$NJ}$Ge(B"127.0.0.1"e$B$r;XDj$7$F$7$^$&$N$O$^$:$$e(B  
e$B$G$7$g$&$+!#e(B

diff --git a/test/net/imap/test\_imap.rb b/test/net/imap/test\_imap.rb  
index 0ecd3e8…dd9dac7 100644  
— a/test/net/imap/test\_imap.rb  
+++ b/test/net/imap/test\_imap.rb  
@@ -389,7 +389,7 @@ class IMAPTest \< Test::Unit::TestCase  
end

def starttls\_test

- server = TCPServer.new(0)

- server = TCPServer.new(“127.0.0.1”, 0)  
port = server.addr[1]  
Thread.start do  
begin

---

<div class="post-metadata">

**Author:** ![Takahiro\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/76d3ee/32.png) [@Takahiro\_K](https://www.ruby-forum.com/u/Takahiro_K)\
**Post date:** [May 9, 2010, 2:02am UTC](https://www.ruby-forum.com/t/test-net-imap-test-imap-rb/188139/3 "2010-05-09T02:02:27Z")

</div>

e$B$\*$O$h$&$4$6$$$^$9!#e(B

In message  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
on Sun, 9 May 2010 08:56:27 +0900,  
Shugo M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 2010e$BG/e(B5e$B7ne(B6e$BF|e(B20:46 Takahiro K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):  
> …
> 
> > localhoste$B$,e(B ::1 e$B$H$J$C$F!"$3$A$i$@$1e(Blistene$B$7$F$$$k\>uBV$G!"e(B127.0.0.1e$B$Ke(B  
> > e$B@\B3$7$K9T$C$F$+$J$j$N%F%9%H$,e(Bfaile$B$7$F$$$k5$$,$7$^$9!#e(B
> 
> IPv4e$B$G$“$kI,MW$O$”$j$^$;$s$,!“e(B"localhost"e$B$@$H$^$:$$$G$9!#e(B  
> e$B$H$$$&$N$O!”\>ZL@=q$KF~$C$F$$$kL\>A0e(B(localhost)e$B$H0c$&L\>A0$G%"%/%;%9$7$?;~$K!“e(B  
> post\_connection\_checke$B$GNc30$,H/@8$9$k$3$H$r3NG’$9$k%F%9%H$@$+$i$G$9!#e(B  
> e$B$$$?$@$$$?%Q%C%A$@$He(Btest\_imaps\_post\_connection\_checke$B$,e(BFe$B$K$J$C$F$7$^$&e(B  
> e$B$H;W$$$^$9!#e(B  
> e$B$J$k$[$I!”$=$&$$$&0U?^$N%F%9%H$G$7$?$+!#e(B

> e$B0J2\<$N$h$&$Ke(BTCPServer.newe$B$NJ}$Ge(B"127.0.0.1"e$B$r;XDj$7$F$7$^$&$N$O$^$:$$e(B  
> e$B$G$7$g$&$+!#e(B  
> e$B@$$NCfe(B IPv6  
> e$B$P$C$+$j$G!"e(BIPv4e$B$,M-8z$J%1!\<%9$,DA$7$$$H$$$&\>u67$K$J$k$^$Ge(B  
> e$B$ONI$$$N$G$O$J$$$G$7$g$&$+!#e(B:-)

"127.0.0.1"e$B$HD\>@;XDj$9$k$h$j$O2?$+Dj?t$KF~$l$F!"8e$G$NJQ99$r$7$d$9$/e(B  
e$B$7$F$\*$$$F$O$I$&$G$7$g$&e(B?

---

<div class="post-metadata">

**Author:** ![Takahiro\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/76d3ee/32.png) [@Takahiro\_K](https://www.ruby-forum.com/u/Takahiro_K)\
**Post date:** [May 9, 2010, 2:07am UTC](https://www.ruby-forum.com/t/test-net-imap-test-imap-rb/188139/4 "2010-05-09T02:07:43Z")

</div>

e$BA0ED$G$9!#e(B

2010e$BG/e(B5e$B7ne(B9e$BF|e(B9:01 Takahiro K.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> > e$B0J2\<$N$h$&$Ke(BTCPServer.newe$B$NJ}$Ge(B"127.0.0.1"e$B$r;XDj$7$F$7$^$&$N$O$^$:$$e(B  
> > e$B$G$7$g$&$+!#e(B  
> > e$B@$$NCfe(B IPv6 e$B$P$C$+$j$G!"e(BIPv4e$B$,M-8z$J%1!\<%9$,DA$7$$$H$$$&\>u67$K$J$k$^$Ge(B  
> > e$B$ONI$$$N$G$O$J$$$G$7$g$&$+!#e(B:-)
> 
> "127.0.0.1"e$B$HD\>@;XDj$9$k$h$j$O2?$+Dj?t$KF~$l$F!"8e$G$NJQ99$r$7$d$9$/e(B  
> e$B$7$F$\*$$$F$O$I$&$G$7$g$&e(B?

e$B$=$l$G$O$=$N$h$&$K=$@5$7$F$\*$-$^$9!#e(B
