550 relay not permitted , line 5

im trying to let my virtualmin sends and control all emails through external SMTP, i went to webmin configuartion-sending email and i fill up my SMTP info, when i try to send test message i get 550 relay not permitted , line 5.
note i have 2 websites, one that is working fine with my external SMTP and the other (wordpress) wp mail smtp plugin not working with SMTP
any idea? i tried different ports and different SMTP same thing…
and i followed this article but it did not fix my problem https://www.virtualmin.com/documentation/id%2Cmail_relaying_with_virtualmin

I use external SMTP in various scenarios. One is when a cloud server provider like Alibaba blocks port 25 for outgoing email, then Virtualmin must be configured to send all outgoing email through an external SMTP server. Another is when a cloud service provider like AWS does not offer RDNS (or makes you jump through hoops to get it - thanks @stom for your help :slightly_smiling_face: with this) then one has to configure Virtualmin to send out email for those domains which do email marketing through an external SMTP server.

The two options before you are that you use a smarthost (some other server) to send email for all domains hosted on your Virtualmin box or you use sender dependent relays to send email out via an external SMTP only for certain domains / email addresses that you host on your Virtualmin box. Using a smarthost is a one time configuration and will work forever for any virtual server you create on your Virtualmin box but will require the smarthost to ‘trust’ you by permitting all outgoing email traffic. Sender dependent relays will require editing config files every time you create a virtual server on your Virtualmin box and requires you to arrange for just an external SMTP account.

How would you like to proceed?

i still couldn’t fix it main.cf

readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
virtual_alias_maps = hash:/etc/postfix/virtual
sender_bcc_maps = hash:/etc/postfix/bcc
sender_dependent_default_transport_maps = hash:/etc/postfix/dependent
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
home_mailbox = Maildir/
broken_sasl_auth_clients = yes

mailbox_size_limit = 0
allow_percent_hack = no
milter_default_action = accept
milter_protocol = 2
smtpd_milters = inet:localhost:8891
non_smtpd_milters = inet:localhost:8891
smtpd_relay_restrictions = permit_sasl_authenticated permit_mx_backup permit_mynetworks

ignore_mx_lookup_error = yes
transport_maps = hash:/etc/postfix/transport

smtpd_sasl_auth_enable = yes

smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtpd_use_tls = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtpd_tls_security_level = may
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain, www.$mydomain, ftp.$mydomain
smtp_use_tls = yes
relayhost = mysmtp
smtp_sasl_auth_enable = yes

any help guys?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.