I was wondering what is the difference between sending a basic message and message using SMTP in cakephp
Regards
A basic message just uses PHP's mail function to drop off the message to whatever mail handler is configured locally. On your local computer this usually means that the machine will try to deliver the message itself, which often results in it either being rejected or going straight into the spam folder of the receiver. On a properly set up hosted server this is usually not a problem though.
Delivering via SMTP lets you specify an SMTP server that will take over the message delivery for you. A well known and established SMTP server has much better chances of delivering a message to the intended recipient.
Related
I use Thunderbird with an IMAP server to access incoming email as well as for online storage of mail, and SMTP server for outgoing email. Every time I send an email, it first sends it via SMTP and then uploads it separately to my IMAP server's Sent Items folder. This is not only inefficient, it's also risky as sometimes, on a poor-quality connection, I can send out an email by SMTP but then fail to save it on the server with IMAP, leaving me without any copy of the email I sent (and Thunderbird doesn't save it in the outbox in such cases).
Is there any way I can set up some local and/or server-side software such that (1) the mail only needs to be uploaded once and (2) it will reliably appear in my Sent Items immediately, without delay (and without requiring it to be re-downloaded) and then also hopefully (3) when my connection is poor and an email can't be saved to the IMAP folder, it automatically stays in my local outbox until properly sent and synched?
Local mail clients have been around for so long now, I am really surprised that there appears to be no solution for this! Seems like webmail is the only robust solution, but that's no good for poor quality connections either.
I am thinking of solutions like offlineIMAP and dovecot, but wondered if anyone has got/seen an outline for how such a setup could be organised?
This is not possible using imap, the protocol just don't manage at all the sending of messages.
You could manage to do that using sieve scripts while telling postfix to deliver the message to the sender but that won't be robust and would save the email two times in the Sent folder if the client is not configured for your liking.
Overall, this is a bad idea.
From https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol#Disadvantages:
"Unlike some proprietary protocols which combine sending and retrieval operations, sending a message and saving a copy in a server-side folder with a base-level IMAP client requires transmitting the message content twice, once to SMTP for delivery and a second time to IMAP to store in a sent mail folder. This is remedied by a set of extensions defined by the IETF LEMONADE Working Group for mobile devices: URLAUTH (RFC 4467) and CATENATE (RFC 4469) in IMAP and BURL (RFC 4468) in SMTP-SUBMISSION. POP servers don't support server-side folders so clients have no choice but to store sent items on the client. Many IMAP clients can be configured to store sent mail in a client-side folder, or to BCC oneself and then filter the incoming mail instead of saving a copy in a folder directly. In addition to the LEMONADE "trio", Courier Mail Server offers a non-standard method of sending using IMAP by copying an outgoing message to a dedicated outbox folder.[18]"
I like the idea of a clever IMAP server that handles handing off a message via SMTP through the use of an outgoing message folder, which the Courier Mail Server seems to be doing.
The set-up would need a 'smart' local SMTP server (defined below) as well as either a normal online IMAP server or else alternatively a local/offline IMAP server capable of keeping local offline copies of everything and synchronising when connected.
The 'smart' local SMTP server would need to handle the job of arranging for the message to be sent. In one configuration, it could simply do this as normal. But in another configuration, it could communicate with a 'smart' remote SMTP server, and, instead of sending the outgoing message to that server, it could tell that other server that the remote IMAP server has whatever particular message and, then the remote SMTP server could fish out the message from the remote IMAP server and send it on its way.
Such a configuration could be managed without a special email client. The only change from a standard configuration would be (1) setting IMAP to save sent messages in an 'outgoing' folder, and (2) setting the SMTP server to the 'smart' local SMTP server instead of the normal remote SMTP server.
None of this exists, but it could be implemented fairly easily by someone who was comfortable with both SMTP and IMAP protocols and server implementations, right?
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.
In HTTP, you can tell the client who asks for example.com/foo/ that it should ask for something.else/instead.
Is there a way to do it in SMTP? That is, if the client sends a message to john#example.com, tell it to send it to jane#somewhere.else instead.
I know that I can receive the message and relay it to jane#somewhere.else. For many reasons I don't want to relay messages via my server. Instead, I want to tell the client that it should send it to another address.
The reasons include:
I cannot notify the client of a failure (well, perhaps this can be done).
My server will be blacklisted if the message was spam.
The destination server will consult blacklists with my IP and not with the original sender's IP, etc.
My motivation is:
If this were possible, perhaps it would be a better antispam measure than greylisting.
My institutional server has no antispam filters, while my personal server uses IP-based blacklists such as Spamcop. After the institutional server has received a message, I can scan the message at the client but it's too late to consult Spamcomp and to inform the sender that the message was filtered out (I consider it a must in any filtering). I wish the institutional server could simply redirect people to my personal server, which is a lot better protected and correctly informs the sender of the problem at the SMTP stage.
Sendmail provides FEATURE(redirect) to handle such cases.
It rejects recipient in reply to RCPT TO: with
551 5.1.1 User has moved; please try <newemail#example.com>
Your email server refuses to accept the recipient with hint, it is up to sending host to generate bounce message to the sender. Spammers may/will get the new email too. I do not know any email servers handling automatically such redirects.
I have not investigated how well it is handled by various email clients and level of details provided in bounce message by various email servers.
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.
Am developing and newsletter email software in vb.net for a friend, and he has asked me to add option to send email using dns servers,
How do i send an emai using dns server without smtp or imap?
Send email "using DNS servers" still uses SMTP. And it's generally a bad idea. Here's what it's about:
Usually, an email app (your own, Outlook, etc.) send mail using SMTP or similar protocol to a configured mail server. It could be a company's own server, or an ISP's server, or something like that. The mail may pass through various outgoing mail servers on its way out of an organisation, but at some point it hits a "boundary server" (There are pretty names for all these different types of server, but they're not important right now.)
This boundary server uses DNS to find the recipient's mail server and then sends the message (using SMTP) to that server. (I have omitted the details on purpose)
Sending email "using DNS" means that your app acts as a boundary server. It uses DNS to find the recipient's mail server and then sends the mail directly - rather than using any outgoing servers.
It's a bad idea for two reasons.
More and more ISPs block SMTP traffic that doesn't pass through their outgoing servers
More and more incoming servers validate the boundary server using various techniques. Your app is not likely to be accepted by these servers
Both of these issues are anti-spam countermeasures, so using this technique makes you look like a spammer, leaves many of your messages blocked, and is likely to get your IP address blacklisted.
Hopefully you can explain this to your friend so that they will understand that the "normal" way of sending mail is the only way to ensure that they don't get listed as a spammer.