Looking to be able to send emails with attachments from cron job outbound only from system. Have no interest in replacing sendmail with ssmtp or postfix. The system is part of one domain while the email address being submitted to is part of a FQDN domain for email hosted in a remote site. (System name abc123.closedsite.local and email domain is notrealdomain.net) We have a controlled mail relay to which we would send the emails for routing into mail system.
Hope to have a cron job kick off script following automated archiving of BIND DNS logs
I know that sendmail is installed by default but I do not know how to get a basic config onto the system to allow cron job to send email to mail relay host. Have done the listed things below in an attempt to get it configured but do not know if I am on right path.
Have done the following:
Am I on right path or have I done too much or too little?
Hope to have a cron job kick off script following automated archiving of BIND DNS logs
Code:
/usr/bin/echo "Nightly tasks status" >x | uuencode status.txt status.txt | cat x - | mailx -s "Task Status for log archive" -r "donotreply@notrealdomain.net"
"bobsmith@notrealdomain.net"
I know that sendmail is installed by default but I do not know how to get a basic config onto the system to allow cron job to send email to mail relay host. Have done the listed things below in an attempt to get it configured but do not know if I am on right path.
Have done the following:
[cmd=]cp freebsd.mc ${HOST}.mc[/cmd]
[cmd=]cp freebsd.submit.mc ${HOST}.submit.mc[/cmd]
Edited ${HOST}.mc and addedCode:MASQUERADE_AS(`notrealdomain.netâ€) FEATURE(`masquerade_envelope’)
Edited /usr/share/sendmail/cf/domain/generic.m4 and didCode:dnl # EXPOSED_USER(`root’)
Then [cmd=]make all install[/cmd] from within /etc/mail/.
Restart daemon => [cmd=]make restart[/cmd] from /etc/mail
[cmd=]vi freebsd.submit.mc[/cmd]
- looked forCode:FEATURE(`msp’, `[127.0.0.1]‘)dnl
Code:FEATURE(`msp’, `[10.10.10.25]‘)dnl
Then [cmd=]make all install[/cmd] from within /etc/mail/
Restart daemon => [cmd=]make restart[/cmd] from /etc/mail.
Added the following to /etc/rc.conf to ensure that system does not accept inbound emails
Code:# Sendmail Settings sendmail_enable="NO"
Followed by:
[cmd=]/etc/rc.d/sendmail restart[/cmd]
-
Edit /etc/mail/sendmail.cf to modify
Code:# "Smart" relay host (may be null) DS
Code:# "Smart" relay host (may be null) DSmailrelay.notrealdomain.net
Then [cmd=]make all install[/cmd] from within /etc/mail/.
Restart daemon => [cmd=]make restart[/cmd] from /etc/mail.
Am I on right path or have I done too much or too little?