# Change ctladdr in sendmail

## cuban

Hello all,

I'm running an internal webapp that needs to send mail to internal users. My problem is our mailserver rejects the domainname because it's invalid.

It appears it reads the ctladdr. I unfortunetly cannot change anything on our mailserver so I need to change the ctladdr on ourbound emails.

It is currently root@netmon.domainname.com. I need it to show root@domainname.com. Any suggestions?

I have this in my /etc/mail/sendmail.mc

```
MASQUERADE_AS(`domainname.com')dnl

FEATURE(masquerade_envelope)dnl

FEATURE(masquerade_entire_domain)dnl
```

TIA, as I'm desperate to get this working.

----------

## jcsbarreto

good night

I am needing to find the same solution to configure sendmail on. What is the solution configuration used?

Thank you.

----------

## zeek

The default sendmail.mc file will have an entry like this:

```

DOMAIN(generic)

```

which doesn't masquerade root's email.  Remove this entry.

You can see the entries that line adds by looking at this file:

```

/usr/share/sendmail-cf/domain/generic.m4

```

Copy the entries except for EXPOSED_USER and paste them into sendmail.mc.  Don't forget to regenerate sendmail.cf

----------

