[CentOS] help for creating sendmail virtual users

Alexander Dalloz
Mon, 17 Jul 2006 17:24:54 -0000

ankush grover schrieb:

> hey friends,
>
> I have installed sendmail or it would rather say it comes default with
> the
> centos. I am using Centos4.0 and I am trying to configure sendmail
> with virtual users.
>
> I have created few users for my domain. My internal domain
> (example.com) is
> different from my isp domain (example1.com).
>
> The problem I am facing is that if the user1 at example1.com sends the
> mail to
> the user2 at example1.com then the mails should not go to the ISP rather
the
> server running sendmail should send it to the mailbox of the
> user2 at example1.com but rather it is sending it to the ISP account and
> from
> there it is getting redirected to ther user2 mailbox.

Mail coming from your ISP for domain exampl1.com isn't rejected? Can it
be that you fetchmail the mail?
I ask because I bet you did not configure example1.com to be in class{w}
(means treated to be local). Do so by adding that domain to
/etc/mail/local-host-names. That is a plaintext flat file. Sendmail
daemon restart is necessary.

> I have configured the virtualusertable like this
>
> user1 at example1.com        user1(local account)
> user2 at example.com          user2(local account)
>
> makemap hash virtualusertable.db < virtualusertable
>
> service sendmail reload/restart.

If you "service sendmail restart", then changes to map files are
detected automatically and a "make -C /etc/mail" is run automatically
to
rebuild the hashed map files, the .cf files to if changes to .mc files
happened.

> Now if the mail for the user2 from the user1 the sendmail should
> forward it
> to the user2 mailbox but this is not happening rather sendmail is
> forwarding
> it to the ISP server and from there it is gettting move to the user2
> mailbox.

For local domains neither the smarthost nor mailertable will be used.

echo '$=w' | /usr/lib/sendmail -bt

Prints you out all class{w} domains.

> Second problem I am facing is that how do I configured sendmail to the
> send
> the credentials of each user to the ISP account. For example if user1
> wants
> to send the mail to the Internet the sendmail server should connect to
> ther
> ISP server with this user credentails (username and password ) and if
> user2
> wants to send the mail to ther Internet then the sendmail should
> connect to
> the ISP server with the user2 credentails ( username and password).

http://www.sendmail.org/~ca/email/sm-812.html#812AUTH

It isn't possible to define multiple users for a single relay host target.
(With Postfix you would require release 2.3)

For different relay selections based on the sender there is

http://anfi.homeunix.net/sendmail/smarttab.html

> I have about 25 user accounts and I using sendmail 8.1.13 version.
>
> Please let me know if you need any further inputs.
>
> Thanks & Regards
>
> Ankush Grover
>
Alexander