Server/Linux

PAM을 이용한 SMTP-auth 특정사용자 제한(disable SMTP-auth to specified user with PAM)

minSoong-e 2014. 11. 3. 20:50



참고(reference) : http://www.linux-pam.org/Linux-PAM-html/sag-pam_listfile.html





< 메일 수신을 되게 하면서 발신만 안되게 하고 싶은 경우 ( if specified users only want to receive a mail -> block a heavy mail-sender) >





- 파일 수정 (edit  /etc/alternatives/mta-pam)

#%PAM-1.0

auth      required      pam_listfile.so onerr=fail item=user sense=deny file=/etc/smauth_deny_user  // 한줄( one line )

auth       include      system-auth

account    include      system-auth





- 적용할 사용자파일 생성 ( create a file : /etc/smauth_deny_user )


ex) 

user1     // username

user2

user4





- pam 방식 인증여부 확인 ( confirm PAM  auth-mech )


ex)  if use saslauthd,

/usr/sbin/saslauthd -m /var/run/saslauthd -a pam