Simple knowledge of Linux postfix Mail

Source: Internet
Author: User
Tags imap dovecot

1. Accept mail and send mail

1.1 Configuring local DNS Resolution

Before you configure the message to install bind, Configure the local DNS resolution on the server, here we simply configure, you can see http://13132323.blog.51cto.com/ 13122323/1955802 this blog post.

[[email protected] ~]# vim /etc/named.conf 11//       listen-on port 53 { 127.0.0.1; }; 12//       listen-on-v6 port 53 { ::1; }; 17//       allow-query     { localhost; }; #在这个文件中注释掉下面的3行等于全部开启 # Add two new tags to the following file [email  protected] ~]# vim/etc/named.rfc1912.zoneszone  "Westos.com"  IN {        type master;       file  " Westos.com.zone ";       allow-update { none; };};  zone  "Qq.com"  IN {       type master;        file  "Qq.com.zone";        allow-update  { none; };}; #编辑我们标签中指定的本地解析文件 [[email&Nbsp;protected] ~]# cp -p/var/named/named.localhost /var/named/westos.com.zone[[email  protected] ~]# vim/var/named/westos.com.zone$ttl 1d@    in soa   dns.westos.com.root.westos.com.  (                   0       ; serial                   1D       ; refresh                   1H      ; retry                   1W       ; expire                   3H)     ; minimum        NS       dns.westos.com.dns       A       172.25.254.231westos.com.    MX 1       172.25.254.231. [[Email protected] ~]# cp -p/var/named/westos.com.zone /var/named/qq.com.zone[[email  protected] ~]# vim /var/named/qq.com.zone$TTL 1D@       IN SOA  dns.qq.com. root.qq.com.  (                   0       ;  serial                   1D      ; refresh         &nbsP;         1h      ; retry                   1w       ; expire                   3H)     ; minimum        NS      dns.qq.com.dns        A      172.25.254.231qq.com.        mx 1         172.25.254.131. [[email protected] ~]# dig -t mx  qq.com# Modify your server and client DNS are both host IPs for Sersver [[email protected] ~]# dig -t mx  qq.com# on server and client dig if parsing is successful, This indicates that the DNS resolution is successful

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/00/2F/wKiom1mYQybDrwHFAAFgmgahB9Q080.png "title=" Screenshot from 2017-08-19 15-21-23.png "width=" "height=" 263 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:500px; height:263px; "alt=" Wkiom1myqybdrwhfaafgmgahb9q080.png "/>

1.2 Mail to send accepted commands and ways

Postfix provides SMTP protocol for posting mail, default port 25/var/log/maillog # #服务日志mail [email protected]subject:hello# mail name Hello world. #用 "." To end the entry and send MAILQ # #查看邮件队列postqueue-F # #重新处理邮件队列默认情况下邮件端口只在127.0.0.1 on, local loopback interface.

1.3  Configure receiving of messages (server as receiver)

[[Email protected] ~]# vim /etc/postfix/main.cf116 inet_interfaces = all                 # #25端口开启的网络接口  76 myhostname = westosmail.westos.com            # #指定mta主机名称83  mydomain = westos.com                  # #指定mta的域名99  myorigin = westos.com                  ## Specify end of message source (character content after @) 164 mydestination =  $myhostname,  $mydomain, localhost  ## Receive end-of-message character designation [[email protected] ~]# systemctl restart postfix.service# setting your hostname, must and file/etc /POSTFIX/MAIN.CF consistent [[email protected] /]# hostnamectl set-hostname qqmail.qq.com[[ Email protected] ~]#&nbSp;hostnamectl set-hostname westosmail.westos.com[[email protected] ~]# systemctl  stop firewalld# in the client to send a message to the server, on the server side view #client the same configuration, only the hostname and the domain and the server is different, here will not repeat

1.4 Test mail Service with remote host

[[email protected]/]# telnet172.25.254.231 25Trying 172.25.254.231...Connected to 172.25.254.231.Escape character is ' ^ ] '. westos-mail.westos.com ESMTP postfixehlo hello250-westos-mail.westos.com250-pipelining250-size 10240000250- vrfy250-etrn250-enhancedstatuscodes250-8bitmime250 dsnmail from:[email protected]250 2.1.0 ok# view from [email protected] Message # Below is a message sent to [email protected] rcpt to:[email protected]250 2.1.5 Okdata354 End data WITH<CR><LF>.<CR ><lf>adsfasdfasdf.
2. Manage Mail Dovecot

Given the user name, user password, dovecot program for us to see this user's mail file

2.1 Dovecot used to provide the receiving agreement

POP3 110

IMAP 143

Imaps 993

Pop3s 995

2. Installing the Client Software

[Email protected]/]#

3. Configure Dovecot

On the server

[Email protected] ~]# VIM/ETC/DOVECOT/DOVECOT.CONF24 protocols = IMAP POP3 LMTP48 login_trusted_networks = 0.0.0.0/049 di Sable_plaintext_auth = no[[email protected] ~]# vim/etc/dovecot/conf.d/10-mail.conf30 mail_location =mbox:~/mail:I Nbox=/var/mail/%u[[email protected] ~] #systemctl Restart dovecot# send an e-mail to the student user [email protected] ~]# mail Studentsubject:testi use Dovecot software. Eot[[email protected] ~]# su-student[[email protected] ~]$ mkdir mail/.imap/-p[[email protected] ~]$ touch Mail/.imap /inbox

Install mutt software on your client

[email protected]/]# Yum install muttmutt-f pop://[email protected]

First Login to press A to receive this connection, and then enter The password that lets you enter the student user, enter

Right after entering the following page:

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/00/35/wKiom1mZGQnhgQzxAABipMODpbc909.png "title=" Screenshot from 2017-08-19 16-42-43.png "width=" "height=" 124 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:500px; height:124px; "alt=" Wkiom1mzgqnhgqzxaabipmodpbc909.png "/>

view its content, which is the email that our root user sent to student.

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/9E/E5/wKioL1mZIcbgbf4nAAChvmDKBSA332.png "title=" Screenshot from 2017-08-19 16-43-43.png "width=" "height=" 174 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:500px; height:174px; "alt=" Wkiol1mzicbgbf4naachvmdkbsa332.png "/>



This article is from the "13122323" blog, please be sure to keep this source http://13132323.blog.51cto.com/13122323/1957804

Simple knowledge of Linux postfix Mail

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.