SENT: 530 SMTP authentication is required to external receipient

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
itsmesri
Normal user
Normal user
Posts: 59
Joined: 2014-11-07 08:30

SENT: 530 SMTP authentication is required to external receipient

Post by itsmesri » 2016-01-17 09:49

I am trying to send email to external recipient using my hMail Server email address. I have written code in c#. Code also deployed IIS website where same server hmail server exists. So code and email server on the same server.

If I send to my hmailserver domain (I mean my domain) it works. Only if I am trying to send email external id using my smtp server. it is not working.
"SMTPD" 2956 5864 "2016-01-17 01:29:04.698" "192.168.1.254" "SENT: 220 Welcome message from SMTP"
"SMTPD" 2428 5864 "2016-01-17 01:29:04.700" "192.168.1.254" "RECEIVED: EHLO COWBOYS"
"SMTPD" 2428 5864 "2016-01-17 01:29:04.701" "192.168.1.254" "SENT: 250-[nl]250-SIZE 20480000[nl]250-AUTH LOGIN[nl]250 HELP"
"SMTPD" 2468 5864 "2016-01-17 01:29:04.703" "192.168.1.254" "RECEIVED: MAIL FROM:<fromemail@gmail.com>"
"SMTPD" 2468 5864 "2016-01-17 01:29:04.710" "192.168.1.254" "SENT: 250 OK"
"SMTPD" 2956 5864 "2016-01-17 01:29:04.712" "192.168.1.254" "RECEIVED: RCPT TO:<externalrecipient@externalrecipientdomain.com>"
"SMTPD" 2956 5864 "2016-01-17 01:29:04.713" "192.168.1.254" "SENT: 530 SMTP authentication is required."

Code: Select all

    SmtpClient client = new SmtpClient();
                //client.Send(oMail);
                client.Send(fromEmailId, toEmailId, subject, message);

Code: Select all

 <system.net>
        <mailSettings>
            <smtp>
                <network host="smtp.myhmaildomail.com" userName="info@myhmaildomain.com" password="password@123"  port="25" />
            </smtp>
        </mailSettings>
    </system.net>

User avatar
mattg
Moderator
Moderator
Posts: 21192
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: SENT: 530 SMTP authentication is required to external receipient

Post by mattg » 2016-01-17 11:20

You are sending FROM a gmail address

hMailsevrer correctly sees that as an external address, and so this is external to external

As the script is one the same server, you can change the IP range setting for localhost to allow external to external without SMTP auth.
Be aware that any hostile script on your machine (ie a Trojan) can then do the same.

Better if your code can authenticate with a local account, and send from a local domain, not gmail.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
jimimaseye
Moderator
Moderator
Posts: 8854
Joined: 2011-09-08 17:48

Re: SENT: 530 SMTP authentication is required to external receipient

Post by jimimaseye » 2016-01-17 11:27

also... unless you you are using GMail relays then you are likely to have problems (being seen as spam) anyway as sending from=@gmail from your own server will fail the gmail SPF and DKIM tests set by gmail.
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

itsmesri
Normal user
Normal user
Posts: 59
Joined: 2014-11-07 08:30

Re: SENT: 530 SMTP authentication is required to external receipient

Post by itsmesri » 2016-01-17 19:27

I have already selected ip range for my ipaddress. Still it is not sending email see my settings

Image

User avatar
jimimaseye
Moderator
Moderator
Posts: 8854
Joined: 2011-09-08 17:48

Re: SENT: 530 SMTP authentication is required to external receipient

Post by jimimaseye » 2016-01-17 19:42

I dont see a problem with misbehaviour. You have EXTERNAL TO EXTERNAL REQUIRES AUTHENTICATION set and your log shows
quote]"SMTPD" 2956 5864 "2016-01-17 01:29:04.712" "192.168.1.254" "RECEIVED: RCPT TO:<externalrecipient@externalrecipientdomain.com>""SMTPD" 2956 5864 "2016-01-17 01:29:04.713" "192.168.1.254" "SENT: 530 SMTP authentication is required."[/quote]

So it is working as configured. You need to tell your script to authenticate.

That is, of course, assuming that that screen shot is for for the IP RANGE incorporating 192.168.1.254. But we cant tell because for some reason you have blanked it out! (What's the point of a screenshot if you are going to blank out the important bits?)
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

itsmesri
Normal user
Normal user
Posts: 59
Joined: 2014-11-07 08:30

Re: SENT: 530 SMTP authentication is required to external receipient

Post by itsmesri » 2016-01-17 20:31

It is not IP RANGE incorporating 192.168.1.254. It is External IP of router. I also have other IP rangers like "My Computer" LIP 127.0.0.1 to UIP 127.0.0.1 and "Internet" LIP 0.0.0.0 to UIP 255.255.255.255.

Do you want me to specify IP RANGE 192.168.1.254?

itsmesri
Normal user
Normal user
Posts: 59
Joined: 2014-11-07 08:30

Re: SENT: 530 SMTP authentication is required to external receipient

Post by itsmesri » 2016-01-17 20:36

I added IP RANGE for 192.168.1.254. Still I am getting same error.

Image

User avatar
jimimaseye
Moderator
Moderator
Posts: 8854
Joined: 2011-09-08 17:48

Re: SENT: 530 SMTP authentication is required to external receipient

Post by jimimaseye » 2016-01-17 22:25

Have you set your script to authenticate?? Have you set the IP RANGE to NOT authenticate for EXTERNAL to EXTERNAL? One or the other....
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

User avatar
mattg
Moderator
Moderator
Posts: 21192
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: SENT: 530 SMTP authentication is required to external receipient

Post by mattg » 2016-01-18 00:20

itsmesri wrote:I added IP RANGE for 192.168.1.254
Please show a screen shot of that IP range
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

itsmesri
Normal user
Normal user
Posts: 59
Joined: 2014-11-07 08:30

Re: SENT: 530 SMTP authentication is required to external receipient

Post by itsmesri » 2016-01-18 02:09

@mattg

Image

User avatar
mattg
Moderator
Moderator
Posts: 21192
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: SENT: 530 SMTP authentication is required to external receipient

Post by mattg » 2016-01-18 02:23

And what does the check box on the bottom right say??

uncheck the checkbox on the bottom right, and then try again
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

itsmesri
Normal user
Normal user
Posts: 59
Joined: 2014-11-07 08:30

Re: SENT: 530 SMTP authentication is required to external receipient

Post by itsmesri » 2016-01-18 03:11

Thanks @mattg.

It worked.

You said, "Be aware that any hostile script on your machine (ie a Trojan) can then do the same."

Is there anyway I can stop trojan not use this. I have already McAfee running machine.

If I use captcha on my website will stop this send emails?

User avatar
mattg
Moderator
Moderator
Posts: 21192
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: SENT: 530 SMTP authentication is required to external receipient

Post by mattg » 2016-01-18 03:15

jimimaseye wrote:also... unless you you are using GMail relays then you are likely to have problems (being seen as spam) anyway as sending from=@gmail from your own server will fail the gmail SPF and DKIM tests set by gmail.

It really is best to get your website to authenticate
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Post Reply