How can one send an email to a gmail address from outside - authentication

If you use smtp.gmail.com, you have to specify your mail credentials. To send a mail to a gmail account you need that server right? How is it possible for outsiders to send a mail to a gmail address?

Found it myself:
smtp.gmail.com is a relay server, relay servers only receive mail to redirect it to a so-called mx server, a mx server is a smtp server that is configured to receive mail and directly deliver it (to a user inside) the gmail mx server (they do not require authentication) is: gmail-smtp-in.l.google.com
There are four alternative servers, you can prefix altx. to use one of those e.g. alt3.gmail-smtp-in.l.google.com
The mail program knows where to send the mail by an mx lookup database, so basically a list of #example.org and corresponding mx servers. See mxtoolbox.com for more info

Related

Domino C API EMs add signatures via server not client to outbound SMTP emails

I know of Domino C API EMs that add signatures via server not client to outbound SMTP emails, so this must be possible.
EM_MAILSENDNOTE can only be used on a client.
Here is another post that is relevant, but I'm not allow to add any content to it !!!
NSFItemAppend doesn't add text

How an E-mail is sent from your mail SMTP server to others?

Assume you have a Gmail account and want to send an E-mail to an account on yahoo mail server from Gmail account, here are the steps:
Client mail manager (say outlook) connects to gmail server and authenticates your account(using username/password that you have already)
after the authentication is done, your mail is sent to gmail server
so here is the question: how gmail proves itself to yahoo? has
gmail any username/password or some sort of things? is authentication needed for this?
In general there is no authentication from one SMTP server to another. The only authentication is from you to gmail.
This is one reason why spam is such a problem. The basic SMTP protocol just assumes there is no spam. You open a connection to a mail server and just send the headers like
from: mehrdad#gmail.com
to: gman#yahoo.com
Hello
And yahoo.com (the receiver) will happy except the email regardless of what computer it came from.
Because of those issues things have been added but they are optional.
One is DKIM. It works by signing your email with a digital signature. The signed email can be verified by the receiver (in your case by yahoo). Yahoo can check for gmail's public key in gmail's DNS records and check that the mail's signature cryptographically matches. It's up to the receiver (yahoo) to decide if it wants to check that or not. If the sender (Google or a spammer) does not add the signature then again, it's up to the receiver to decide what to do with the message. It could assume it's okay and pass it on. It could check if there is a public key available and if it is and the email has no signature then may not pass it on? Or mark it as "possibly spam"
There's also SPF. SPF is designed so that the receiver (yahoo) can verify that only the sender (Google) is allowed to send mail from gmail.com.
Then there is DMARC. DMARC lets Google (the sender) tell Yahoo (the receiver) what to do when when the stuff above fails. For example wither or not to forward messages who's signatures don't match the key. It's up to the receiver to decide to use this info.
Along with the linked wikipedia articles here's a pretty good overview of what happens and the problems involved.

Email Config Google Cloud Platform

Best regards
I have an instance configured in Google Cloud, where I installed cPanel to manage more easily my web project. Everything runs fine, but as much a problem to use email accounts.
I set all MX records in the Network section of the console Google, and have also done the same in cPanel. Then I created email accounts in cPanel, and I can access the accounts (I use RoundCube as an email client), but when sending an email, this is going, but does not arrive to destination, or conversely, sent from another account (such as a Gmail) email, and this is sent but not up to my new personal email account.
I realized that what happens is that Google does not allow use ports 25 and 587, so must perform other configuration.
Someone could help me to know how I can create and use email accounts, from a "normal" way, without using Google Apps (because it is paid) or services like Mailgun.
Thanks so much for any help.
You will have to use any third party email service for mail. Please check following URL,
https://cloud.google.com/compute/docs/tutorials/sending-mail/
You cannot use ports 25 and 587 since GCP block all outbound traffic from those ports, I suggest you use port 2525 since that's the only smtp port that GCP does not block and most major vendors use.

SMTP authentication vs non-authentication

I'm coding an SMTP Server here and wondering an issue which I don't know how to proceed.
You know that when you using Outlook, ThunderBird or any email client to send email, we need (the most of times) username and password to authenticate with the SMTP Server. In this case, SMTP Server requires an "AUTH LOGIN" before other commands such as MAIL, DATA...
I completed this stub in my project. But I'm wondering about a case, when another SMTP Client send directly to my SMTP Server. I mean our server is the final destination of the email. In this case, the authentication with AUTH LOGIN should not be required.
How can I organize my code for 2 cases above. How does the professional MTA such as Postfix, PowerMTA, Exim organize for these.
I hope you will help me
Most outgoing SMTP servers do one of the following:
1) Require SMTP Authentication
2) Alllow relaying without SMTP Authentication only from clients within a certain IP range
If you are doing neither of the above, then that means that your SMTP server is basically operating as an 'open relay', meaning that spammers can abuse your server to send outgoing spam mail.
Many ISP-hosted SMTP servers do #2 above, to allow their clients (and only their clients) to send mail through their SMTP server - as long as the client is on their network.

Tracking the Bounced Emails or undelivered emails sent through Sql server

Im trying to send an html email with attachment to list of users. Our client also requires the track of undelivered email ids, so we thought of using sp_send_dbmail feature available in SQL server, which has logs for email sent using it. Our client also mandate to DKIM sign the emails. Im not able to find how to DKIM sign the emails sent through sp_send_dbmail.
Please help!..
Normally DKIM signing is a SMTP server business, not SQL. You want to talk to postmaster. There are several steps involved in enabling DKIM signing outgoing email:
Generation of RSA crypto key pair
Publication of public key in DNS (so receiving server is able to verify the signature)
Setting up signing service
Modifying your SMTP server configuration to use this signing service for all or specific outgoing emails
There are third party controls that enable signing from within SQL, but not using sp_send_dbmail. See here for example: http://www.example-code.com/sql/dkim_sendDkimSigned.asp
However they don't eliminate the 1 and 2 above.