How to set the mail command to receive e-mail?

I have set the ”~/.mailrc“ as follows:

account gmail {
        localopts yes
        set v15-compat
        set from="xxxxx@gmail.com(lijunjie)"
        set mta=smtp://xxxx:xxxxx@smtp.gmail.com:587 smtp-use-starttls
}

I can send email through the command line now, like

echo "Hi" | mail -s "Test configuration of S-nail" --account=gmail xxx@xxx.com

But when I want to receive e-mail, after I input the mail, it has the following errors:


❯ mail                                                                                                                       ─╯
mail: /var/spool/mail/xxx: No such entry, file or directory
mail version v14.9.24.  Type `?' for help
(Currently no active mailbox)
No more mail.
mail: There are messages in the error ring, manageable via `errors' command
?

Is there some settings I’m missing, I can’t fix it myself, can anyone help me?

The following is my system info.

❯ lsb_release -a                                                                                                             ─╯
LSB Version:    n/a
Distributor ID: ManjaroLinux
Description:    Manjaro Linux
Release:        22.0.5
Codename:       Sikaris

You have to create that directory (as root) and set its permissions so that your user account has read and write access on it.

I create the file myself, but when I input s, there is follwing errors:

❯ mail                                                                                                                       ─╯
mail version v14.9.24.  Type `?' for help
/var/spool/mail/xxx: 0 messages
No more mail.
? s
mail: No applicable messages
mail: save: No message of desired type
mail: Synopsis: save: Append [<msglist>] to <file>
mail: There are messages in the error ring, manageable via `errors' command

Those are not errors. It’s just telling you that… :arrow_down:

  1. There are no unread emails in your mailbox; and…
  2. There are messages in the error ring, which you can read by using the errors command.

When all else fails, read the manual. :grin:

But when I input errors, the output is as follows:

mail: There are messages in the error ring, manageable via `errors' command
? errors
   1/1   No applicable messages
   2/1   save: No message of desired type
   3/1   Synopsis: save: Append [<msglist>] to <file>
   4/1   There are messages in the error ring, manageable via `errors' command

I think these are errors, but I don’t know how to solve them.

Have you looked at the manual? Maybe you need to provide a parameter to errors to see the pertinent message. :man_shrugging:

But I can’t receive message. I have send an e-mail to myself.

You probably need to set up fetchmail or postfix for that. As I understand it, mail is not the right tool for that job.

Again: read the manual. :man_shrugging:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.