Sending an email using the hosts file

User Help for Mozilla Thunderbird
Post Reply
david835
Posts: 21
Joined: May 5th, 2014, 6:06 am

Sending an email using the hosts file

Post by david835 »

I'm trying to use the hosts file on Windows to allow me to send an email to (say) example.com using Thunderbird. This makes sense because I actually have an email server at the IP address (it is a new account at a new hosting company that I am migrating to).

I made an Addon domain for example.com (not the real domain name) using cPanel, and created a new account for name@example.com using cPanel.

Here is the line in the hosts file:
1.1.1.1 example.com

I'm using 1.1.1.1 and example.com here, but the actual data is different, of course.

I've also tried adding
1.1.1.1 mail.example.com
1.1.1.1 pop.example.com
1.1.1.1 pop3.example.com

In all these cases, my sent email is returned to sender with an error message like the following:

Code: Select all

 
  name@example.com
    The mail server could not deliver mail to name@example.com.  The account or domain may not exist, they may be blacklisted, or missing the proper dns entries.

Reporting-MTA: dns; root.springtimesoftware.com

Action: failed
Final-Recipient: rfc822;name@example.com
Status: 5.0.0
If this is a known bug (which I guess is possible), what is the workaround? Can I somehow use my new IP address as the mailserver name or the destination address or something?
====
Windows 10 Home
TB 60.9.0
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: Sending an email using the hosts file

Post by tanstaafl »

The allow local addresses add-on at https://addons.thunderbird.net/en-US/th ... src=search let you send email to addresses with no domain (such as on a corporate LAN). Unfortunately the add-on only formally supported up to version 16, and a comment mentions it broke with 38.2.0.

However, I don't understand why you want to do this. You can't easily configure your new host to use the old domain? That's a pretty common task, especially if both used cpanel.
david835
Posts: 21
Joined: May 5th, 2014, 6:06 am

Re: Sending an email using the hosts file

Post by david835 »

If my new host uses my old domain, then I still have no way of testing the new domain, do I? I need to test the new email so I can fix problems before changing the zone nameservers at the domain registry. This is a common task, yet there is nothing on the Web about it. There is plenty about testing websites using the hosts file, but nothing about mailservers.

Can anyone help?
morat
Posts: 6421
Joined: February 3rd, 2009, 6:29 pm

Re: Sending an email using the hosts file

Post by morat »

Omit.
Last edited by morat on October 1st, 2019, 8:32 am, edited 1 time in total.
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: Sending an email using the hosts file

Post by tanstaafl »

https://blog.kasson.com/the-bleeding-ed ... providers/ and http://www.how2lab.com/internet/email/moving-emails.php are two examples you might find useful.

You need to keep access to your old host for about 4 days after starting the transition due to the delay in DNS propagation. You'd forward any messages you get on your old host using webmail to your new host. You will probably need to temporarily use IP addresses for the mail server name (NOT the email address) in the new account in Thunderbird. Afterwards replace the ip address with the real mail server names and use the browse button in the server settings to reuse the old local directory (whose name was set when you used IP addresses).

If you're using a POP account in Thunderbird I'd suggest you move the messages to "Local Folders", delete the old account, add the new account (using the new host) and then move the messages to the new POP account. If you're using a IMAP account it would be nice to drag and drop folders between 2 accounts but it would be safer to move the folders to Local Folders, and after things settle down move them to the new IMAP account.

Make certain you don't lose access to your old webmail until you've verified that everything has been moved and there have been several days of no more new mail at the old host. The most common problem I've seen in people moving between cpanel hosts is getting rid of the old host too soon. The next most common problem is trying to save small amounts of time by taking shortcuts rather than focusing on whats the safest way.
Post Reply