For my Perl web application, I need account verification via email.
I already have a sub to generate and handle the unique link and an email composing and sending mechanism (with Email::Sender CPAN module) and it works fine - it sends emails and they get delivered.
The problem is they hit spam filters, I think it's because 'From' is 'noreply#example.org' and the user I run a script as is roman#example.org. If I send email with the same exact script with 'From: roman#example.org', it is delivered properly and does not hit the filter.
I have a root privileges on the server and can add users and configure postfix, but the question is what should I do? Run webapp as a user noreply having permissions to send mail? Changing postfix settings? Should I use MDA at all or it's better to stick with Net::SMTP or Email::Sender for a lightweight application?
I understand that an exact answer for that question might help spammers, so general direction and links to documentation I need to read would be enough.
from Example robot noreply#example.org
to myactualaccount[#]gmail.com
date Mon, Jun 13, 2011 at 9:45 PM
subject test
hide details 9:45 PM (15 hours ago)
This message is short, but at least it's cheap!
Be sure you are setting the envelope information.
Also, maybe configure Email::Sender to use the SMTP transport rather than sendmail and it should set the envelope sender to the same as the From: address without interference from postfix.
Related
I have a server on OVH and I'm trying to send some mail to my Gmail address using sendmail.
I installed sendmail with apt-get on debian, and echo "Subject: test" | /usr/sbin/sendmail -v mymail#gmail.com works. However Gmail puts the mail in the spam folder and says the mail is not authenticated.
I have no knowledge of how email works and from what I've seen I could use SPF or DKIM to provide authentication, but it seems it requires admin access to ovh DNS servers.
What would be the easiest way, using only admin access to the server that sends mails, to make sure emails sent from it are not marked as spam ?
Thanks
There are no easy way. That's the simple answer.
Google Mail is fighting spam every second, every day, all year. To get mail delivered directly to the inbox requires time and patience and there are no shortcuts. If there where, spammers would have it way to easy!
You are very correct that Google's SMTP servers will ask you to beef up your SMTP mail headers to include better authentication and security. There's no way around it if you want to be on good terms with Google's SMTP servers.
Here is a list of things to consider
SPF (Must have, also to defend spam sent in your name)
DKIM (Must have, this is somewhat a step up from SPF)
ESMTP (Google likes it when you talk to them encrypted)
Bulk headers (Use them if it's bulk, no reason to lie!)
Unsubscribe headers (Use them if you are sending out maillist content)
SMTP relay's with nice Senderscores (Easy access to the inbox, but cost)
SMTP relay's with good reputation (Easy access to the inbox, but cost)
Feedback loop headers/setup (If you send large amount of mails)
Only use "warmed up" SMTP relay servers (Mostly used by bulk senders)
Reverse DNS to match HELO/HELO (Mismatch can make problems)
Static IP (It's a given)
As you can see it's no simple task to "just" send an email to Google and expect it to be passed along to the users Inbox without getting targeted as spam.
Most of the options above requires extensive server knowlagde or that your hosting provider supports it. You need to have access to change your own DNS records but also the SMTP server that you send your mail from needs to be setup with the things in advance.
Now to the:
"How to send emails to Google Mail that always land in the inbox for dummies"
Well you basically buy your way into the inbox. Use SMTP services like Mailchimp, Amazon AWS-SMS (Simple Mail Service) many if not all of these services have already setup DKIM, SPF and are on good terms with Google. They do however have many rules and what and what not to do so if you don't follow the rules they will close your account right away.
I use dnsimple to host my DNS and have valid SPF, DKIM, and DMARC records to validate my emails sent from Zoho. However, Whenever I send emails to an #ucdavis.edu account I get an Undelivered Mail response
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its recipients. This is a permanent error.
lsmiyashita#ucdavis.edu, ERROR_CODE :550, ERROR_CODE :5.7.1 <admin#study.space>... Access denied
Received:from mail.zoho.com by mx.zohomail.com
with SMTP id 1478675695600485.6815385213283; Tue, 8 Nov 2016 23:14:55 -0800 (PST)
Message-ID:<15847f087ed.112901d8e106580.9166398699723335101#study.space>
Date:Tue, 08 Nov 2016 23:14:55 -0800
From:Jacob Bevilacqua <admin#study.space>
User-Agent:Zoho Mail
To:"lsmiyashita" <lsmiyashita#ucdavis.edu>
Subject:Here's a little test for you.
Content-Type:multipart/alternative;
boundary="----=_Part_335760_1020694757.1478675695597"
I have tried several different hosts (GSuite, MailGun, & Zoho) and I get the same issue. I checked and I am not blacklisted on any sites. I ran a test at mail-tester.com and got a 10/10. Why won't my messages deliver.
I verified that the email address you are sending to is valid: Verified Email Address
So like #Synchro says, they just don't like you. It's always a challenge to figure out the exact reason, but contacting their admins is the right way to go. I have a feeling it's because of the .space domain ending, they probably haven't updated the list of domain endings they accept.
Anyway, if you wanted to do additional mail testing, use this Mail Tester.
You are under the unfortunate illusion that it's your fault. A 5.7.1 error means that they just don't like you, and they don't have to give a reason. Welcome to the world of deliverability, or lack thereof. Well-behaved mailers are often punished for no particular reason. If it's just this domain, your best bet might be to contact their admins.
I am sending email from application. My problem is when your type email address means format is correct but it may be not available anywhere.so when I am trying send such email address using SMTP through application, so how to track fail-over notification if intended recipient not found.
please suggest any approach.
There is no standard way of doing this. You might be able to make it work in some cases by parsing incoming email looking for delivery failure notices but it'll be a lot of work to keep that parsing code up to date. So at best you'll only get some of the notices. If you get a notice at all. The recipient's SMTP server may not send you anything, or the notice might get lost on it's way back to you.
The only way you are reliably get this sort of information is to host the SMTP server yourself, and deliver directly to the recipients SMTP server. In that case the SMTP server knows the status of the email's delivery and could report that to your email client via some non-standard back channel.
Note: Hosting your own SMTP server is non-trivial. And you will probably need to be on a fixed IP otherwise external SMTP servers will treat your email as spam. In case you're thinking of running one over a home connection or something.
I am trying to build a mail server using Ubuntu to send mail
I have done some research on that and find it is nearly impossible for a individual to send
the mail e.g. hotmail , gmail.
The question i am asking is not how to build a own server, it is why i can not build my own server.
To be precise:
Questions:
1) what are the requirements to send to those e.g. hotmail ,gmail server ? e.g. mx record , clear dns record . (only from server aspect , not concerning other factors such as headers or mail content), It would be easier to understand if they are listed out.
2) I read some document and it said the problem can be overcome by relayhost, what is it about and is it feasible?
3) For those ISP , what are their procedure in building the mail server? How is it different from my own small Ubuntu one?
Sorry for asking a lot of question, any help would be nice and well appreciated .
Most people use an out-of-the-box package as a mail server, rather than trying to write one that follows all of the relevant RFC specifications for SMTP, Internet Message Format, IMAP4, POP3, etc.
I'm not saying "don't write your own", just that if you do, be prepared for months and months of hard work, lots of bugs and even more frustration. It's a big project.
In terms of sending messages, you will need to follow the Simple Mail Transfer Protocol (SMTP) to send messages; and they should be sent to the correct server, as per the recipient's DNS records - see RFC 1034 and RFC 1035.
If you are correctly using SMTP to send valid messages to the right server, there's not a lot else you can do.
Your next problem is going to be reputation. This would be the same, whichever software you use to send your messages.
It's easy for a spammer to set up a new mail server and start sending messages, so it will take a while for some mail servers to trust you (particularly those that are regularly targeted, such as Hotmail, Gmail, etc).
Instead of sending messages directly to the recipient's server, you can use SMTP to send the messages to a relay server. This would usually be your own ISP's server, but it can be any willing partner. You would normally need to make advance arrangements, so that they will permit you to relay messages.
The relay server would then attempt to send the message to the recipient server. If it cannot do so, it must report the failure to the sender.
I have a project to send some email to end clients. My client need to know what exactly "Email Client" they use to read the mail. I know a hidden can get the open event and even the user agent they use, so by parsing user agent i can get most email clients info.
But it's hard to detect some popular web mail clients like "Gmail", "Hotmail" and "Yahoo mail". Because user agent return is only the browser user agent string.
Edit: i think i need a result more like this:
here
You will not be able to perfectly detect the e-mail client your users are using.
In E-Mail headers some programs choose to include the X-Mailer tag, which tells you exactly with what program and version your user is sending the e-mail - of course that can be faked. Not all programs use the X-Mailer tag, I e.g. couldn't find it in a mail sent with Microsoft Outlook 2010.
Besides that you could do some guesswork by the Received from tag in the e-mail headers, but in the end you can use SMTP and POP3 with most webmailers like GMail or Yahoo. That means even though your e-mail is sent via servers from google.com, the originating client could still be Outlook or Thunderbird and not GMail itself.
Maybe we can help you if you better if you could tell us why exactly your client wants to know the programs the users use to read their mail? Probably to tune the appearance of newsletters?
I know this is a really old topic, but the most reliable way to detect webmail client for gmail, hotmail, outlook.com and office365 is to use a tracking pixel. What you will want to do is geo-locate the IP address and you'll find gmail all comes from mountain-view and microsoft based products from redmond.
I haven't validated this with non-US users, but I'd imagine the caching services they use will all be in the same place.
Cheers