Can't send via VPN

38 views
Skip to first unread message

Sascha K. Manns

unread,
Oct 18, 2016, 8:16:23 AM10/18/16
to Ponyrb
Hello List,

i've found out an interesting thing.

I'm using:

Pony.mail({
                    :to => emailaddress,
                    :bcc => own_email_address,
                    :from => own_email_address,
                    :subject => subject,
                    :body => body,
                    :attachments => {'Bewerbungsunterlagen_Manns.pdf' => File.read(filename)},
                    :via => :smtp,
                    :via_options => {
                        :address => own_smtp,
                        :port => '587', # default: 25
                        :user_name => own_username,
                        :password => own_password,
                        :authentication => :plain, # :plain, :login, :cram_md5, no auth by default
                        :domain => 'localhost.localdomain', # the HELO domain provided by the client to the server
                    }
                })
    end

Then i'm using a VPN (aitvpn). But if i'm sending i'm get:

Non US-ASCII detected and no charset defined.
Defaulting to UTF-8, set your own if this is incorrect.
/home/sascha/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/smtp.rb:541:in `initialize': getaddrinfo: Name or service not known (SocketError)
        from /home/sascha/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/smtp.rb:541:in `open'
        from /home/sascha/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/smtp.rb:541:in `tcp_socket'
        from /home/sascha/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/smtp.rb:551:in `block in do_start'
        from /home/sascha/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/timeout.rb:88:in `block in timeout'
        from /home/sascha/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/timeout.rb:98:in `call'
        from /home/sascha/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/timeout.rb:98:in `timeout'
        from /home/sascha/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/smtp.rb:550:in `do_start'
        from /home/sascha/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/smtp.rb:520:in `start'
        from /home/sascha/.rvm/gems/ruby-2.2.3/gems/mail-2.6.4/lib/mail/network/delivery_methods/smtp.rb:113:in `deliver!'
        from /home/sascha/.rvm/gems/ruby-2.2.3/gems/mail-2.6.4/lib/mail/message.rb:253:in `deliver!'
        from /home/sascha/.rvm/gems/ruby-2.2.3/gems/pony-1.11/lib/pony.rb:176:in `deliver'
        from /home/sascha/.rvm/gems/ruby-2.2.3/gems/pony-1.11/lib/pony.rb:166:in `mail'
        from /home/sascha/.rvm/gems/ruby-2.2.3/gems/latex_curriculum_vitae-1.3.0/lib/latex_curriculum_vitae/email.rb:33:in `create_email'
        from /home/sascha/.rvm/gems/ruby-2.2.3/gems/latex_curriculum_vitae-1.3.0/lib/latex_curriculum_vitae/email.rb:161:in `resultok'
        from /home/sascha/.rvm/gems/ruby-2.2.3/gems/latex_curriculum_vitae-1.3.0/lib/latex_curriculum_vitae.rb:85:in `<module:LatexCurriculumVitae>'
        from /home/sascha/.rvm/gems/ruby-2.2.3/gems/latex_curriculum_vitae-1.3.0/lib/latex_curriculum_vitae.rb:24:in `<top (required)>'
        from /home/sascha/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:68:in `require'
        from /home/sascha/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:68:in `require'
        from /home/sascha/.rvm/gems/ruby-2.2.3/gems/latex_curriculum_vitae-1.3.0/bin/latexcv.rb:7:in `<top (required)>'
        from /home/sascha/.rvm/gems/ruby-2.2.3/bin/latexcv.rb:22:in `load'
        from /home/sascha/.rvm/gems/ruby-2.2.3/bin/latexcv.rb:22:in `<main>'
        from /home/sascha/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval'
        from /home/sascha/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `<main>

Maybe anyone has ideas why?

Greetings
Sascha

Ben Prew

unread,
Oct 18, 2016, 11:25:07 AM10/18/16
to pon...@googlegroups.com

Sascha,

Thanks for using Pony. The error you're seeing (Name or service not known (SocketError)) means that it can't resolve the hostname of the SMTP server.  You could try using the IP address instead. Perhaps your vpn isn't setting the correct DNS servers, what OS are you running?

- b...@throwingbones.com


--

---
You received this message because you are subscribed to the Google Groups "Ponyrb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ponyrb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sascha K. Manns

unread,
Oct 18, 2016, 12:59:31 PM10/18/16
to Ponyrb
Hi Ben,

thanks for answering. I'm using it on Ubuntu 16.10.

I found out that the Name or service unknown issue is gone after disabling VPN. Actually it gives me that issue:

/home/sascha/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/smtp.rb:541:in `initialize': getaddrinfo: Servname not supported for ai_socktype (SocketError)

I'm trying to resolve the server "smtp.mailbox.org" on Port 587. It's the prefered connection provided by the server.
To unsubscribe from this group and stop receiving emails from it, send an email to ponyrb+un...@googlegroups.com.

Ben Prew

unread,
Oct 18, 2016, 4:24:09 PM10/18/16
to pon...@googlegroups.com

Possibly an Ubuntu configuration issue?

http://askubuntu.com/questions/742613/network-aplications-throwing-servname-not-supported-for-ai-socktype

- b...@throwingbones.com


To unsubscribe from this group and stop receiving emails from it, send an email to ponyrb+unsubscribe@googlegroups.com.

Sascha K. Manns

unread,
Oct 20, 2016, 9:36:30 AM10/20/16
to Ponyrb


Am Dienstag, 18. Oktober 2016 22:24:09 UTC+2 schrieb Ben Prew:

Possibly an Ubuntu configuration issue?

http://askubuntu.com/questions/742613/network-aplications-throwing-servname-not-supported-for-ai-socktype

- b...@throwingbones.com


Thanks for the try. But that doesn't fix it.
Do you think that the issue is a bug on my machine? If yes, i can give a Ubuntu list a try. Or what do you think?

Greetings Sascha

 

Ben Prew

unread,
Oct 20, 2016, 4:39:30 PM10/20/16
to pon...@googlegroups.com
Sascha,

Looking back at your example, try setting the port as an interger, not
as a string. Ie 587 instead of '587'. That might be the problem.

Thanks


On Thu, Oct 20, 2016 at 6:36 AM, 'Sascha K. Manns' via Ponyrb

Sascha K. Manns

unread,
Oct 21, 2016, 10:02:53 AM10/21/16
to Ponyrb
Hi Ben,

i tried it out. But sadly that doesn't work too.

Greetings
Sascha

Sascha K. Manns

unread,
Oct 22, 2016, 7:49:13 AM10/22/16
to Ponyrb
Hi Ben,

good news. Adding a "require 'resolv-replace.rb'" on the top of my module does the magic. Also it allows to use a VPN with Pony.

Greetings
Sascha

Ben Prew

unread,
Oct 22, 2016, 12:30:31 PM10/22/16
to pon...@googlegroups.com

Sascha,

That's great! Glad it's working and thanks for following up.

- b...@throwingbones.com


--

---
You received this message because you are subscribed to the Google Groups "Ponyrb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ponyrb+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages