Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Its bit difficult to explain but very simple problem.

We have internal sendmail server and hosted server. Both are set to same domain name. We have mixed mail accounts.

For example we have two user in one office. is local only is internal plus external.

Internal means we create user on local linux box where sendmail is set.

External means we create user on local and hosted server. can send mails to any internal user created on Linux box where sendmail is installed. But he can not send mail to outside domain and no mail can be sent to him as there is no account created on external hosted server. can send mails to internal as well as all other domains through sendmail's smart_host feature, which uses hosted server's smtp. can get all external emails internally through Fetchmail on linux box.

Now we have third user who will be always outstation and can use external server only.

So I can not create account on local linux box for because his mail will get delivered locally only. I don't want to create alias and send his mails to gmail or yahoo's account. I want to send emails to his external account from any internal user.

How this can be done? Thanks in advance.

share|improve this question

For the delivery part of email destined for one of these users you can use the "virtusertable" feature. To redirect the email of only some users to an external address, e.g. for your sample users you could add this to your file:

FEATURE(virtusertable, `hash -o /etc/mail/virtusertable')

Then in the /etc/mail/virtusertable file use something like this to deliver email for locally, and email for or* to the remote, hosted server: localuser b@hosted.server somebody@hosted.server

Rebuild the virtusertable.db map by running makemap(1), and Sendmail should be able to handle the delivery part of email ok:

# cd /etc/mail

# makemap hash virtusertable < virtusertable

Controlling which local user is allowed to send email is slightly more involved. You might be able to use "relay_mail_from" and access map entries, but since I haven't actually tried this, I'll let someone else answer with more useful details.

share|improve this answer

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.