Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
37
rated 0 times [  37] [ 0]  / answers: 1 / hits: 52273  / 2 Years ago, tue, november 23, 2021, 6:02:34

I just install postfix and configured it for local email only as a way to have a sendmail program and test my PHP scripts.



My question is, how can I use an HTML capable email client like Thunderbird to read local (root email, etc.) emails?


More From » thunderbird

 Answers
1

(When I am discussing the setup below, I am using desktop Ubuntu 12.04)



Now that you have installed postfix (it can be reconfigured with sudo dpkg-reconfigure postfix) and now there is a file called main.cf in /etc/postfix, Thunderbird can be set up to read any system emails. However, I have found that it often takes a bit more time than has been suggested if you want to both receive from and send messages to root@localhost.



First, as recommended in this discussion what worked for me was to use postfix's aliases feature to allow mail to be redirected; edit the aliases file with sudo nano /etc/aliases so that it looks like this (replace my user name with your own):



postmaster:    root
root: mike


Then run sudo newaliases so that the configuration is updated.



As also noted in the above link, you need to create a .forward file containing your username and localhost: e.g. mike@localhost so that root's mail will be forwarded to you. To do this, enter these commands:



sudo touch /root/.forward


and then run



sudo nano /root/.forward


to place your user: e.g. mike@localhost in the file and save it.



In addition, I found it was necessary to add your user to the mail group so that Thunderbird could access the mail files:



sudo adduser $USER mail


and then logout and login for the changes to take effect. There is no need to chown or chmod any files, as some articles might suggest.






Now for the Thunderbird configuration. Go to edit > account settings > account actions > add other account > select Unix spoolmail 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



Now, go to your new account in account settings and select server settings and select the local directory as /var/mail or /var/mail/username (if setup), as in the screenshot below.



enter image description here



As per the instructions in this article you will need to configure the smtp server if you want to test the account by sending a mail to root@localhost and then clicking get mail in Thunderbird to receive it, as root's mail is being redirected to youruser@localhost.



Go to account settings > outgoing server and choose to add a new one. The settings should be as in the screenshot below:



enter image description here



Now, finally test your account by composing a mail to root@localhost and then a few seconds later clicking get mail on your account. You should see an email like this:



enter image description here



Some programs or logs will need to be configured so that they send mail to root, but that can be decided as you find the need. This article should hopefully be useful as it is not always straightforward to set up Thunderbird to receive local mail.


[#35347] Thursday, November 25, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
olouredping

Total Points: 259
Total Questions: 100
Total Answers: 121

Location: New Caledonia
Member since Wed, Sep 15, 2021
3 Years ago
olouredping questions
;