Giter Site home page Giter Site logo

Comments (11)

falconmick avatar falconmick commented on August 17, 2024

Oh also not to clog up your issues inbox any more:

When I connect my Wordpress emailing functionality what settings do I use.

I opened the Dockerfile and saw 25 is exposed, so I assume I would connect to port 25, but how would I set the SMTP server address given I won't be exposing that port publicly? Is it just setup so that when I email smtp.awesomesite.com that the DNS setting I assume I made resolves to my box's IP, and then docker somhow knows that it can resolve it via the private docker network that isn't exposed? Or do I need to inject a hosts record with the IP of the relay box pointed at by smtp.awesomesite.com?

Cheers again!

from postfix-relay.

wader avatar wader commented on August 17, 2024

Hi!, for myhostname i don't think it is that important. But maybe good that it resolves to the source IP which will be used when connecting to other SMTP server when sending mail. What might be more important now a days is to setup SPF records for your domain.

For how to connect to the SMTP relay i would strongly suggest you use docker networks somehow. Simples is probably to use one docker-compose config that has both a wordpress and postfix-relay service as then docker-compose will create a "default" network between them so they can communicate. Then wordpress should be able to reach the SMTP relay using normal DNS. For example if you have "smtp" service then wordpress should be able to use "smtp" as hostname for it's SMTP server. See https://github.com/wader/postfix-relay#using-docker-compose

from postfix-relay.

falconmick avatar falconmick commented on August 17, 2024

Ok I've managed to get it going, now its just tinkerin with all the nobs to get out of that spam box!

This is the big issue I have currently (source: https://www.mail-tester.com/test-qhuyo):

We check if there is a server (A Record) behind your hostname hostname.
You may want to publish a DNS record (A type) for the hostname hostname or use a different hostname in your mail software.

you can also see the raw email:

Received: by mail-tester.com (Postfix, from userid 500)
	id 3AE9CA04BF; Thu, 29 Nov 2018 10:14:45 +0100 (CET)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail-tester.com
X-Spam-Level: ***
X-Spam-Status: No/3.0/5.0
X-Spam-Test-Scores: FSL_HELO_NON_FQDN_1=0.001,HTML_MESSAGE=0.001,
	HTML_MIME_NO_HTML_TAG=0.635,MIME_HTML_ONLY=1.105,
	RCVD_IN_SORBS_DUL=0.001,RDNS_NONE=1.274,SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001
X-Spam-Last-External-IP: 123.456.789.01
X-Spam-Last-External-HELO: hostname
X-Spam-Last-External-rDNS: 
X-Spam-Date-of-Scan: Thu, 29 Nov 2018 10:14:45 +0100
X-Spam-Report: 
	*  0.0 FSL_HELO_NON_FQDN_1 No description available.
	*  0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was
	*      blocked.  See
	*      http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
	*      for more information.
	*      [URIs: sendingemailfromhere.com.au]
	*  0.0 RCVD_IN_SORBS_DUL RBL: SORBS: sent directly from dynamic IP
	*      address
	*      [123.456.789.01 listed in dnsbl.sorbs.net]
	* -0.0 SPF_PASS SPF: sender matches SPF record
	*  1.1 MIME_HTML_ONLY BODY: Message only has text/html MIME parts
	*  0.0 HTML_MESSAGE BODY: HTML included in message
	*  0.6 HTML_MIME_NO_HTML_TAG HTML-only message, but there is no HTML
	*      tag
	*  1.3 RDNS_NONE Delivered to internal network by a host with no rDNS
Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=123.456.789.01; helo=hostname; [email protected]; [email protected] 
DMARC-Filter: OpenDMARC Filter v1.3.1 mail-tester.com 81C199FE8B
Authentication-Results: mail-tester.com; dmarc=none header.from=sendingemailfromhere.com.au
Received: from hostname (unknown [123.456.789.01])
	(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mail-tester.com (Postfix) with ESMTPS id 81C199FE8B
	for <[email protected]>; Thu, 29 Nov 2018 10:14:43 +0100 (CET)
Received: from wp.sendingemailfromhere.com.au (projectname-wordpress.projectname_default [172.21.0.5])
	by hostname (Postfix) with ESMTP id 548CA23C585
	for <[email protected]>; Thu, 29 Nov 2018 09:14:41 +0000 (UTC)
Date: Thu, 29 Nov 2018 09:14:41 +0000
To: [email protected]
From: WordPress <[email protected]>
Subject: Test email from https://wp.sendingemailfromhere.com.au
Message-ID: <[email protected]>
X-Mailer: PHPMailer 5.2.22 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
MIME-Version: 1.0
Content-Type: text/html; charset=iso-8859-1

This test email proves that your WordPress installation at https://wp.sendingemailfromhere.com.au can send emails.\n\nSent: Thu, 29 Nov 2018 09:14:41 +0000

it looks like my helo is sending hostname not sendingemailfromhere.com.au

Here is my docker-compose config

  smtp:
    image: mwader/postfix-relay
    restart: always
    container_name: projectname-smtp
    environment:
      - POSTFIX_sendingemailfromhere.com.au=smtp.sendingemailfromhere.com.au
    expose:
      - "25"

Any idea on how to make the helo send sendingemailfromhere.com.au or smtp.sendingemailfromhere.com.au, which ever it's supposed to?

from postfix-relay.

wader avatar wader commented on August 17, 2024

I think POSTFIX_myhostname=smtp.sendingemailfromhere.com.au should solve that. I'm quite sure it is what postfix will use at HELO.

You can probably skip expose 25 as it's already define by the Dockefile and i think expose is only needed if you use links (which you probably don't need if you use DNS instead)

from postfix-relay.

falconmick avatar falconmick commented on August 17, 2024

@wader The confusion I am experiencing is that the HELO is sending hostname as it's host name not sendingemailfromhere.com.au OR smtp.sendingemailfromhere.com.au

I'm not even 100% sure what it should be.

I will do some digging into postfix and how HELO works, if I find more info I will get back to you, or if you figure something out let me know.

from postfix-relay.

wader avatar wader commented on August 17, 2024

I just noticed POSTFIX_sendingemailfromhere.com.au=smtp.sendingemailfromhere.com.au in your example. Just to be clear, postfix has a config option named ”myhostname” so you should not expand it as a variable etc.

from postfix-relay.

falconmick avatar falconmick commented on August 17, 2024

from postfix-relay.

wader avatar wader commented on August 17, 2024

Aha good 👍 yeah that option is named a bit weirdly. So hostname works now?

from postfix-relay.

falconmick avatar falconmick commented on August 17, 2024

from postfix-relay.

wader avatar wader commented on August 17, 2024

Can close?

I did a change to make this more clear 840a28d Thanks for bringing this up!

from postfix-relay.

falconmick avatar falconmick commented on August 17, 2024

from postfix-relay.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.