Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

First, here are the entries I added/modified in /etc/postfix/ file:

mydomain =
myorigin = $mydomain
relayhost =
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-certificates.crt
smtp_use_tls = yes
smtp_tls_security_level = encrypt
smtp_tls_note_starttls_offer = yes
header_checks = regexp:/etc/postfix/header_checks

Now, if I send a test mail like so...

$ sudo sendmail
Subject: Test email!
This is just a test email.

and check the mail log (/var/log/mail.log), I see this:

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: from local; from=<> to=<>: From: "WebsiteName Alerts (no reply)" <>
Feb 17 04:23:16 hostname postfix/cleanup[6230]: B3DD4137ED: message-id=<>
Feb 17 04:23:16 hostname postfix/qmgr[6144]: B3DD4137ED: from=<>, size=353, nrcpt=1 (queue active)
Feb 17 04:23:18 hostname postfix/smtp[6232]: B3DD4137ED: to=<>,[]: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

As you can see, the log shows both and as from even though I specifically stated in the sendmail command.

That too, despite modifying my /etc/aliases file like so:

# /etc/aliases

So, the question is, how do I make the default email address-out for the system? Put it the other way, how do I change the email address of root user from to

In case this matters, my system's running Debian 7 (Wheezy) 64-bit.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

There is no default return e-mail address other than the user name combined with domain name. As you invoke the sendmail with sudo, it uses the root user name to make the envelope return address. To change this behavior use the -f switch with sendmail:

   -fname Sets the name of the ``from'' person (i.e., 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.
share|improve this answer
Maybe you didn't understand my question. When I send the mail, and the email is received at the other end, I do see that the email is sent by itself. The thing is, the mail.log shows that the for from is internally replaced with before the email is sent. Or does it mean that the root user passes on the email from locally to for the latter to send it? Am I clear? – its_me Feb 17 '13 at 5:41
I am sorry, not really. You typed in the From: header already containing address at submission. The From: header and the envelope from address is not the same thing. Please check the Return-Path: header in the headers of the received e-mail. This address will be used to return any Delivery Status Reports when delivery fails, not the address in the 'From:' header. – Serge Feb 17 '13 at 6:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.