Postfix
First of all, thank you for your interest in the Postfix project.
What is Postfix? It is Wietse Venema's mail server that started life at IBM research as an alternative to the widely-used sendmail program.
Postfix attempts to be fast, easy to administer, and secure. The outside has a definite Sendmail-ish flavor, but the inside is completely different.
How to install
CentOS
Ubuntu
- [추천] How To Install and Configure Postfix as a Send-Only SMTP Server on Ubuntu 14.04 1
- How To Install and Setup Postfix on Ubuntu 14.04
$ sudo apt-get install mailutils
## 설치시 General type of mail configuration: 'Internet Site' 선택.
## Test That the SMTP Server Can Send Emails
echo "This is the body of the email" | mail -s "This is the subject line" [email protected]
main.cf
postfix 는 /etc/postfix/mail.cf
파일을 통해 동작 제어에 필요한 설정을 할 수 있다. 패키지 설치에 따라오는 기본 설정으로도 외부에 메일 전송은 문제가 없고 이 정도면 필요로 하는 용도로 충분하다. 그러나 혹시 외부에서 보내는 메일의 수신도 하고 싶은 독자라면 다음 설정을 참고하여 설정하면 된다.
# 메일 서버의 도메인 이름을 설정한다. fully-qualified domain name 이어야 한다.
myhostname = mail.example.com
# 도메인 이름을 설정한다. mydomain 을 특별히 설정하지 않을 경우 myhostname 에 설정된 값에서 첫 번째 요소를 제거한 값이 된다.
mydomain = example.com
# inet_interfaces 는 postfix 가 메일을 수신할 때 사용할 네트워크 인터페이스를 지정한다. 기본 값은 localhost 이며 이럴 경우 외부 서버에서 이 서버로 메일 송신이 불가능하다. 이것을 가능하게 하려면 localhost 외에 추가 인터페이스를 지정해야 한다.
inet_interfaces = all
#inet_interfaces = localhost
# mynetworks_style 은 postfix 가 신뢰할 SMTP 클라이언트를 설정한다. host 로 설정할 경우 로컬 머신에서만 메일 송신이 가능하며 subnet 일 경우 현재 서버와 같은 IP 대역을 갖는 서버에서만 연결할 수 있다. 기본 설정은 subnet이며 class 는 보안 문제때문에 추천하지 않는다
mynetworks_style=subnet
# mynetworks 는 mynetworks_style 대신 직접 명시적을 ㅗ허용할 IP나 대역을 지정할 수 있다. 여러 개 지정할 경우 콤마로 구분한다.
mynetworks = 192.168.1.0/24, 127.0.0.0/8
- mydomain (default: see "postconf -d" output)
- http://www.postfix.org/postconf.5.html#mydomain
- The internet domain name of this mail system. The default is to use $myhostname minus the first component, or "localdomain" (Postfix 2.3 and later). $mydomain is used as a default value for many other configuration parameters.
- Example
mydomain = domain.tld
- myhostname (default: see "postconf -d" output)
- The internet hostname of this mail system. The default is to use the fully-qualified domain name (FQDN) from gethostname(), or to use the non-FQDN result from gethostname() and append ".$mydomain". $myhostname is used as a default value for many other configuration parameters.
- Example
myhostname = host.example.com
Docker
To run Postfix just mount your configuration files and start the container:
Kubernetes
See also
- sendmail
- exim
- maddy
- PostfixAdmin - web based administration interface for Postfix mail servers
Favorite site
References
-
How_To_Install_and_Configure_Postfix_as_a_Send-Only_SMTP_Server_on_Ubuntu_14.04.pdf ↩