We help IT Professionals succeed at work.

Issue to Courier

Hi,
I get file "courier-imap-5.0.8.tar" (attached) but am not sure about its setup in Ubuntu. Please help.
courier-imap-5.0.8.tar.bz2
Comment
Watch Question

Distinguished Expert 2019

Commented:
What you have is the source, you have to compile it. Look at readme, install.

What you have will only provide access to emails, it is not a mail transport agent, mail server.

You gave to configure the mta, postfix or .. To use Maildir as that provides unique message naming and does not have to contend with locking if mbox format is used.

To unpack, and untar
Bzip2 -cd<courier-imap-5.0.8.tar.bz2 | tar -xvf
It will unarchive it....
Dr. KlahnPrincipal Software Engineer

Commented:
"Courier-imap" is available through the Debian (hence also Ubuntu) package distribution system.  There should not be a need to build it.

apt-get install courier-imap should install it, plus any dependencies it requires.
HuaMin ChenProblem resolver

Author

Commented:
Thanks to all.
Klahn,

Please advise to issue below.3a.png
nociSoftware Engineer
Distinguished Expert 2019

Commented:

Do you have an internet connection?... if resolving that doesn't work:

This is the DNS info on the name you can put then name with the ip shown in the /etc/hosts files if you can ping the address.


hk.archive.ubuntu.com.  600     IN      CNAME   ftp.cuhk.edu.hk.
ftp.cuhk.edu.hk.        900     IN      A       137.189.4.14


Best would be to solve the connections & name resolution problems though,

Dr. KlahnPrincipal Software Engineer

Commented:
Agree with noci.  The DNS issue should be solved first.  Try doing a 'nslookup hk.archive.ubuntu.com' and see what you get back for an error message.
Fractional CTO
Distinguished Expert 2019
Commented:
Also, before you get to deep into Courier, take a look at Dovecot.

Test them both before making a choice.

Dovecot is faster + far easier to work with.

Suggestion: Best to open another ticket to work your network connectivity issue, as debugging this will inject a large amount of non-IMAP-server comments into this question.

Best to keep questions to a single topic.

Maybe use a subject line of - "Help required getting Ubuntu local DNS working" - or something similar.
Distinguished Expert 2019

Commented:
More /etc/resolv.conf

/etc/nsswitch.conf
Hosts: files DNS


Contrary to David's point, it is unclear what you are looking to do. Courier-IMAP is a sub package of courier mail.
HuaMin ChenProblem resolver

Author

Commented:
I would work with Dovecot and need to resolve issue with Postgresql.

Due to error below, how to resolve it?
6c.png
Distinguished Expert 2019

Commented:
Why are you running sudo to run psql?
The error means postgre user is not authorized in /etc/sudoers and can not run sudo.

Commands MySQL, psql commonly do not require rights elevation to run.
HuaMin ChenProblem resolver

Author

Commented:
What to adjust now, due to this error?

postgres is not in the sudoers file.  This incident will be reported.
Distinguished Expert 2019

Commented:
sudo is only needed or used when you need root (administrative rights) that a standard user does not have.
To run apps like psql, MySQL clients to DB do not require right elevation.
If you need to connect to the database using a different user, use the -u or -U option as applicable

Further sudo -u postgres while logged in as postrgres user is redundant.

sudo -u Postgres cmd when run, is used by userA who has sudo rights to elevate their rights such that userA can impersonate Postgres user when running cmd.

Commonly this is done by admin's when trying to resolve an issue a user may report. I.e. When I do X, I get the following error, or I get Y.

You are already logged in as postrges so elevating to root to then impersonate postgres seems a n unnecessary ...

psql -U root might be what you thought, considered.
nociSoftware Engineer
Distinguished Expert 2019

Commented:

As root user try:   sudo -u postgres -s

To ensure there is a valid  shell there might be an invalid shell configured in /etc/passwd to prevent logins on the postgres account at well.


Distinguished Expert 2019

Commented:
In the image posted, the asker is in the shell as postgres.
nociSoftware Engineer
Distinguished Expert 2019

Commented:

Agreed, -s is needed to avoid other issues. 

Creating postgresql as a regular user makes no sense..., it is meant to have a no-access account as part of the security.

Distinguished Expert 2019

Commented:
Either I am misinterpreting what was posted.
The asker is trying to connect to their postgresql instance using the psql  client

The db user can be specified by use of the -U argyment.

To me it seems the asker got accustomed or perceived the need for rights elevation to perform this task.
HuaMin ChenProblem resolver

Author

Commented:
Hi,
Is there procedure to create Role and grant rights to user?
Distinguished Expert 2019

Commented:
You have to be more specific.
Useradd to add a local user to a Linux/UNIX system
-u user unique ID
-g prinary group
-G additional group's membership
Visudo is the tool to use to setup which users, or groups have elevation rights and to what extent, from ALL:ALL to an explicit list of command a user or a group can run with elevated rights.
The above deals with rights, privileges on the system level.

Then you can grant/create users with applications such as postrgres ql, MySQL, mariadb where you would need to define what rights a username that could be the same as the local system account
The mysql psql

Htpasswd is used to setup http based auth if needed.

sudo is only needed to perform administrative tasks it is an alternative to the original su which requires the password of the root account.
Sudo once a user is authorized prompts for the user's password.
David FavorFractional CTO
Distinguished Expert 2019

Commented:
You mention an issue running psql above.

Best to open a new question to resolve this.