<div dir="ltr"><div class="gmail-post-text">

<p>I want to forward all mail for root (so basically the output of all 
cron jobs but other mails for root as well) to an external email address
 (hotmail). I also have a Mailscanner setup on this FreeBSD mail server. I have incoming/outgoing and submit profiles. However I don't know exactly how MailScanner sends the mails once they have been checked. My sendmail configuration looks right. However it's not working ( I see <a href="mailto:root@mail.domain.com">root@mail.domain.com</a> as from address in the logs when trying with sendmail -froot <a href="mailto:myhotmail@hotmail.com">myhotmail@hotmail.com</a>).<br></p>

<p>Easiest method would be to use the aliases file. I updated the root alias:
root: <a href="mailto:mymail@hotmail.com">mymail@hotmail.com</a>
And ran newaliases.</p>

<p>When an email is sent I see that the hotmail MX server "accepts" my 
mail. Standard MS Security through obscurity makes me think it's 
silently discarding my email ( not in junk mail, ... ).</p>

<p>This server is used to send/receive mail for a domain (and more domains in the future).</p>

<p>I've checked the logs and it seems the mail is sent with from field of : <a href="mailto:root@mail.domain.com">root@mail.domain.com</a></p>

<p>I'm pretty sure this is at the root of my mail never received in my hotmail.
The existing email addresses are using <a href="mailto:user@domain.com">user@domain.com</a> as from.</p>

<p>Now I would like to rewrite this (mail) from address/ctladdr.
I thought this would be an easy fix with genericstable.</p>

<p>Genericstable (had multiple tries):</p>

<pre><code>root <a href="mailto:info@domain.com">info@domain.com</a>
root@localhost <a href="mailto:info@domain.com">info@domain.com</a>
<a href="mailto:root@mail.domain.com">root@mail.domain.com</a> <a href="mailto:info@domain.com">info@domain.com</a>
</code></pre>

<p>Regenerated the db with makemap.
I tried with different settings.</p>

<p>I also removed the EXPOSED_USER root (from the generic m4 file). I can see it's not in the generated cf file.</p>

<p>I also added root to the trusted users.</p>

<p>In my m4 file:</p>

<pre><code>FEATURE(genericstable)dnl
GENERICS_DOMAIN(<a href="http://domain.com">domain.com</a>)dnl
dnl GENERICS_DOMAIN(<a href="http://mail.domain.com">mail.domain.com</a>)dnl
dnl GENERICS_DOMAIN_FILE(`/etc/mail/generics-domains')dnl
FEATURE(masquerade_envelope)dnl
dnl define(`LOCAL_RELAY', `localhost')dnl
</code></pre>

<p>I have a submit mc file as well. Not sure if this matters but I don't think so.
(I don't have sendmail in MSP mode running as far as I know).</p>

<p>I've tried with GENERICS_DOMAIN as the domain that I want it to be or the domain that I want to be rewritten.</p>

<p>make all install
and restarted sendmail.</p>

<p>Still it just seems to go out as <a href="mailto:root@mail.domain.com">root@mail.domain.com</a></p>

<p>I tried with sendmail in address test mode (bt; tryflags hs and try 
esmtp root). This correctly modifies to the wanted source address: 
<a href="mailto:info@domain.com">info@domain.com</a>.</p>

<p>Anyone has some other ideas why this is not working? Or more 
debugging ways?
Do I need local_relay to make this work? What's expected to be in the 
hosts file? Fqdn(<a href="http://mail.domain.com">mail.domain.com</a>) and hostname(so mail) for 127.0.0.1 ?</p><p>Thanks a lot in advance!</p>
    </div></div>