Email envoyé via [email protected] malgré la modification de / etc / alias

Tout d'abord, voici les inputs que j'ai ajoutées / modifiées dans le file /etc/postfix/main.cf :

mydomain = domain.com myorigin = $mydomain relayhost = email-smtp.us-east-1.amazonaws.com:25 smtp_sasl_auth_enable = yes smtp_sasl_security_options = noanonymous smtp_sasl_password_maps = hash:/etc/postfix/sasl/amazon-ses smtp_tls_CAfile = /etc/ssl/certs/ca-certificatees.crt smtp_use_tls = yes smtp_tls_security_level = encrypt smtp_tls_note_starttls_offer = yes header_checks = regexp:/etc/postfix/header_checks 

Maintenant, si j'envoie un mail de test comme ça …

 $ sudo sendmail [email protected] To: [email protected] From: [email protected] Subject: Test email! This is just a test email. . 

et vérifiez le journal de messagerie ( /var/log/mail.log ), je vois ceci:

 Feb 17 04:23:16 hostname postfix/pickup[6226]: B3DD4137ED: uid=0 from=<root> Feb 17 04:23:16 hostname postfix/cleanup[6230]: B3DD4137ED: replace: header From: [email protected] from local; from=<[email protected]> to=<[email protected]>: From: "WebsiteName Alerts (no reply)" <[email protected]> Feb 17 04:23:16 hostname postfix/cleanup[6230]: B3DD4137ED: message-id=<[email protected]> Feb 17 04:23:16 hostname postfix/qmgr[6144]: B3DD4137ED: from=<[email protected]>, size=353, nrcpt=1 (queue active) Feb 17 04:23:18 hostname postfix/smtp[6232]: B3DD4137ED: to=<[email protected]>, relay=email-smtp.us-east-1.amazonaws.com[107.22.250.234]:25, delay=25, delays=24/0.03/0.93/0.58, dsn=2.0.0, status=sent (250 Ok 0000013ce6644ae6-69927d25-c4e1-4f25-8ad4-b85b59318e84-000000) Feb 17 04:23:18 hostname postfix/qmgr[6144]: B3DD4137ED: removed 

Comme vous pouvez le voir, le journal montre à la fois [email protected] et [email protected] à from même si j'ai spécifié spécifiquement [email protected] dans la command sendmail .

Cela aussi, malgré la modification de mon file / etc / aliases comme ceci:

 # /etc/aliases mailer-daemon: [email protected] postmaster: [email protected] nobody: [email protected] hostmaster: [email protected] usenet: [email protected] news: [email protected] webmaster: [email protected] www: [email protected] ftp: [email protected] abuse: [email protected] noc: [email protected] security: [email protected] root: [email protected] 

Donc, la question est, comment puis-je faire [email protected] l'adresse e-mail par défaut pour le système? En d'autres termes, comment changer l'adresse e-mail de l'user root de [email protected] à [email protected] ?

Au cas où cela count, mon système fonctionne Debian 7 (Wheezy) 64 bits.

Il n'y a pas d'adresse e-mail de return par défaut autre que le nom d'user combiné avec le nom de domaine. Lorsque vous appelez sendmail avec sudo, il utilise le nom d'user root pour faire l'adresse de return de l'enveloppe. Pour changer ce comportement, utilisez le commutateur -f avec sendmail:

  -fname Sets the name of the ``from'' person (ie, the envelope sender of the mail). This address may also be used in the From: header if that header is missing during initial submission. The enve‐ lope sender address is used as the recipient for delivery status notifications and may also appear in a Return-Path: header. -f should only be used by ``trusted'' users (normally root, daemon, and network) or if the person you are trying to become is the same as the person you are. Otherwise, an X-Authentication- Warning header will be added to the message.