# Mailserver that sends from a single address via a single relay



## purpleshadow100 (Jun 17, 2009)

How do I configure sendmail to relay all mail through a particular mailserver, and also rewrite the From: header to be a particular address. (the mailserver needs to be authenticated to, and only allows email sent from the authenticated user)

This looks like it should be simple, but I can't get it to work correctly...


----------



## SirDice (Jun 17, 2009)

I only know how to modify the .cf to make it forward all mail to a certain host.

Edit either /etc/mail/freebsd.submit.cf or sendmail.cf (which ever one you use). Look for a line:

```
# "Smart" relay host (may be null)
DS
```
Change that to read something like this:

```
# "Smart" relay host (may be null)
DSmail.someserver.somedomain
```

That will use mail.someserver.somedomain to forward all email.


----------



## DutchDaemon (Jun 17, 2009)

Not the advisable method, though 

Read this threads for .mc based setup:
http://forums.freebsd.org/showthread.php?t=3799&highlight=smarthost
http://forums.freebsd.org/showthread.php?t=4558&highlight=smarthost


----------



## vivek (Jun 17, 2009)

This is 2009 and people still uses horrible sendmail. Switch to postfix. It can route or set smarthost for multiple isp with easy to follow syntax.


----------



## DutchDaemon (Jun 17, 2009)

Nothing horrible about Sendmail. It takes some learning and understanding. A bit like FreeBSD, really.


----------



## VictorM (Dec 29, 2009)

got stuck with authenticating Sendmail with Active Directory, tried Postfix. Slowly killing the last Exchange and buying more hardware with the license monies....


----------

