Score:1

PostFix issue - trying to get MailHog to work

cv flag

So mysteriously my previously-working MailHog stopped working this morning on my Mac Mojave.

I have followed the steps in this post to get MailHog running: https://www.joshstauffer.com/send-test-emails-on-a-mac-with-mailhog/

Postfix log file output: (log stream --predicate '(process == "smtpd") || (process == "smtp")' --info) Postfix log file output

My /etc/hosts file contains an entry for: 127.0.0.1 localhost

Also when I do the following I get (not sure if it's related):

[12:26:22][~]#nslookup localhost  
Server:     192.168.0.1 
Address:    192.168.0.1#53

** server can't find localhost: NXDOMAIN

My last section (previous all unchanged) of etc/postfix/main.cf config file:

#inet_protocols = all
inet_protocols = ipv4
message_size_limit = 10485760
mailbox_size_limit = 0
biff = no
mynetworks = 127.0.0.0/8, [::1]/128
smtpd_client_restrictions = permit_mynetworks permit_sasl_authenticated permit
recipient_delimiter = +
tls_random_source = dev:/dev/urandom
smtpd_tls_ciphers = medium
inet_interfaces = loopback-only

# Adding this doesnt work:
#mydestination = localhost

# For MailHog
myhostname = localhost
relayhost = [localhost]:1025
compatibility_level = 2

Tried adding inet_protocols = ipv4 according to this post.

Any help much appreciated!

anx avatar
fr flag
anx
Show your `/etc/hosts` and Firewall settings. Address queries for `localhost.` [*should always* return](https://datatracker.ietf.org/doc/html/rfc6761#section-6.3) the IP loopback address.
Score:1
hr flag

By default Postfix only uses DNS to resolve names, bypassing any system resolving configuration (hosts file, ldap, etc). To use the native system resolving, set the following configuration option:

smtp_host_lookup=native

Or to fallback on the native option if the record is not found in DNS.

smtp_host_lookup=dns,native

Root DNS servers are not allowed to return any records for localhost because it's reserved. But depending on your on premise DNS solution or ISP you might still get a record for it though.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.