How reply email is working with Outlook


(sepideh Javdani) #1

Hi,
We followed instruction to enable pop3 for reply on emails but we got errror when “pop3 polling enabled”

Poll via POP3 for email replies.
Sorry, an error has occurred.

2 Errno::ECONNREFUSED (Connection refused - connect(2) for “seliiuapp00324-app” port 995) /usr/local/lib/ruby/2.4.0/net/pop.rb:545:in `initialize’
3 SocketError (getaddrinfo: Name or service not known) /usr/local/lib/ruby/2.4.0/net/pop.rb:545:in `initialize’

Any idea?

Thanks,
Sepideh


(Jay Pfaffman) #2

Discourse cannot connect to port 995 on whatever mail server you told it to connect to. Unless you have some reason not to, I’d recommend Straightforward direct-delivery incoming mail.


(sepideh Javdani) #3

Also we tried with port 110 same error.


(Jay Pfaffman) #4

Can you

telnet  popserver 110

or

telnet  popserver 995

from the Discourse server? Do you have a really good reason not to use the solution that I suggested?


(sepideh Javdani) #5

root@seliiuapp00324:/var/discourse/containers# telnet popserver 110
telnet: could not resolve popserver/110: Name or service not known
root@seliiuapp00324:/var/discourse/containers# docker exec -it $container bash
root@seliiuapp00324-app:/# telnet popserver 110
bash: telnet: command not found
root@seliiuapp00324-app:/#


(sepideh Javdani) #6

root@seliiuapp00324:/var/discourse/containers# telnet popserver 995
telnet: could not resolve popserver/995: Name or service not known
root@seliiuapp00324:/var/discourse/containers#


(Jay Pfaffman) #7

You would need to replace “popserver” with the actual server that you are trying to connect to. Discourse is unable to connect to whatever it is you told it to connect to.

The OP says seliiuapp00324-app if that’s what you told Discourse to connect to, that’s your problem.

Do you know the domain name of the POP server that you’re connecting to?


(sepideh Javdani) #8

root@seliiuapp00324:/var/discourse/containers# telnet seliiuapp00324 110
Trying 150.132.34.206…
Connected to seliiuapp00324.lmera.ericsson.se.
Escape character is ‘^]’.
+OK Dovecot ready.


(sepideh Javdani) #9

root@seliiuapp00324:/var/discourse/containers# telnet seliiuapp00324 995
Trying 150.132.34.206…
telnet: Unable to connect to remote host: Connection refused
root@seliiuapp00324:/var/discourse/containers#


(Jay Pfaffman) #10

So it appears that this one is connecting, so that leaves you at username/password issues. You might try entering that information into Discourse.


(sepideh Javdani) #11

ok I checked link which you sent I got error, do you have any idea?

root@seliiuapp00324:/var/discourse# ./launcher bootstrap mail-receiver
cd /pups && /pups/bin/pups --stdin
sha256:b0be9e9ea1b299d5acef21adcf37a6df11af8496194bfacba1bc947fbe6af4d7
6d9a7a5d86e091277dca47bb62a11864cd8e603046688a3f948dbe9dc03e2a2e
Successfully bootstrapped, to startup use ./launcher start mail-receiver
root@seliiuapp00324:/var/discourse# ./launcher start mail-receiver

starting up existing container

  • /usr/bin/docker start mail-receiver
    Error response from daemon: driver failed programming external connectivity on endpoint mail-receiver (2e478dd04337a74927551b9b137f6b215ad561851529ea797fc341238aedc5bf): Error starting userland proxy: listen tcp 0.0.0.0:25: bind: address already in use
    Error: failed to start containers: mail-receiver
    root@seliiuapp00324:/var/discourse# ./launcher logs mail-receiver
    root@seliiuapp00324:/var/discourse#

#12

what kind of email server are you running internally?

at my workplace I just talked the Exchange administrators into setting up a mail forwarding rule for anything@discourse.internaldomain.com (the fully qualified dns name of my discourse server)

It made it really easy to understand for my users when an email is discourse-related, and all I had to do was to set reply_by_email_address to %{reply_key}@discourse.internaldomain.com

you can find what has already taken port 25 on your server with something like this:

# netstat -anp|grep :25
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1312/master
tcp6       0      0 ::1:25                  :::*                    LISTEN      1312/master

# ps -ef|grep 1312
root      1312     1  0 Apr27 ?        00:00:59 /usr/libexec/postfix/master -w

Most linux distributions come with an included SMTP server that has to be disabled before discourse can use the standard ports for mail. As long as it is a dedicated server for your forum the system mailer is most likely not used for anything.


(sepideh Javdani) #13

Thanks, I modified master.cf and problem solved I am able to start mail reciver

root@seliiuapp00324:/var/discourse# vim /etc/postfix/master.cf
root@seliiuapp00324:/var/discourse# service postfix restart
root@seliiuapp00324:/var/discourse# ./launcher start mail-receiver

starting up existing container

  • /usr/bin/docker start mail-receiver
    mail-receiver
    root@seliiuapp00324:/var/discourse# netstat -anp|grep :25
    tcp6 0 0 :::25 :::* LISTEN 19309/docker-proxy
    udp6 0 0 fe80::250:56ff:fe94:123 :::* 2117/ntpd
    root@seliiuapp00324:/var/discourse# ./launcher logs mail-receiver
    Operating environment:
    HOSTNAME=seliiuapp00324-mail-receiver
    GEM_HOME=/usr/local/bundle
    TERM=xterm
    BUNDLE_SILENCE_ROOT_WARNING=1
    BUNDLE_APP_CONFIG=/usr/local/bundle
    PATH=/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    RUBY_DOWNLOAD_SHA256=341cd9032e9fd17c452ed8562a8d43f7e45bfe05e411d0d7d627751dd82c578c
    DOCKER_HOST_IP=172.17.0.1
    PWD=/
    DISCOURSE_API_USERNAME=system
    LANG=en_US.UTF-8
    RUBY_MAJOR=2.3
    RUBYGEMS_VERSION=2.6.11
    BUNDLE_BIN=/usr/local/bundle/bin
    SHLVL=1
    HOME=/root
    DISCOURSE_MAIL_ENDPOINT=http://discourse-staging.lmera.ericsson.se/admin/email/handle_mail
    DISCOURSE_API_KEY=cae98354db9659b286c988fcd24fe8f6bab80fcb23920b5aabce7509321cde8d
    BUNDLE_PATH=/usr/local/bundle
    MAIL_DOMAIN=discourse-staging.lmera.ericsson.se
    RUBY_VERSION=2.3.4
    BUNDLER_VERSION=1.14.6
    _=/usr/bin/env
    Delivering mail sent to discourse-staging.lmera.ericsson.se to Discourse
    Starting Postfix
    <22>Jun 5 18:52:13 postfix/master[1]: daemon started – version 3.1.1, configuration /etc/postfix
    root@seliiuapp00324:/var/discourse# ./launcher logs mail-receiver | grep receive-mail
    root@seliiuapp00324:/var/discourse# mailq
    -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
    E76886E0C33 758 Tue Jun 5 19:18:14 biit360usr@seliiuapp00324.lmera.ericsson.se
    (mail transport unavailable)
    biit360usr@seliiuapp00324.lmera.ericsson.se

– 0 Kbytes in 1 Request.
root@seliiuapp00324:/var/discourse# date
Tue Jun 5 21:28:14 CEST 2018
root@seliiuapp00324:/var/discourse#


(sepideh Javdani) #14

I am able to receive email from topic on my outlook but not able to reply by email. Do you have any idea?