1

Synopsis:

4 separate servers:

one iRedMail server (new-domain.com)

one application (existing.com)

one node emailer (relay)

one node instance acting as an email password manager for iRedMail server

Situation:

All mail sent to and from new-domain.com via Thunderbird, Outlook or Roundcube works great.

mail sent from email password manager to new-domain.com (accounts that live there) through relay gets deferred and I cannot figure out why.

I have tried changing settings in main.cf, master.cf on the relayer

log entry from relay server:

tail -f /var/log/mail.log:

Dec 11 16:08:39 email postfix/smtp[24014]: 46430204C: to=<ric@new-domain.com>, relay=none, delay=30, delays=0.08/0.03/30/0, dsn=4.4.1, status=deferred (connect to new-domain.com[12.34.56.78]:25: Connection timed out

I have tried commenting

-o smtpd_relay_restrictions=permit_sasl_authenticated,reject

in /etc/postfix/master.cf on new-domain.com - to no avail

output of postconf -n on relayer server:

user@email:~ $ postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
compatibility_level = 2
inet_interfaces = all
inet_protocols = ipv4
mailbox_size_limit = 0
message_size_limit = 30428800
mydestination = email.new-domain.com, localhost.localdomain, , localhost
myhostname = email.dew-domain.com
mynetworks = 127.0.0.0/8 192.168.0.0/24
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Raspbian)
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated         defer_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database =     btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes

output of postconf -M on relayer:

    user@email:~# postconf -M
smtp       inet  n       -       y       -       -       smtpd
pickup     unix  n       -       y       60      1       pickup
cleanup    unix  n       -       y       -       0       cleanup
qmgr       unix  n       -       n       300     1       qmgr
tlsmgr     unix  -       -       y       1000?   1       tlsmgr
rewrite    unix  -       -       y       -       -       trivial-rewrite
bounce     unix  -       -       y       -       0       bounce
defer      unix  -       -       y       -       0       bounce
trace      unix  -       -       y       -       0       bounce
verify     unix  -       -       y       -       1       verify
flush      unix  n       -       y       1000?   0       flush
proxymap   unix  -       -       n       -       -       proxymap
proxywrite unix  -       -       n       -       1       proxymap
smtp       unix  -       -       y       -       -       smtp
relay      unix  -       -       y       -       -       smtp
showq      unix  n       -       y       -       -       showq
error      unix  -       -       y       -       -       error
retry      unix  -       -       y       -       -       error
discard    unix  -       -       y       -       -       discard
local      unix  -       n       n       -       -       local
virtual    unix  -       n       n       -       -       virtual
lmtp       unix  -       -       y       -       -       lmtp
anvil      unix  -       -       y       -       1       anvil
scache     unix  -       -       y       -       1       scache
maildrop   unix  -       n       n       -       -       pipe flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
uucp       unix  -       n       n       -       -       pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail     unix  -       n       n       -       -       pipe flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp      unix  -       n       n       -       -       pipe flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix - n       n       -       2       pipe flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman    unix  -       n       n       -       -       pipe flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user}

what should I try next?

All comments are highly appreciated.

UPDATE new log entry:

Dec 13 11:02:14 email postfix/error[31144]: warning: connect to private/defer: Connection refused
Dec 13 11:02:14 email postfix/error[31144]: warning: 050D72023: defer service failure
Dec 13 11:02:14 email postfix/error[31144]: 050D72023: to=<richard@new-domain.com>, relay=none, delay=256161, delays=256161/0.04/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to new-domain.com[12.34.56.78]:25: Connection timed out)
  • from mail.log on the iRedMail server: What does this mean? Dec 14 09:20:57 mail postfix/submission/smtpd[48428]: disconnect from unknown[192.168.0.20] ehlo=2 starttls=1 auth=1 mail=1 rcpt=0/1 commands=5/6 -- I have added that specific ip to mynetworks – richardwhitney Dec 14 '18 at 16:22
0

Solved: Turns out all I needed to do was send the mail from a known user on the iRedMail server and authenticate him on the emailer in nodemailer. for an example here is my code in nodemailer:

let transporter = nodemailer.createTransport({
    pool:true,
    host: 'mail.new-domain.com',
    port: 587,
    secureConnection: true,
    auth : {
        user : 'postmaster@new-domain.com',
        pass : 'password'
    },
    tls: {
        rejectUnauthorized: false,
    },
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.