Setting up mail smtp relay service to send and receive mail - smtp

I have very limited knowledge about SMTP and IMAP/POP. SMTP --> sending message, IMAP--> Mainly for receiving messages.
I have a woocommerce website and i already did setup my email system to use SMTP relay using zoho. I believe zoho also provide mailbox services since I am able to communicate with my customer(both two and fro) using its email service. They have their app and i can receive and send mail from that app. Obviously, I have set up all the records including MX to send/receive the email to my zoho inbox.
No i want to move my email services to postmark or like sendinblue. All i can see the setting related to sending the mail but how/where will I receive the mail when user reply on that??
On the postmark website it says:
Since Postmark is not a mailbox provider there's not the ability to generate mailboxes for receiving email using IMAP or POP3.
Question 1) Does the SMTP relay server is actually a different physical machine from IMAP server for sending/receiving messages. I guess both are different but why are these companies not providing solutions like zoho. Pardon me if I did not understand the use case.
Question 2) What to do in this case ???. My case is simple. I send notifications to customers regarding their orders. If they want they can reply or enquire. I receive the email on my phone and I can reply on the same mail-chain like we have on Gmail.
Question 3)
Do i need to buy some another service along with these to receive and reply back on the email ??? Like from godaddy or somewhere else.

Related

How to add new 'From' email id each time sending email using PostFix server

I am new to PostFix and have setup PostFix as a server recently. In the testing, PostFix is working fine and relaying the emails with 'From' email address stored in the PostFix credentials files likes admin#mydomain.com and password : xxxxxxx
My problem is: We have a web application that allows direct email sending feature between the website users. As User 1 can send email to User 2 (user2#example.com) and vise verse. But while sending emails using the PostFix server, the user2 will always receive the admin#mydomain.com instead of user1#example.com so the user2 can not reply on the email directly to the user1.
This problem is a bigger one as we have thousands of the users that are waiting for this feature. So if someone can help me configuring the PostFix server so that at the time of sending email, user can set their email id as the 'From' field of the email using any web form and the receiving user will get the email as the email was originally generated by user1#example.com so that he can reply directly to the user 1 on his email id.
I have done some research work on the PostFix about this problem but did not find much interesting one. The approach others followed are using the smtp_generic_maps but this can work only with a limited set of email ids stored in the >>/etc/postfix/generic. But we want this solution fully dynamic so that any user can add the FROM as his/her email while internally the email will be sent using the admin#mydomain.com in PostFix.
Early response is much appreciated.
Thanks
Finally I fixed this issue by using an Grails application which doesn't require for adding fixed emails in the PostFix.
Use the Grails Mail plugin and set PostFix server as the default Mail server.
Also add inbound connection in the Postfix so that other email services will not ban you.
As well as change the port from 25 to some other port as Port 25 is being used to send Trozen horses and spamming ..
I love PostFix now.. Enjoy free mail service for your small business.
Thanks

Is there a way to force GMail/Google Apps SMTP server to not store sent messages?

Perhaps a special command or message header in order to be able to tell Google to not store a message sent using their SMTP server in the respective user's Sent mailbox.
There is no way to prevent the message from being saved to Sent. However, you can connect via IMAP after the send and delete the message from the Sent folder. Assuming you are using OAuth authentication, the same scope you use for SMTP allows you to connect via IMAP.
I was also stucked in this kind of scenario some time back, for me I could not find any standard API to solve this. But as a workaround I have created a rule which deletes all the mails which appears in Sent Folder. But beware of IMAP protocol, it allows users to store their there sent messages in custom folders also.

What further happens after emails are received on SMTP ? Who Stores the email, is that SMTP?

I am developing a customized SMTP server, it is almost complete too. Other SMTP can now contact with my SMTP and I can successfully recive what they send to me. But now I am thinking is it responsibility of SMTP to store the received email OR I will have to pass recived values to any other program that stores these values(such as to,from,data) of recived emails. If so then what is that program ? If not then who will store received values, is that SMTP ??
What you've written is a Mail Transfer Agent (MTA). A piece of software that delivers mail to a user's mailbox is called a Mail Delivery Agent (MDA). The MDA can be a part of the MTA (that is, you can write code in your server that knows how to deliver to mbox, maildir, etc., as for instance Sendmail does), or it can be a separate program like procmail or maildrop.
If you would like to model your custom SMTP server after Postfix (which happens to be the only SMTP server I have experience with), Postfix implements the storing of emails in text files using Postfix-maildrop in the mbox format located at /var/mail/[username] (in the Ubuntu/Debian universe, this is where they live anyway).
I found more details in another thread listed below:
https://unix.stackexchange.com/questions/23277/where-does-postfix-store-email
Mbox format described:
http://en.wikipedia.org/wiki/Mbox
https://www.rfc-editor.org/rfc/rfc4155

Preventing Recipients from getting an email. - How Email Processing Works?

When you send an email with this:
From: Jeff#yahoo.com
To: XXX#aol.com, XXX#aol.com, XXX#aol.com
CC: james#gmail.com
Which Mail Server sends the message via email to the recipients in the TO & CC field? Is it the SMTP server or the server owned by the recipient (like aol.com)?
When you write an email and send it, you will hand it off to some SMTP server you have access to. That server will then contact the recipients server (or intermediate server) and deliver the email to that SMTP server. The SMTP server on the receiving end will somehow, depending on their setup, deliver the email to their users.
In your example, you will properly give yahoo.com's SMTP server the email. Then that server will contact aol.com and deliver the email there. It will also contact gmail.com and deliver the email to their SMTP server.
You should read this part of the SMTP rfc which have a very good explanation about the process.
How you will go about preventing that an email is delivered, is to somehow control one of the SMTP servers that is contacted in the process - or not send the email at all. When you see the email delivered in your own mailbox, it is properly way to late trying to prevent the other recipients receiving the email.

Retrieve SMTP response of a mail

Is it possible to retrieve the SMTP response of a mail. For example, I am sending a mail to non existing email id. Surely our server will send us a mailer daemon failure mail to our mail id. I need to capture that failure mail.
How its possible? please explain me. Some time we may enter more than one non existing email id, so i have to retrieve all the failure mail alone for every corresponding emails
Please guide me!
Thanks in advance,
Praveen J
I think I understood your question correctly now. As I understand, you are writing an application to send mail. And in your application, whenever you send a mail, you also want verify that if mail was delivered and also if it was not delivered then you want to get hold of the failure message in your application. Is that how you mean?
Well, if that is how you mean, then I think it is impossible to track the mail status with your apllication code. For instance if you are using java sendMail in your apllication you can only ensure that the send happened from your code successfully(without any send exceptions like java.net.SocketException or javax.mail.MessagingException). But, you can never ensure if the mail really reached the recepient. i.e. you can never track in your application if the mail was rejected due to wrong recepient address or any other error like illegal attachment at receipient mail server or errors like blocked sender id etc.
That is because any such error condition will be communicated by the receipient mail server to the sending mail server the information of which is present in the sent mail's header.
Does that answer your question? (Or did I understand your question correctly? ;-))
I am not sure if I am getting your question right. If you send an email to any non existent address say xxx#gmail.com from your address yyy#yourhost.com, the mail server at gmail.com replies to the mail server at yourhost.com with failure message and reason, with your delivery address and you receive the fialure mail automatically. you don't have to do anything extra in this.
If you are talking about seeing mail headers, then it depends on which client you are using. For instace, if you are using MS outlook, you can right-click on the message and click options and then see internet headers section to get mail headers. If you are using some web based mail then i am sure there will some option to view detailed mail headers.
The bounced messages are going to return to a mailbox. You should be able to configure that mailbox by properly setting the headers on the messages you send out. You would then need to monitor that mailbox, or have that mailbox deliver the messages to your program.
I would suggest you consider using VERP for all messages you send out. It will make it much easier for you to identify which email address a particular bounce belongs too. To do this you would need control of your mail server though. It takes some work configuring things.
To answer the question with more detail you need to tell us how your are sending messages, what type of mail server you are running, and how much control you have over the mail server.
On Unix, you can use "procmail" for this. Procmail is a service which can intercept your mails and process them following rules.
If you can access your mail my IMAP, I suggest to look at the Python module imaplib.