Moving IMAP mail to Gmail and retaining correct times - email

I am trying to use gmail to manage mail from an email account I have that is imap only. My strategy was to use (getmail to retrieve mail from the server and pass it through to procmail for forwarding.
This almost works. It successfully retrieves the mail and forwards it on to my gmail account. What it does not do it keep the appropriate "sent" times. That is, an email that I received 3 months ago shows up as me having received it at the time it was forwarded.
So the question is, how can I get these mails forwarded and have their original sent times honored?

You may try to enable imap in your gmail account and use imapsync:
http://freshmeat.net/projects/imapsync/

Related

Plesk - Forward mails to gmail or fetch directly with POP3 in gmail?

Apart from creating a few websites and using it for my own domain to receive my mails, I haven't done much with plesk. When setting up the server, a friend helped me and suggested to me back then (3 or 4 years ago) to use the forward functionality provided by plesk to forward all mail to my gmail address. In gmail i just added my mail-address in the "send mail as" list so I can also send my mails from there.
I'm just wondering now if there is any reason why I shouldn't just let gmail directly check my mail-inbox via POP3.
Sorry, I'm really new to all this mail-server stuff, but I would like to get some input from some more experienced users if there are any security concerns with any of those methods or if it doesn't matter at all.
The problem with pop3 is that you download all mails from your mail-server itself. So the mails were retrieve and were downloaded from the server at the time. This can be a problem if you use a mail-client and store all mails there. In this case you're not able to retrieve your mails at the webmail for example, because the mails are stored in the client.
I would recommend to use IMAP so you can check your mails from the plesk-server at your mobile-phone, mail-client or webmail.

Sending mail by CDO success only if there are two recipients

I use CDO to send emails for years and since last month there is a strange behaviour when the recipient is yahoo. I get an error:
554 5.7.1 : Data command rejected: SMTP authentication is required for Yahoo mail delivery
However, if I enter TWO recipients separated by comma (even the same address twice), there is no problem and the mail goes ok!!!
Has anybody faced such a problem? It's crazy, isn't it?
Well it seems yahoo has introduced a new security check and do does not accept email from unauthenticated senders of any domain (my case).
So If I enter my email smtp password to send email, there is no problem at all.
Please note that I don't hav a yahoo account, my email is #otenet.gr (which permits unathenticated send mail).
PS
However, the security chek is easily bypassed by just having TWO recipients...

User cannot mail themself via Exchange

We currently experience the problem that a user cannot send a mail to herself.
She get the error that she's not allowed to send e-mails from this address.
(You are not allowed to send on behalf of this user...)
Her e-mail address is AAA#domain.com.
(From AAA#domain.com to AAA#domain.com)
She can:
Send e-mails internally
Send e-mails externally
Receive internal e-mails
Receive external e-mails
We make use of Office 2016 and Exchange 2010 14.03.0399.000
I found out that the local address book was corrupt.
Disabled addressbook, deleted the local file and enabled it again.
This solved the issue

Exim - Restrict outgoing email to be from only one address

A bot has found a way to send bulk spam through my server. My server is not an open relay. All mails are coming from localhost. The emails are being sent from a series of FIRSTNAME_LASTNAME#mydomain.com. At mydomain, there is only 1 email account that was created that we send from.
Is there a way to restrict outgoing email that are being sent through exim to only allow emails to be sent from the 1 email account we created and block all other Sent From addressed that are being created?
You have to add the next condition to your SMTP router(s):
condition = ${if match{$sender_address}{legal#mydomain.com}{yes}{no}}
I was able to resolve this by turning on X-Headers which allowed me to locate where the emails were being executed from which in turn allowed me to eliminate an exploit from an old script.

What protocols and servers are involved in sending an email, and what are the steps?

For the past few weeks, I've been trying to learn about just how email works. I understand the process of a client receiving mail from a server using POP pretty well. I also understand how a client computer can use SMTP to ask an SMTP server to send a message. However, I'm still missing something...
The way I understand it, outgoing mail has to make three trips:
Client (gmail user using Thunderbird) to a server (Gmail)
First server (Gmail) to second server (Hotmail)
Second server (Hotmail) to second client (hotmail user using OS X Mail)
As I understand it, step one uses SMTP for the client to communicate. The client authenticates itself somehow (say, with USER and PASS), and then sends a message to the gmail server.
However, I don't understand how gmail server transfers the message to the hotmail server.
For step three, I'm pretty sure, the hotmail server uses POP to send the message to the hotmail client (using authentication, again).
So, the big question is: when I click send Mail sends my message to my gmail server, how does my gmail server forward the message to, say, a hotmail server so my friend can recieve it?
Thank you so much!
~Jason
Thanks, that's been helpful so far.
As I understand it, the first client sends the message to the first server using SMTP, often to an address such as smtp.mail.SOMESERVER.com on port 25 (usually).
Then, SOMESERVER uses SMTP again to send the message to RECEIVESERVER.com on port 25 (not smtp.mail.RECEIVESERVER.com or anything fancy).
Then, when the recipient asks RECEIVESERVER for its mail, using POP, s/he recieves the message... right?
Thanks again (especially to dr-jan),
Jason
The SMTP server at Gmail (which accepted the message from Thunderbird) will route the message to the final recipient.
It does this by using DNS to find the MX (mail exchanger) record for the domain name part of the destination email address (hotmail.com in this example). The DNS server will return an IP address which the message should be sent to. The server at the destination IP address will hopefully be running SMTP (on the standard port 25) so it can receive the incoming messages.
Once the message has been received by the hotmail server, it is stored until the appropriate user logs in and retrieves their messages using POP (or IMAP).
Jason - to answer your follow up...
Then, SOMESERVER uses SMTP again to send the message to RECEIVESERVER.com on port 25 (not smtp.mail.RECEIVESERVER.com or anything fancy).
That's correct - the domain name to send to is taken as everything after the '#' in the email address of the recipient. Often, RECEIVESERVER.com is an alias for something more specific, say something like incoming.RECEIVESERVER.com, (or, indeed, smtp.mail.RECEIVESERVER.com).
You can use nslookup to query your local DNS servers (this works in Linux and in a Windows cmd window):
nslookup
> set type=mx
> stackoverflow.com
Server: 158.155.25.16
Address: 158.155.25.16#53
Non-authoritative answer:
stackoverflow.com mail exchanger = 10 aspmx.l.google.com.
stackoverflow.com mail exchanger = 20 alt1.aspmx.l.google.com.
stackoverflow.com mail exchanger = 30 alt2.aspmx.l.google.com.
stackoverflow.com mail exchanger = 40 aspmx2.googlemail.com.
stackoverflow.com mail exchanger = 50 aspmx3.googlemail.com.
Authoritative answers can be found from:
aspmx.l.google.com internet address = 64.233.183.114
aspmx.l.google.com internet address = 64.233.183.27
>
This shows us that email to anyone at stackoverflow.com should be sent to one of the gmail servers shown above.
The Wikipedia article mentioned (http://en.wikipedia.org/wiki/Mx_record) discusses the priority numbers shown above (10, 20, ..., 50).
You're looking for the Mail Transfer Agent, Wikipedia has a nice article on the topic.
Within Internet message handling services (MHS), a message transfer agent or mail transfer agent (MTA) or mail relay is software that transfers electronic mail messages from one computer to another using a client–server application architecture. An MTA implements both the client (sending) and server (receiving) portions of the Simple Mail Transfer Protocol.
The terms mail server, mail exchanger, and MX host may also refer to a computer performing the MTA function. The Domain Name System (DNS) associates a mail server to a domain with mail exchanger (MX) resource records containing the domain name of a host providing MTA services.
You might also be interested to know why the GMail to HotMail link uses SMTP, just like your Thunderbird client. In other words, since your client can send email via SMTP, and it can use DNS to get the MX record for hotmail.com, why doesn't it just send it there directly, skipping gmail.com altogether?
There are a couple of reasons, some historical and some for security. In the original question, it was assumed that your Thunderbird client logs in with a user name and password. This is often not the case. SMTP doesn't actually require a login to send a mail. And SMTP has no way to tell who's really sending the mail. Thus, spam was born!
There are, unfortunately, still many SMTP servers out there that allow anyone and everyone to connect and send mail, trusting blindly that the sender is who they claim to be. These servers are called "open relays" and are routinely black-listed by smarter administrators of other mail servers, because of the spam they churn out.
Responsible SMTP server admins set up their server to accept mail for delivery only in special cases 1) the mail is coming from "its own" network, or 2) the mail is being sent to "its own" network, or 3) the user presents credentials that identifies him as a trusted sender. Case #1 is probably what happens when you send mail from work; your machine is on the trusted network, so you can send mail to anyone. A lot of corporate mail servers still don't require authentication, so you can impersonate anyone in your office. Fun! Case #2 is when someone sends you mail. And case #3 is probably what happens with your GMail example. You're not coming from a trusted network, you’re just out on the Internet with the spammers. But by using a password, you can prove to GMail that you are who you say you are.
The historical aspect is that in the old days, the link between gmail and hotmail was likely to be intermittent. By queuing your mail up at a local server, you could wash your hands of it, knowing that when a link was established, the local server could transfer your messages to the remote server, which would hold the message until the recipient's agent picked it up.
The first server will look at DNS for a MX record of Hotmail server. MX is a special record that defines a mail server for a certain domain. Knowing IP address of Hotmail server, GMail server will sent the message using SMTP protocol and will wait for an answer. If Hotmail server goes down, GMail server wiil try to resend the message (it will depend on server software configuration). If the process terminates ok, then ok, if not, GMail server will notify you that he wasn´t able to deliver the message.
If you really want to know how email works you could read the SMTP RFC or the POP3 RFC.
All emails are transferred using SMTP (or ESMTP).
The important thing to understand is that the when you send message to someguy#hotmail.com this message's destination is not his PC. The destination is someguy's inbox folder at hotmail.com server.
After the message arrives at it's destination. The user can check if he has any new messages on his account at hotmail server and retrieve them using POP3
Also it would be possible to send the message without using gmail server, by sending it directly from your PC to hotmail using SMTP.
Step 2 to 3 (i.e. Gmail to Hotmail) would normally happen through SMTP (or ESMTP - extended SMTP).
Hotmail doesn't send anything to a client via POP3. It's important to understand some of the nuances here. The client contacts Hotmail via POP3 and requests its mail. (i.e. the client initiates the discussion).