I currently use postfix to send mail using @domain1.com addresses, mail reception for this domain are handled directly by my provider (OVH). So far so good mails are sent using DKIM no problem.

However I got to change my domain name to domain2.com. So I bought domain2.com and redirected it to the same server as domain1.com. The problem is that this time I want to use my own Mail server for sending and receiving. So

I did reconfigure postfix to handle Virtual host for domain2.com. This works nicely.

Now I would like to send email from domain2.com AND domain1.com but I can't find how to do that since domain2.com is a virtual host.

Whenever a mail is sent from a user on my server, it'll have domain1.com (myorigin parameter from postfix config ?)

So how would you send mail with a virtual account from domain2.com?

Hope I was clear!

  • Which client would you like to use to send your mail from domain2.com?
    – dan
    Feb 8 at 9:57

2 Answers 2


By using a sender address that contains domain2.com, of course.

  • Well even if the tone is a bit condescending you're right, for whoever read this, sendmail has a -f do to such things Apr 27, 2012 at 7:07
  • Excuse me ? Where did you mention sendmail(1) ? I am not a mind reader.
    – adaptr
    Apr 27, 2012 at 10:57
  • Well I did put that in the tag but it has been edited. Apr 27, 2012 at 11:54
  • If you'd tagged it as sendmail that would mean the MTA, not the program...
    – adaptr
    Apr 27, 2012 at 13:54
  • 1
    So offload this task to somebody who is.
    – adaptr
    Apr 27, 2012 at 14:24

You can't achieve this at the Postfix config level since you have a uniq config for 2 domains. You have to work at the MUA ( email client ) level.

If your email client use the EMAIL variable, you can easily achieve sending from domain2.com by setting this variable as follows:

export EMAIL

your email client will place the -f bob@domain2.com where it suits within the flow of arguments passed to sendmail(1) which will build a mail with:

From bob@domain2.com

as wanted.

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.