-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettingMailAgent
More file actions
65 lines (42 loc) · 1.15 KB
/
settingMailAgent
File metadata and controls
65 lines (42 loc) · 1.15 KB
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
61
62
63
64
65
📧 Postfix + s-nail Setup on CentOS
This guide explains how to set up Postfix (mail transfer agent) and s-nail (mail client) on a CentOS machine for local mail delivery.
1. Install Packages
sudo yum install -y postfix s-nail
2. Enable and Start Postfix
sudo systemctl enable postfix
sudo systemctl start postfix
sudo systemctl status postfix
3. Configure Postfix
Edit /etc/postfix/main.cf:
sudo nano /etc/postfix/main.cf
Update/add the following:
myhostname = mail.localdomain
mydomain = localdomain
myorigin = $mydomain
inet_interfaces = all
inet_protocols = ipv4
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
relayhost =
mynetworks = 127.0.0.0/8
home_mailbox = Maildir/
4. Create Maildir
mkdir -p ~/Maildir/{cur,new,tmp}
chmod -R 700 ~/Maildir
5. Restart Postfix
sudo systemctl restart postfix
6. Configure s-nail
Edit ~/.mailrc:
nano ~/.mailrc
Add:
set sendmail=/usr/sbin/sendmail
set from=root@localdomain
set realname="Local Root"
set mbox=+Inbox
set record=+Sent
7. Send Test Mail
echo "This is a test mail" | mail -s "Test Subject" root
8. Check Mail
mail
Inside the mail client:
Press Enter to read messages
Type q to quit