SMTP

 

(16)

apt -y install postfix

※No configurationを選択

vim /etc/postfix/main.cf

myhostname = mmm151.example.com
mydomain = example.com
myorigin = $myhostname
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 192.168.137.0/24,127.0.0.0/8
disable_dns_lookups = yes

postfix check
postconf -n

newaliases

systemctl enable postfix
systemctl restart postfix
systemctl status postfix

apt -y install bsd-mailx

date | mail -s "mail test" testuser

su - testuser
mail


(18)

apt -y install postfix

※No configurationを選択

vim /etc/postfix/main.cf

myhostname = mmm145.example.com
mydomain = example.com
myorigin = $myhostname
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 192.168.137.0/24,127.0.0.0/8
disable_dns_lookups = yes

postfix check
postconf -n

newaliases

systemctl enable postfix
systemctl restart postfix
systemctl status postfix

 

apt -y install bsd-mailx

date | mail -s "mail test" testuser

su - testuser
mail

 

(9)

apt -y install postfix

※No configurationを選択

vim /etc/postfix/main.cf

myhostname = mmm146.example.com
mydomain = example.com
myorigin = $myhostname
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 192.168.137.0/24,127.0.0.0/8
disable_dns_lookups = yes

postfix check
postconf -n

newaliases

systemctl enable postfix
systemctl restart postfix
systemctl status postfix

 

apt -y install bsd-mailx

date | mail -s "mail test" testuser

su - testuser
mail

 

(7)

yum -y install postfix

vim /etc/postfix/main.cf

myhostname = mmm050.example.com
mydomain = example.com
myorigin = $myhostname
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 192.168.137.0/24,127.0.0.0/8
disable_dns_lookups = yes

postfix check
postconf -n

systemctl enable postfix
systemctl restart postfix
systemctl status postfix

date | mail -s "mail test" testuser

su - testuser
mail

 

 

(2012R2)


http://blog.powerbiz.net.au/exchange/how-to-set-up-an-internal-smtp-service-for-windows-server-2012-essentials/

--動作確認

DNSサーバインストール
Aレコード追加
DNSサーバアドレスに自IPアドレスをセット

$AccountName = "Administrator@example.com"
$SMTPClient = New-Object Net.Mail.SmtpClient("mmm061.example.com", 25)
$MailFrom = "$AccountName"
$MailTo = "$AccountName"
$Subject = "Test"
$Body = "mail test"
$Message = New-Object Net.Mail.MailMessage($MailFrom, $MailTo, $Subject, $Body)
$SMTPClient.Send($Message)

C:\inetpub\mailroot\Queueを確認