Skip to main content

Automated emails from Perl script to Outlook and Gmail being discarded

Comments

13 comments

  • SysSachin
    Hi, Might be your firewall or your ISP blocking outgoing connections to SMTP port. Can you please try to disabling firewall from your server.
    0
  • Jcats
    I've never seen an instance where the email was accepted and queued by Gmail which is what those logs indicate and then just simply discarded(outside of it being a filter setup by the gmail account itself). Gmail will always, always, provide a bounceback if the email is rejected. Try using the search in Gmail at the top for your server hostname as that is where the email would be coming from, its possible it landed in the promotions box as an example. Ultimately, you will want to switch to using SMTP authentication to ensure the best mail delivery results.
    0
  • mtindor
    You absolutely either want to use SMTP Authentication (so that, assuming DKIM is enabled and you have a valid SPF record in place), your emails will be DKIM signed and will pass SPF. You can also do that via your PERL script (the DKIM signing) I imagine, but I couldn't tell you how to do it. All emails should always be DKIM signed and pass SPF for the most reliable delivery. mike
    0
  • cPanelMichael
    Hello, The previous post is correct. You'd need to setup your form to use SMTP authentication to help prevent the email from going to the SPAM folder. The following document may also help: How to Keep your Email out of the Spam Folder - cPanel Knowledge Base - cPanel Documentation Thank you.
    0
  • GoWilkes
    Sorry for the late reply, I've been working on option after option for this... I finally began using the Perl module Net::SMTPS, which allows an email authentication. The script looks like this:
    use Net::SMTPS; my $smtp = Net::SMTPS->new( "mail.example.com", Hello => 'server.example.com', Port => 587, doSSL => 'starttls' ) or die "Couldn't connect to SMTP server: $1"; $smtp->auth('username@example.com','password'); $smtp->mail('me@example.com'); $smtp->to('me@gmail.com'); $smtp->data; $smtp->datasend("From: me\@example.com (Example)\n"); $smtp->datasend("To: me\@gmail.com\n"); $smtp->datasend("Reply-to: me\@example.com\n"); $smtp->datasend("Subject: Test Email\n"); $smtp->datasend("\n"); $smtp->datasend("A simple test message\n"); $smtp->dataend; $smtp->quit;
    That's pretty much an exact copy and paste, other than changing the actual domain to example.com, and of course removing the username and password. The email goes through now without being discarded, so I'm guessing that the problem was the lack of authentication, after all. But Hotmail still bounces it (stating that the IP range is blacklisted, but my server provider can't find where), and Gmail now sends it to spam. I've had this server for several years, and it has NEVER been used for spam and never had a virus. All accounts on it belong to me, so I'm positive about that. I have an SPF, DKIM, and DMARC on the account, MXToolbox confirms that I'm on no blacklists, and the Senderbase reputation is "neutral" (per the links from Michael's post above). So I'm at a loss as to why it's being filtered.
    0
  • Jcats
    Hotmail keeps their own blacklists so using the online tools like mxtoolbox will do you no good. You've had the server for several years and haven't had an issue but all of a sudden you are going to spam and are on a blacklist so this would indicate that it has indeed been clean all these years but doesn't mean its clean as of recent. Can you provide the bounceback you are getting from hotmail? As far as gmail, they usually indicate why its going into spam, if you go into your spambox, click the email, it will say something like this at the top: "Why is this message in Spam? It is in violation of Google's recommended email sender guidelines. Learn more" What does it say?
    0
  • GoWilkes
    I learned that about Hotmail's blacklist just recently myself, jcats. They allegedly have a form to request removal, but it's been broken for the last 2 days, and I don't know any other way to contact them:
    0
  • Jcats
    Ah its possible there are abusers, not on your specific IP but within the /24 What if you go to senderbase and do search reputation for 123.45.67.89/24 Are there any poor rated? This could be affecting you.
    0
  • GoWilkes
    Thanks for the tip :) In the /24, there are 3 servers listed, including mine. All 3 have a neutral reputation, and are on no blacklists. The first server has a "Last Month Volume" of 1.7, the other two (including mine) are 1.3. So, good thought! But these look OK, too. Looking at /20, there are 56 servers listed: 3 of them have a "poor" reputation, and 11 are "good". Would those negatives affect me at that wide of a range?
    0
  • GoWilkes
    Just to further update, I used mail-tester.com to ensure that the email has a good rating. It suggest that I add a "Date" and "Message-ID" header to the script, and now it has a perfect 10/10 score with a SpamAssassin score of +0.1. But still, Gmail sends it to spam, and Hotmail bounces it :'-( "Original message" link from Gmail says:
    Message ID <5977a676.b321ed0a.d9864.1f53SMTPIN_ADDED_BROKEN@mx.google.com> Created at: Tue, Jul 25, 2017 at 4:13 PM (Delivered after 1 seconds) From: [Me] To: [me]@gmail.com Subject: Test Email SPF: PASS with IP [123.45.67.89] Learn more DKIM: PASS with domain [example].com Learn more DMARC: PASS
    0
  • cPanelMichael
    Hello, I recommend using the contact forms for Gmail and Hotmail to report the issue. Here's the updated URL to reach out to Hotmail/Microsoft:
    0
  • GoWilkes
    Thanks, Michael, I just submitted a request to Microsoft. I can't find a support form to Gmail, but I did find this: Sign in - Google Accounts There's a theory that it might help, but I guess we'll see! I'm waiting for them to recognize the TXT that I added to my DNS, so hopefully I'll know more tomorrow.
    0
  • cPanelMichael
    Here's the link you can use for Gmail: Troubleshooting for bulk email senders - Gmail Help Thank you.
    0

Please sign in to leave a comment.