Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

thanks

share|improve this question
    
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

1 Answer 1

I've send this way:

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

<h1>Hi</h1>
EOTMARKER
####

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.

share|improve this answer

Your Answer

 
discard

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.