I tried to use this example to send email to my smtp account at gmail. I know that, in order to use the gmail smtp server, you usually need a valid username/password combination, but other smtp servers (e.g. hotmail) need to be able to send mail to gmail and they have no knowledge of passwords. My question is, is it possible to send mail to a gmail account without knowing the gmail password. The error code was:

curl: (55) MAIL failed: 530
  • This is not a question about Raspberry Pi. – Dmitry Grigoryev Oct 18 '18 at 13:55
  • Note that some SMTP servers support authentication by IP address, if the same IP recently authenticated with the corresponding POP server. – Dmitry Grigoryev Oct 18 '18 at 14:01
  • @DmitryGrigoryev all will readily accept mail to users in their domain, even from president@whitehouse.gov – user1095108 Oct 19 '18 at 8:16

It's possible, just not over the usual smtp.gmail.com server. What I did was an MX lookup on gmail.com and you get a slew of servers, I picked this one:


and the security there is rather more lax, no need for TLS/SSL and no need for a password.

  • This will likely only work if your destination is a gmail.com address. And I suspect there are strong anti-spam measures on those servers so I wouldn't be surprised if even email to gmail.com address are sometimes rejected. – Craig Oct 16 '18 at 20:25
  • I'm just happy the email shows up, even if in spam. – user1095108 Oct 16 '18 at 21:47
  • Don't forget to check the exit code from the curl command to ensure it successfully submitted the message. – Craig Oct 17 '18 at 16:34
  • No need, since I sent the message to myself and received it. – user1095108 Oct 19 '18 at 0:54

curl is not a mailserver (or message transfer agent). To my understanding it acts as an mail user agent (MUA) - "email client" - and it rather connects to a mailserver to hand over your mail to the SMPT server which then sends it to the recipients MTA (via relays if necessary). Or as the example you have linked puts it:

curl supports sending data to a an SMTP server, which combined with the right set of command line options makes an email get sent to a set of receivers of your choice.

An SMTP server may choose to not deliver your outbound mail unless you authenticate yourself as a legimitate client to prevent spam and other abuse of the server.

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