ssmtp를 사용하여 시스템 사용자에게 이메일을 보내기 위한 설정은 어디에 있습니까?

ssmtp를 사용하여 시스템 사용자에게 이메일을 보내기 위한 설정은 어디에 있습니까?

이메일 전송 에 사용합니다 ssmtp(아래 설정).

cron이제 하나 이상의 명령을 실행하면 at메일이 다음으로 전송됩니다.

michel@mypi

이것은username @ machinename

물론 이것은 유효한 이메일 주소가 아니므로 Gmail에서 오류가 발생합니다.can't send email to michel@mypi

사용자 "michel"에게 보낸 이메일을 특정 이메일 주소로 보내야 한다고 어떻게, 어디서 말해야 합니까?

ssmtp 설정:

#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000 # Make this empty to disable rewriting.
[email protected]

# The place where the mail goes. The actual machine name is required no 
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.gmail.com:465

# Where will the mail seem to come from?
#rewriteDomain=gmail.com

# The full hostname
hostname=MyPi

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address 
# NO - Use the system generated From: address 
#FromLineOverride=YES 
AuthUser=MYNAME
AuthPass=MYPASS
FromLineOverride=YES
UseTLS=YES

답변1

죽은 사람을 일으켜서 미안하지만 Google을 통해 우연히 이 문제를 발견하고 방금 해결했습니다. /etc/ssmtp/revaliases는 FROM: 주소의 별칭일 뿐입니다.

TO: 주소에 대한 별칭은 일반적으로 /etc/aliases에 설정되어야 하지만 SSMTP는 이를 읽지 않습니다! 대신 /etc/mail.rc를 편집하고 다음과 같은 줄을 추가해야 합니다.

alias root root<[email protected]>

바라보다http://possiblelossofcision.net/?p=591더 많은 정보를 알고 싶습니다.

2019-05-07 업데이트 - 아래 설명에 따라 패키지의 최신 버전이 이제 EPEL에 있습니다(RedHat 배포판 제품군을 사용하는 경우).하다문서 를 읽어 /etc/aliases보고 버전을 확인하세요!

답변2

별칭을 입력하려면 /etc/ssmtp/revaliases 파일을 사용하세요.

michel:[email protected]:smtp.gmail.com:465

답변3

이 시도:

Gmail을 사용하여 명령줄을 통해 한 줄 이메일을 보내는 가장 쉬운 방법은 무엇입니까?

발췌:

root=rpi3abc@gmail
mailhub=smtp.gmail.com:465
FromLineOverride=YES
[email protected]
AuthPass=testing123
UseTLS=YES

관련 정보