1

I have my Postfix server. I can send email via it with no problem using Thunderbird. For smtp I have:

port - 587
Normal Password
STARTTLS

However, I can't send an email through the same server via my own app. The settings are these:

server: "mail.my_server.com",
username: "aaa@my_domain123.com",
password: "fdsafdsafdsfds"",
port: 587,
allowed_tls_versions: [:"tlsv1", :"tlsv1.1", :"tlsv1.2"],
retries: 5,
auth: :if_available

// tls: :always,
// ssl: true,
// no_mx_lookups: false, # can be `true`
// auth: :always,

I have an exception:

450 4.7.1 Client host rejected: cannot find your reverse hostname: 11.22.33.44

Where 11.22.33.44 is my external IP of my home computer

How can I be able to send email from home computer via Thunderbird, but not my own app running on the same home computer, using the same server and presumably - settings?

Poddiri
  • 11
  • 1
  • Please post the output of `postconf -n`. – Michael Hampton Jul 11 '18 at 14:11
  • Are you sure the authentication works? I *suspect* the server is configured to allow any client that is authenticated, despite not having reverse DNS. So if you are rejected because of not having reverse DNS, the implication is that you're not authenticated. – Halfgaar Jul 11 '18 at 14:38
  • @Halfgaar I've played with the settings futher. Now I have: `SASL LOGIN authentication failed: UGFzc3dvcmQ6` and `SASL PLAIN authentication failed: UGFzc3dvcmQ6 ` --> and this is different from I have of Thunderbird `sasl_method=PLAIN, sasl_username=aaa@my_domain123.com`. why? Note that `UGFzc3dvcmQ6` isn't my pass, but something else – Poddiri Jul 11 '18 at 15:16
  • Can you post a (redacted) screenshot of your Thunderbird SMTP auth settings, and some more code of your app that shows sending of the actual mail? – Halfgaar Jul 12 '18 at 07:45

1 Answers1

0

I'm going to bet this is due to your app sending something like localhost or localhost.localdomain in the EHLO, or not sending an EHLO at all. Thunderbird is most likely sending a more appropriate value.

Can you please post the output from /var/log/maillog for both when you attempt to send mail from your application, and then when you send mail from Thunderbird?

A quick solution may be to remove reject_unknown_helo_hostname directive from the smtpd_helo_restrictions configuration. A more secure and probably just as quick solution would be to configure mynetworks and then use the permit_mynetworks directive of the smtpd_helo_restrictions configuration.