-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpostfix-mail-server
60 lines (38 loc) · 2.07 KB
/
postfix-mail-server
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
### #########################################
### Create a daemon owner, the postfix user
### #########################################
#sudo useradd -d /dev/null -s /bin/false username
#Creates a user who's home directory = /dev/null
#And who's login = /sbin/nologin
#Therefore user won't have a home directory and can't login to shell.
$ sudo useradd -d /dev/null -s /bin/false postfix
Show user information on the system
$ getent passwd
### ##########################################
### Install the packages
### ##########################################
$ sudo pacman -S openssl postfix
### ##########################################
### Set up DNS record for email.
### ##########################################
A records
@ example.com
mail @
www @
MX records
10 mail.example.com
An MX record should point to the mail host. Usually this is done from configuration interface of your domain provider.
A mail exchanger record (MX record) is a type of resource record in the Domain Name System that specifies a mail server responsible for accepting email messages on behalf of a recipient's domain.
When an e-mail message is sent through the Internet, the sending mail transfer agent queries the Domain Name System for MX records of each recipient's domain name. This query returns a list of host names of mail exchange servers accepting incoming mail for that domain and their preferences. The sending agent then attempts to establish an SMTP connection to one of these servers, starting with the one with the smallest preference number, delivering the message to the first server with which a connection can be made.
### #########################################
### Postfix setup
### #########################################
/etc/postfix/main.cf #this is the main config file.
/etc/postfix/master.cf #global settings.
Run the command:
$ postfix check
It should output anything that you might have done wrong in a config file.
To see all of your configs, type
$ postconf
To see how you differ from the defaults, try postconf -n.
$ sudo systemctl restart postfix.service