I’m trying to get email working and could use some help from someone smarter than me.
Here’s the error:
[tankie.tube:443] 2024-03-13 16:45:09.217 error: connect ECONNREFUSED ::1:587 {
"component": "smtp-connection",
"sid": "nfxW2nyW934"
}
[tankie.tube:443] 2024-03-13 16:45:09.230 error: Failed to connect to SMTP localhost:587. {
"err": {
"stack": "Error: connect ECONNREFUSED ::1:587\n at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1605:16)",
"message": "connect ECONNREFUSED ::1:587",
"errno": -111,
"code": "ESOCKET",
"syscall": "connect",
"address": "::1",
"port": 587,
"command": "CONN"
}
}
config/production.yaml:
smtp:
transport: smtp
sendmail: null
hostname: localhost
port: 587
username: 'noreply'
password: ${password_of_the_noreply_user}
tls: false
disable_starttls: true
from_address: 'noreply@tankie.tube'
I’m using postfix as my mail transfer agent.
/etc/postfix/main.cf:
alias_database = $alias_maps
alias_maps = hash:/etc/postfix/aliases
command_directory = /usr/bin
compatibility_level = 3.8
daemon_directory = /usr/lib/postfix/bin
data_directory = /var/lib/postfix
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
debug_peer_level = 2
html_directory = no
inet_interfaces = loopback-only
inet_protocols = ipv4
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
meta_directory = /etc/postfix
milter_default_action = accept
mydomain = tankie.tube
myhostname = tankie.tube
myorigin = tankie.tube
newaliases_path = /usr/bin/newaliases
non_smtpd_milters = $smtpd_milters
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix
sample_directory = /etc/postfix
sendmail_path = /usr/bin/sendmail
setgid_group = postdrop
shlib_directory = /usr/lib/postfix
smtpd_milters = inet:localhost:8891
unknown_local_recipient_reject_code = 550
/etc/postfix/master.cf:
anvil unix - - n - 1 anvil
bounce unix - - n - 0 bounce
cleanup unix n - n - 0 cleanup
defer unix - - n - 0 bounce
discard unix - - n - - discard
error unix - - n - - error
flush unix n - n 1000? 0 flush
lmtp unix - - n - - lmtp
local unix - n n - - local
pickup unix n - n 60 1 pickup
postlog unix-dgram n - n - 1 postlogd
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
qmgr unix n - n 300 1 qmgr
relay unix - - n - - smtp
-o syslog_name=postfix/$service_name
retry unix - - n - - error
rewrite unix - - n - - trivial-rewrite
scache unix - - n - 1 scache
showq unix n - n - - showq
smtp inet n - n - - smtpd
smtp unix - - n - - smtp
127.0.0.1:submissions inet n - n - - smtpd
tlsmgr unix - - n 1000? 1 tlsmgr
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
virtual unix - n n - - virtual