Using Movemail with Thunderbird on Ubuntu

12,422

Solution 1

Read Local Email With Thunderbird

Watch Vido

Step no 1.

      sudo apt-get install postfix -y

If installed

      sudo dpkg-reconfigure postfix

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

configure it for local email, Choose the default settings & use localhost as hostname

Step no 2.

      sudo nano /etc/aliases

And replace root with your user name, My user name is " one "

   postmaster:    root
   logcheck: one

Then run sudo newaliases so that the configuration is updated.

Step no 3.

you need to create a .forward file containing your username and localhost: e.g. one@localhost so that root's mail will be forwarded to you. To do this, enter these commands:

      sudo nano /root/.forward

And add the user-name@localhost e.g. one@localhost in the file and save it.

Step no 4.

      sudo adduser $USER mail

It is necessary to add your user to the mail group so that Thunderbird could access the mail files

Step no 5.

        logout and login for the changes to take effect

Step no 6.

Now for the Thunderbird configuration. Go to edit > account settings > account actions > add other account > select Unix Mailspool and in the next screen put your username in the first box and place yourusername@localhost in the second box.

enter image description here

enter image description here

enter image description here

Server Settings > Browse

enter image description here

Browse > Select /var/mail folder

enter image description here

Outgoing Server , Port 25

enter image description here

Thunderbird will close automatically & then Write an email to root@localhost

enter image description here

enter image description here

Get Mail

enter image description here

enter image description here

Solution 2

Unfortunately, Thunderbird removed the ability to create a "movemail" account as of version 87. Therefore, setting up Thunderbird as described in this answer will not work.

What you have to do, after installing and setting up Postfix, is as described in that same answer, is install and setup dovecot. This would move your mail for you internally, and then you setup Thunderbird. Here are the steps.

  1. Install dovecot:

    sudo apt install dovecot-imapd

  2. Setup Thunderbird. By adding a new account, and setting it as follows:

    • Your Name:

    • Email address: @localhost

    • IMAP Mail Server Settings:

      • Server Name: localhost
      • Port: 143
      • User Name:
      • Password: <either password, or leave empty>
      • Connection Security: None
      • Authentication Method: password, transmitted insecurely
      • When I Delete A Message: Remove It Immediately
      • Local Directory: </home/username/.thunderbird/.default/ImapMail/.machinename>
    • SMTP server settings are:

      • Description: Localmail
      • Server Name: localhost
      • Port: 25
      • Connection Security: None
      • Authentication Method: password, transmitted insecurely
      • User Name:

Please note, for further reading, I used this thread as a reference.

Solution 3

@Qasim hit most of the points, thank you!

Here are some additional tips about file permissions, etc.


1 - But first, before starting, I strongly suggest you backup both your entire ~/.thunderbird/ and /var/mail/ folders.

Use something like this:

$      `cp -a  ~/.thunderbird  ~/.thunderbird~`    #and
$ `sudo cp -a  /var/mail       /var/mail~`

2 - Now, you need to think about file permissions.

You are probably running Thunderbird in a user account, and not from root.

So let's say you're Joe and running Thunderbird. This means that the folders and files that Thunderbird needs to use must be available to Joe.

  • In particular, /var/mail/ needs to allow Joe to read and write files in it, so it either needs to be owned by Joe, or needs to allow group or world permission to Joe.

  • Same for the files within /var/mail/, i.e. your mail spool file(s), e.g. mail, or joe, etc. need to allow Joe to read and write them.

You might have to chown them to Joe, or chmod them to allow Joe to read and write to them.


Note that the older default mail spool location is soft linked to the new default mail spool location, as follows:

`/var/spool/mail` -> `../mail`, i.e. -> `/var/mail`,

3 - Here are screen shots of what worked for me with a few comments:

enter image description here

The following is the address that is used for sending. I found later that I could not forward emails with this as it is, and had to instead replace the 'localhost' in it with a real domain name.

enter image description here

Note, Next won't become active above until you enter a valid domain name, in this case 'localhost'.

enter image description here

enter image description here

enter image description here


4 - Next we need to point this new account to /var/mail/

But I stumbled here, and Thunderbird for a moment seemed buggy to me. Be sure that you edit the new account's server settings, and not your local folder's settings.

enter image description here

enter image description here

Note: Even after I set the Local directory:, the Message Store Type remains grayed out for me. Perhaps Thunderbird automatically figures this out.


Then it prompts for to restart Thunderbird:

enter image description here

After the reboot I finally get these two folders. Inbox still is empty, but the folders allow me to view, copy print, etc the email in them.

enter image description here


Usage tip: Right clicking on mail@localhost and then selecting Get Messages re-reads my two folders and puts any new message in them into Inbox, before clearing these folders.

Note the new msgFilterFules.dat, Sent, Sent.msf, Trash, Trash.msf and other related .msf files in your mail folder.

Also note that you can have more than one of these accounts. I had noticed that I also had a /home/<username>/mail/ folder and so hooked this up with a 2nd account for debugging.


Now I have to go figure out if exim will allow the new folder and file permission settings... :-.


(For the record, I'm on Debian Stretch 9.6, but otherwise this seems to be the same as for Ubuntu. I'm running Thunderbird 60.3 - 64 bit.)

Share:
12,422

Related videos on Youtube

SPRBRN
Author by

SPRBRN

Updated on September 18, 2022

Comments

  • SPRBRN
    SPRBRN over 1 year

    I'm trying to read local mail with Thunderbird on Ubuntu (with both 12.04 and 13.04). I've followed the instructions found here: How can I access system mail in /var/mail/ via thunderbird?

    I can read mail on the system using alpine or vim, so I know the mailbox is not empty. When I click the get-mail button, nothing happens. I see no Inbox (or any folder structure) for the specific account. I've set the rights for /var/mail to 1777.

    Settings

    • server name: localhost
    • username: john

    How can I get this working?


    Okay, considering the extra bounty, I would like to get this working like normal mail. The accepted answer from Qasim resulted in a much more usable situation than before - opening mail in Thunderbird with layout. I still face three problems though.

    1. When new mail is received in the mailbox, Thunderbird won't see this until after I restart Thunderbird.
    2. When Thunderbird is restarted, all mail is reset to unread and deleted mail is undone. This is probably because Thunderbird reads the mail from the /var/mail/www-data file, but doesn't update this file. So after restarting, it simply reads this file again, with the new mail and all old mail.
    3. This is probably a postfix issue: mail is sent out to existing mail addresses, but cannot be delivered because the receiving mailserver cannot be reached. This results in "Undelivered mail returned to sender". Only one mailserver can be reached: localhost. Because this is a test system, I don't want real customers to receive mail. I've blocked mail ports in UFW to be sure.

    When opening the returned mail, I can scroll down and then I see the original mail with proper layout. So I can read the mail, see if the proper images are included, and for me that's workable. Having to restart TB to read new mail - I know when new mail arrives, so I know when to restart. Having old mail restored after a restart - not big problem as well. I can delete the mail file if it gets too much. I know how it works, but it would be nice if it worked like normal.

    • Qasim
      Qasim almost 11 years
      I am uploading the video on youtube ......w8 1 more hour
  • SPRBRN
    SPRBRN almost 11 years
    Thanks for the long reply. I haven't found the time yet to test it. I'll come back and award the points even if the bounty has expired, if the answer works.
  • Qasim
    Qasim almost 11 years
    @rxt i'll be waiting
  • SPRBRN
    SPRBRN almost 11 years
    I can read mail! On opening TB it reads mail and displays all mail as unread. Trying to fetch new mail does not work and needs a restart. It seems impossible to delete mail in TB.
  • SPRBRN
    SPRBRN almost 11 years
    Some more explanation. Marking mail as being read and deleting mail works, until.... When new mail arrives, all old mail is restored as unread.
  • Qasim
    Qasim almost 11 years
    @rxt no i haven't that issue ..its just i cant delete email...that was fixed by rebooting ....
  • SPRBRN
    SPRBRN almost 11 years
    OK, this is not a big problem. It's a test machine, and I can delete the files manually if needed, if it gets too big. It would be nice to have this working, but it's not a must have.
  • SPRBRN
    SPRBRN almost 11 years
    I want to reward the bonus, but I can't for some reason.
  • Qasim
    Qasim almost 11 years
    @rxt well wait few more hours ....
  • SPRBRN
    SPRBRN almost 11 years
    I've updated the question with three issues I'm still having. It works for me, but it's not perfect. With the extra bounty from Jorge Castro I hope to get this working as well.
  • rubo77
    rubo77 almost 5 years
    It would be great if there was a Debian package that sets up this
  • raj
    raj about 2 years
    Evolution (that was once default email client in Ubuntu before changing it to Thunderbird) still supports both movemail, and even reading the mail directly from local Maildir or mbox type mailboxes without movemail. So maybe switching from Thunderbird to Evolution is an option.