[ubuntu] sendmail : 우분투에서 sendmail을 설정하는 방법? [닫은]

우분투에서 sendmail을 구성 할 때 명확한 대답을 얻지 못합니다. 각각의 사람들은 내가 말하는 것을 알고 있다고 가정합니다.

전자 메일 전송을 활성화하기 위해 기본 구성을 원합니다. 기본적으로 Google app 엔진과 함께 사용하여 dev 서버에서 메일을 보낼 수 있습니다.

나는 이미 이것을했다 :

sudo apt-get install sendmail

그때

sudo sendmailconfig

그러나 나는 마지막 것이 실제로 무엇을했는지 모른다.



답변

입력시 sudo sendmailconfigsendmail을 구성하라는 메시지가 표시되어야합니다.

참고로 구성 중에 업데이트되는 파일은 다음 위치에 있습니다 (수동으로 업데이트하려는 경우).

/etc/mail/sendmail.conf
/etc/cron.d/sendmail
/etc/mail/sendmail.mc

sendmail을 테스트하여 명령 행에 다음을 입력하여 올바르게 구성 및 설정되었는지 확인할 수 있습니다.

$ echo "My test email being sent from sendmail" | /usr/sbin/sendmail myemail@domain.com

다음은 sendmail에 smtp 릴레이를 추가 할 수있게합니다.

#Change to your mail config directory:
cd /etc/mail

#Make a auth subdirectory
mkdir auth
chmod 700 auth

#Create a file with your auth information to the smtp server
cd auth
touch client-info

#In the file, put the following, matching up to your smtp server:
AuthInfo:your.isp.net "U:root" "I:user" "P:password"

#Generate the Authentication database, make both files readable only by root
makemap hash client-info < client-info
chmod 600 client-info
cd ..

sendmail.mc에 있지만, 다음 줄 추가 하기 전에MAILERDEFINITIONS. smtp 서버를 업데이트하십시오.

define(`SMART_HOST',`your.isp.net')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash -o /etc/mail/auth/client-info.db')dnl

sendmail.cf 생성을 호출하십시오 (또는을 실행하십시오 make -C /etc/mail).

m4 sendmail.mc > sendmail.cf

sendmail 데몬을 다시 시작하십시오.

service sendmail restart


답변

하나의 작은 편집 후 최고 답변이 작동합니다 (아직 회신 할 수 없음)

이것은 나를 위해 작동하지 않았다 :

FEATURE('authinfo','hash /etc/mail/auth/client-info')dnl

각 문자열의 첫 번째 작은 따옴표는 다음과 같이 백틱 (`)으로 변경해야합니다.

FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl

변경 후 내가 실행 :

sudo sendmailconfig

그리고 나는 사업에 있습니다 🙂


답변

위의 두 가지 대답을 결합하면 마침내 작동합니다. 그냥 않도록주의 각 문자열에 대한 첫 번째 작은 따옴표는 역 따옴표 (`)는 파일 sendmail.mc에가.

#Change to your mail config directory:
cd /etc/mail

#Make a auth subdirectory
mkdir auth
chmod 700 auth  #maybe not, because I cannot apply cmd "cd auth" if I do so.

#Create a file with your auth information to the smtp server
cd auth
touch client-info

#In the file, put the following, matching up to your smtp server:
AuthInfo:your.isp.net "U:root" "I:user" "P:password"

#Generate the Authentication database, make both files readable only by root
makemap hash client-info < client-info
chmod 600 client-info
cd ..

#Add the following lines to sendmail.mc. Make sure you update your smtp server
#The first single quote for each string should be changed to a backtick (`) like this:
define(`SMART_HOST',`your.isp.net')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl

#run
sudo sendmailconfig


답변