No external emails
Opened this issue · 7 comments
Hey,
I have a new install that is not receiving incoming emails.
[CRIT] [-] [core] TypeError: The header content contains invalid characters
[CRIT] [-] [core] at ClientRequest.OutgoingMessage.setHeader (http.js:733:13)
[CRIT] [-] [core] at new ClientRequest (http.js:1429:14)
[CRIT] [-] [core] at Object.exports.request (http.js:1899:10)
[CRIT] [-] [core] at Request.start (/usr/local/haraka/node_modules/request/index.js:603:30)
[CRIT] [-] [core] at Request.write (/usr/local/haraka/node_modules/request/index.js:1226:28)
[CRIT] [-] [core] at MessageStream.ondata (stream.js:51:26)
[CRIT] [-] [core] at MessageStream.emit (events.js:95:17)
[CRIT] [-] [core] at ChunkEmitter. (/usr/lib/node_modules/Haraka/messagestream.js:352:18)
[CRIT] [-] [core] at ChunkEmitter.emit (events.js:95:17)
[CRIT] [-] [core] at ChunkEmitter.end (/usr/lib/node_modules/Haraka/chunkemitter.js:92:14)
[NOTICE] [-] [core] Shutting down
Please advise.
I have same error. Anybody could resolve the issue?
Without diving deeper into the code. I got smtpin to work by pinning the node.js version.
In PEPS/smtpin/Dockerfile, I installed node using nvm and followed this post to select a node version:
http://stackoverflow.com/questions/25899912/install-nvm-in-docker
This version seems to work:
ENV NODE_VERSION 0.10.40
Would be kind to paste the contents of your PEPS/smtpin/Dockerfile file here? It will help newbies like me.
FROM phusion/baseimage:0.9.16
MAINTAINER MLstate <contact@mlstate.com>
ENV HOME /root
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 0.10.40
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN /etc/my_init.d/00_regen_ssh_host_keys.sh
RUN sed 's/main$/main universe/' -i /etc/apt/sources.list
RUN DEBIAN_FRONTEND=noninteractive apt-get -y -q update
RUN DEBIAN_FRONTEND=noninteractive apt-get -y -q install python-software-properties g++ make git curl
#RUN curl -sL https://deb.nodesource.com/setup | sudo bash -
#RUN apt-cache madison nodejs
#RUN DEBIAN_FRONTEND=noninteractive apt-get -y -q install nodejs
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash \
&& source $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/v$NODE_VERSION/bin:$PATH
#RUN DEBIAN_FRONTEND=noninteractive apt-get -y -q install nodejs:10212
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Mount /etc/peps for TLS certificates
VOLUME ["/etc/peps"]
# Install Haraka
RUN npm install -g Haraka
RUN haraka -i /usr/local/haraka
# Configure domain name
ADD ./domain /usr/local/haraka/config/host_list
# Configure plugins
ADD ./plugins/package.json /usr/local/haraka/package.json
ADD ./plugins/smtpin.js /usr/local/haraka/plugins/smtpin.js
# CHECK: required?
ADD ./config/smtp.ini /usr/local/haraka/config/
ADD ./config/plugins /usr/local/haraka/config/plugins
RUN cd /usr/local/haraka && npm install
# Create haraka runit service
RUN mkdir /etc/service/haraka
ADD haraka.sh /etc/service/haraka/run
EXPOSE 25
# TODO: key + dual port
# EXPOSE 587
# Start the init daemon - runit will launch the Haraka process
CMD ["/sbin/my_init"]
Thank you.
In the attached file, node version mentioned is
NODE_VERSION 0.10.40
Is this correct or a typo?
After modifiying the Dockerfile, all we need to do is,
$ make build
$ make start
Correct?
Thanks again for your inputs / help.
NODE_VERSION 0.10.40 is correct.
Yes that should work.
Guys, you might want to try my branch (while they review and merge my PRs). I fixed the inbound and outbount containers.
It's here: https://github.com/tiangolo/PEPS/tree/update-haraka-out
I'm using NodeJS official images as the base images (following Docker best practices) instead of the Phushion base image, so it should be less prone to errors now (and easier to debug).
If it works for you, it would be great if you can also report it in the PRs I created here so that they can merge the fixes: