I've downloadet this verify e-mail class:
http://www.phpclasses.org/browse/package/6650/download/zip.html
and it mostly works well. if I'm trying to test a : #gmx/#live-mail, it allways say: this email doesn't exist. But I know that they're existing ( cause these are my emails ). I don't really now why? the information I'm getting if I'm searching for #gmx/#live are:
#live:
220 BLU004-MC1F11.hotmail.com Sending unsolicited commercial or bulk e-mail to Microsoft's computer network is prohibited. Other restrictions are found at http://privacy.microsoft.com/en-us/anti-spam.mspx. Thu, 21 Apr 2016 02:21:42 -0700
Connection success mx1.hotmail.com
HELO bla.is
250 BLU004-MC1F11.hotmail.com (3.21.0.236) Hello [217.13.193.253]
MAIL FROM: <blabla#bla.is>
250 blabla#bla.is....Sender OK
RCPT TO: <unicorncookie#live.de>
550 Requested action not taken: mailbox unavailable
RSET
QUIT
email <unicorncookie#live.de> does not exist!
#gmx:
220 gmx.net (mxgmx008) Nemesis ESMTP Service ready
Connection success mx00.emig.gmx.net
HELO bla.is
250 gmx.net Hello bla.is [217.13.193.253]
MAIL FROM: <blabla#bla.is>
250 Requested mail action okay, completed
RCPT TO: <unicorncookie#gmx.net>
550 Requested action not taken: mailbox unavailable
RSET
QUIT
email <unicorncookie#gmx.net> does not exist!
Does anyone have an idea why this class cant reach there mailbox? is it maybe because I'm using the port 25? I've never did something like that, so I'm really confused
thanks for any help :)
Related
I have a Gsuite account. I setup a rule to allow SMTP relay through gmail servers, whitelisting my IP. Also, the FROM address is with my registered domain at Gsuite. And all my MX records point to google.
When trying to send a msg, the logs show that gmail accepts the connection, but in turn it passes is back to my local SMTP server.
Tried PHP PEAR mail & PHPMailer, same issue.
The logs start like this:
Connection: opening to smtp-relay.gmail.com:25, timeout=300, options=array ()
Connection: opened
SERVER -> CLIENT: 220-mylocalhosting.com ESMTP Exim 4.89 #1 Wed, 17 May 2017 23:44:41 -0400 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
From there on, I can send emails if using authentication from my own system.
In short, I specify gmail relay server, but my messages end up going out from my local mail server. And I can't understand why.
UPDATE: If the PHP script runs as 'root', gmail takes the message and processes it as expected:
Connection: opening to smtp-relay.gmail.com:25, timeout=300, options=array ()
Connection: opened
SERVER -> CLIENT: 220 smtp-relay.gmail.com ESMTP 137sm1646549itk.4 - gsmtp
But I can't make it do the same as a regular user.
Any assistance would be appreciated.
Found the problem: It's a setting in WHM SMTP Restrictions. WHM Manual
I'm having trouble sending e-mail on my PHP/Apache docker container via sendmail. I'm wondering if someone has a simple, straight forward solution. I am not a systems/server expert by any far stretch and my smtp/sendmail expertise is equally underwhelming. Thanks in advance for the help.
Below is the error I'm recieiving:
sendmail: 553 5.1.8 <apache#a0aca7313106>... Domain of sender address apache#a0aca7313106 does not exist
Clearly apache is my user, and that stuff to the right is my docker container ID. There is a "From:" header value within the pHp Mail parameters being passed, so not sure why it's defaulting to this.
As requested by the comment below, I am adding the "mail" function that is being used. I can confirm there is data within this function, specifically the "$this->headers" which contains a From address.
It should be noticed that I am running the exact same code in a non-containerized environment, and the e-mail gets sent fine so I believe it's a container configuration issue. These are the areas of the php.ini that I have modified. Is there something else I should be looking for?
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
I changed "localhost" to the smtp server listed on my non-containerized environment, restarted apache in the container, but still recieved the error message above.
I am able to connect to my external SMTP server via telnet using the reference listed in the comments below (thanks #mark91). This is my output/transcript. I should mention that my e-mail was never actually received, however (I listed myself as the recipient). I masked the info with *******'s
telnet smtp.service.******* 25
Trying *******...
Connected to *******.
Escape character is '^]'.
220 ******* ESMTP smtp.service Fri, 31 Oct 2014 14:29:16 -0400
HELO *******
250 ******* Hello [*******], pleased to meet you
MAIL FROM: *******
250 2.1.0 *******... Sender ok
RCPT TO: *******
250 2.1.5 *******... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
Hello
.
250 2.0.0 s9VITGpm030795 Message accepted for delivery
How are you sending this e-mail in PHP? At least, you might configure correctly your php.ini file in order to put as smtp server the right value. Moreover, if you are using the PHP mail function, you should put as $header parameter a string containing "From: foo#bar.com\r\n"...
i'm using this google class and code https://code.google.com/p/php-smtp-email-validation/ to check an array of emails and get which is real and which isn't.
But im getting an error:
unable to connect to example.com:25 (Connection timed out)
Error: Could not connect to a valid mail server for this email address: #example.com
I didn't find anything like that and i already have disabled firewall and etc...
Well still not working:
Array
(
[mx4.hotmail.com] => 5
[mx3.hotmail.com] => 5
[mx2.hotmail.com] => 5
[mx1.hotmail.com] => 5
[hotmail.com] => 0
)
try mx4.hotmail.com:25
<<<
220 BAY004-MC6F11.hotmail.com Sending unsolicited commercial or bulk e-mail to Microsoft's computer network is prohibited. Other restrictions are found at http://privacy.microsoft.com/en-us/anti-spam.mspx. Wed, 24 Sep 2014 10:15:49 -0700
>>>
HELO yourdomain.com
<<<
250 BAY004-MC6F11.hotmail.com (3.20.0.138) Hello [177.2.47.23]
>>>
MAIL FROM: <user#yourdomain.com>
<<<
250 user#yourdomain.com....Sender OK
>>>
RCPT TO: <thiago.sabin#hotmail.com>
<<<
250 thiago.sabin#hotmail.com
>>>
RSET
<<<
554 Transaction failed
>>>
quit
<<<
As i can see the sender is okay and im trying to check my personal email thiago.sabin#hotmail.com and that's the answer...
This code is actually really simple but i can't make that "transaction" to work
The example code works as intended, as user#example.com, though it has a valid format, isn't a valid email address because example.com doesn't host a mail server. Google's example code contacts the receiving mail server to see if the given address exists on it. Try replacing user#example.com with another email address, like your own, and running the code again.
Edit: There are many posts which say that using smtp verification is a bad idea. It seems to 1) not work on many smtp servers and 2) make it look like you're a spammer. I would advise just sticking to verifying that the email address is the proper format, and forgo the use of SMTP verification.
I want to check entered email address before registering, I found some solutions in SF but these solutions says we should check MX or SMTP port, but we have some fake emails like :
111111#gmail.com
some.email.address#gmail.com
and ...
when I check the gmail.com domain this domain have MX record and there is no problem but this emails are fake !
Is there any way to ping email address with php?
The only thing you can do is send a confirmation email, and ask user to click a link or provide a code you have sent in this email.
You CAN check for the existence without sending a mail.
After you get the MX record, you can use SMTP protocol to communicate with the server directly.
For example: (the lines starting with > means input. )
> telnet gmail-smtp-in.l.google.com 25
Trying 74.125.129.26...
Connected to gmail-smtp-in.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP pa10si7038694pbc.108 - gsmtp
> HELO
250 mx.google.com at your service
> MAIL FROM: <test#test.com>
250 2.1.0 OK rw3si4189390pab.9 - gsmtp
> RCPT TO: <notexists___#gmail.com>
550-5.1.1 The email account that you tried to reach does not exist. Please try
550-5.1.1 double-checking the recipient's email address for typos or
550-5.1.1 unnecessary spaces. Learn more at
550 5.1.1 http://support.google.com/mail/bin/answer.py?answer=6596 rw3si4189390pab.9 - gsmtp
If you replace notexists___#gmail.com with 111111#gmail.com:
> RCPT TO: <111111#gmail.com>
250 2.1.5 OK il2si7046221pbc.91 - gsmtp
In PHP, you can use socket functions to do things above.
NOTICE: This approach may not work on some SMTP servers.
The only way i know to check email-addresses is through sending an email to them.
Why do you need to check the e-mail address beforehands? You could just send them an "activation link" what also prooves not only the existance but the person behind the address.
You can send a confirmation mail, so that you know that address works. If that is not an option, you can check of the domain actually exists. That way you disregard something#non_existing_domain.com
// or use ANY or for other see above link
if (checkdnsrr('non_existing_domain.com', 'A')){ echo 'Domain exists'; }
else { echo 'Domain does not exist'; }
I am almost done with a tool to detect if email is valid or not. I am stuck at small point where I have to detect If mail server or domain has catch-all policy enable.
Catch all: mail server will accept all email even if email address do not exits.
Thank you.
There is no 100% reliable way to detect a catch-all of a mail server you don't control yourself.
The most promising way is to generate a random address in the target domain which is definitely not used as a real account and send a test message.
If you don't get a reject while sending and no bounce to the envelope sender address of your script within a few minutes, there could be a catch-all involved. But it could also simply mean that the target server quarantined or dropped your message or that the bounce didn't make it back to you.
If you go down that road, make sure your tool generates valid messages, with all the necessary headers, has correct dns/helo settings, doesn't use any non-rfc smtp shortcuts, etc. in order not to get filtered.
On a side note: if this tool is going to be public, make sure its properly protected. Tools that automatically send mails are popular targets for abuse.
You can identify domain is catchall or not by using Telnet.
Create invalid email address against that domain.
e.g.
domain : example.com
Email Adddress : dummyemail#example.com, invalid.email#example.com
How to Telnet:
Step 1 - Find mail exchanger or mail server of example.com
Commmand :
nslookup -q=mx example.com
Response:
Non-authoritative answer:
example.com mail exchanger = 10 aspmx.l.google.com.
example.com mail exchanger = 20 alt1.aspmx.l.google.com.
example.com mail exchanger = 30 alt2.aspmx.l.google.com.
example.com mail exchanger = 40 aspmx2.googlemail.com.
example.com mail exchanger = 50 aspmx3.googlemail.com.
Step 2 - Now we know mail server so let connect to it.
Command:
telnet aspmx.l.google.com 25
Response:
Trying 74.125.24.27...
Connected to aspmx.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP z79si2772641pfi.381 - gsmtp
Step 3 - Enter helo hi
Command:
helo hi
Response:
250 mx.google.com at your service
Step 4 - Email address from which you telnet to targeted email address
Command:
mail from: <emailaddress#gmail.com>
Response:
250 2.1.0 OK z79si2772641pfi.381 - gsmtp
Step 5 - Target email address which you want to validate
Command:
rcpt to: <targetemailid#example.com>
Response:
250 2.1.5 OK z79si2772641pfi.381 - gsmtp
If you got "ok" for invalid email address then that domain is catchall domain.
A catch-all domain in simple terms means, the server of that company will catch any email sent to that domain, even a non-existent address and store it in a section called the catch-all. When this happens, you have no clue if it’s a legitimate email address or not.