Welcome to the mailbox.org user forum!
 

How to configure postfix to use mailbox.org smtp

7514468 shared this idea 21 days ago
Proposed

Hi,


I am trying to setup postfix to send emails using mailbox.org smtps for my homelab.

But I get errors:

Mar  3 11:26:06 zoidberg postfix/pickup[16704]: 916CF80CBA: uid=0 from=<root>
Mar  3 11:26:06 zoidberg postfix/cleanup[16710]: 916CF80CBA: message-id=<20230303102606.916CF80CBA@mydomain.tld>
Mar  3 11:26:06 zoidberg postfix/qmgr[16705]: 916CF80CBA: from=<root@mydomain.tld>, size=473, nrcpt=1 (queue active)
Mar  3 11:26:06 zoidberg postfix/smtp[16712]: 916CF80CBA: to=<to@tomain.tld>, relay=smtp.mailbox.org[185.97.174.196]:587, delay=0.2, delays=0.01/0/0.17/0.03, dsn=5.7.1, status=bounced (host smtp.mailbox.org[185.97.174.196] said: 554 5.7.1 <ip5b40601my.ISP[my.ip.address]:46572>: Client host rejected: Access denied (in reply to RCPT TO command))
Mar  3 11:26:06 zoidberg postfix/cleanup[16710]: C5D1D80CE0: message-id=<20230303102606.C5D1D80CE0@mydomain.tld>
Mar  3 11:26:06 zoidberg postfix/bounce[16714]: 916CF80CBA: sender non-delivery notification: C5D1D80CE0
Mar  3 11:26:06 zoidberg postfix/qmgr[16705]: C5D1D80CE0: from=<>, size=2669, nrcpt=1 (queue active)
Mar  3 11:26:06 zoidberg postfix/qmgr[16705]: 916CF80CBA: removed
Mar  3 11:26:06 zoidberg postfix/pickup[16704]: C962D80CBA: uid=65534 from=<from@domain.tld>
Mar  3 11:26:06 zoidberg postfix/cleanup[16710]: C962D80CBA: message-id=<20230303102606.C5D1D80CE0@mydomain.tld>
Mar  3 11:26:06 zoidberg postfix/local[16715]: C5D1D80CE0: to=<root@mydomain.tld>, relay=local, delay=0.02, delays=0/0/0/0.01, dsn=2.0.0, status=sent (delivered to command: /usr/bin/proxmox-mail-forward)
Mar  3 11:26:06 zoidberg postfix/qmgr[16705]: C5D1D80CE0: removed
Mar  3 11:26:06 zoidberg postfix/qmgr[16705]: C962D80CBA: from=<from@domain.tld>, size=2871, nrcpt=1 (queue active)
Mar  3 11:26:07 zoidberg postfix/smtp[16712]: C962D80CBA: to=<to@domain.tld>, relay=smtp.mailbox.org[185.97.174.196]:587, delay=0.18, delays=0/0/0.15/0.03, dsn=5.7.1, status=bounced (host smtp.mailbox.org[185.97.174.196] said: 554 5.7.1 <ip5b40601my.ISP[my.ip.address]:46584>: Client host rejected: Access denied (in reply to RCPT TO command))
Mar  3 11:26:07 zoidberg postfix/qmgr[16705]: C962D80CBA: removed
Mar  3 11:26:07 zoidberg postfix/cleanup[16710]: 0483780CE0: message-id=<20230303102607.0483780CE0@mydomain.tld>

here is my configuration:


relayhost = smtp.mailbox.org:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options =
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_CAfile = /etc/ssl/certs/Entrust_Root_Certification_Authority.pem
smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_tls_session_cache
smtp_tls_session_cache_timeout = 3600s
inet_protocols = ipv4

smtp_header_checks = pcre:/etc/postfix/smtp_header_checks

Any help would be much appreciated.

thank you !

Replies (2)

photo
1

Hi,

I am facing the exact same issue. I'd like to configure my hosts to send status notifications. My config is similar to yours:

```

smtp_header_checks = pcre:/etc/postfix/smtp_header_checks
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
relayhost = [smtp.mailbox.org]:587
smtp_fallback_relay = [smtp.mailbox.org]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/relay_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_mechanism_filter = plain
smtp_use_tls = yes

```

cat smtp_header_checks

```

/^From:.*/ REPLACE From: relay-noreply <relay-username@mailbox.org>

```

cat relay_passwd

```

smtp.mailbox.org:587 relay-user@mailbox.org:RelayUsersPassword

```

photo
1

Hi 6022710,

I managed to make it work, here's the config:

/etc/postfix/main.cf

# See /usr/share/postfix/main.cf.dist for a commented, m>


# Debian specific:  Specifying a file name will cause th>
# line of that file to be used as the name.  The Debian >
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" war>
#delay_warning_time = 4h

readme_directory = no

# See http://www.postfix.org/COMPATIBILITY_README.html ->
# fresh installs.
compatibility_level = 2

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_security_level=may

smtp_tls_CApath=/etc/ssl/certs
smtp_tls_security_level=encrypt
smtp_tls_session_cache_database = btree:${data_directory>


smtpd_relay_restrictions = permit_mynetworks permit_sasl>
myhostname = pve.domain.tld
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = pve.domain.tld, localhost.domain.tld>
#relayhost = 
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all


relayhost = [smtp.mailbox.org]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

smtp_header_checks = pcre:/etc/postfix/smtp_header_checks

/etc/postfix/sasl_passwd

[smtp.mailbox.org]:587 youremail@mailbox.org:password


/etc/postfix/smtp_header_checks

/^From:.*/ REPLACE From: "pve-alert" <pve@domain.tld>

And everything gets sent properly !

Leave a Comment
 
Attach a file