Following problem:

I've installed exim4 on my ubuntu server using this tutorial.

So now I can send emails via terminal with:

echo "This is a test." | mail -s Testing someone@somedomain.com

And I get email from root@mydomain.com

But how to send e-mails from some specific name like My-New-Mail@mydomain.com.

I think I have to create a new Ubuntu user and then to do something to exim4 configuration.

But how exactly? And how to do it secure for my system?


  • You want to send an email from any remote machine to your Ubuntu/exim machine, right? First you would have to configure exim to accept remote connections. Then you have to decide if you want to use virtual or real users. The difference is: Real users can be added by simply adding users to your Ubuntu OS. You should not go this way if you want to configure multiple email addresses for yourself. Virtual users can basically be configured as a list of names for which exim should accept incoming mails. Please tell us what you try to achieve. Then we may help you more in detail. – Oliver Schmidt Jul 23 '12 at 7:35

I've send this way:

cat << EOTMARKER | /usr/sbin/sendmail -t
From: user@domain.tld
To: someone@domain2.tld
Subject: Wow!
Content-Type: text/html; charset="UTF8"


Be sure you have kept empty line between message headers and body - that SMTP require.

Keep in mind, that your MTA can accept message without sender verification, but most other MTA do that. Therefore message from nonexistent user can be (and should be) silently dropped by MTA on the other side.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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