Tutorial on how to set up an mail mail server under Ubuntu

  • 2020-05-30 21:57:53
  • OfStack

preface

We have their own website, of course, also want to get their own mailbox, although not 1 will be used, but do 1 of their own domain name mail system is still very cool. (provided you have already purchased the domain name)

1 some complex file configuration and instruction operation is not a detailed study, after all, now also do not use, the following is a simple build can send and receive mail server.

Install PostFix

postfix is our mail server $sudo apt install postfix Can be installed.

Once we've installed our service, we'll use it to send emails.

(note that the local email address at this time is the current "username @ domain name", so the process of registering your own mailbox is actually the process of adding users)

email

bash enter $telnet localhost 25 , that is, log in the mail service port of the machine and enter the postfix prompt:


myths@Business:~$ telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 Business ESMTP Postfix (Ubuntu)

Then enter the text in the following format:


ehlo localhost
mail from: myths@localhost
rcpt to: test@localhost
data
Subjet: My first mail on Postfix
Hi,
Are you there?
regards,
Admin
.
quit

After ehlo, enter a name, mail from: enter your own email address, rcpt to: enter the email address of your destination, data: enter the body of your email address and enter" < enter > < point > < enter > "Marks the end of the text.

Finally, enter quit to close the terminal.

Install mailutils

with $sudo apt install mailtuils Install, and then you can use the tool to check your email.

email

Login to the user who needs to receive mail, enter mail, and you can enter the terminal of mail. This will prompt something like the following:


myths@Business:~$ mail
"/var/mail/myths": 1 message 1 new
>N 1 myths@localhost 3 5 month  18 14:2 16/393
?

This tells us about unread emails. We can enter the serial number "1" in front of the message to view the information.

Of course, there are many other commands and configurations, but since they won't be available at 1:50, we won't look at them for a while.

With the above method, we can basically use this mail server as a commercial mailbox. However, when exchanging emails with qq mailbox, we found that the text of qq had to be decoded with base64 first... And trouble.

conclusion


Related articles: