Backup /etc/mail, the sendmail and makemap binaries, then download the sendmail sources from
ftp://ftp.sendmail.org/pub/sendmail. (I downloaded sendmail-8.11.7.tar.gz, since I had 8.11.6 previously and my only aim was to patch sendmail, you can choose 8.12 branch instead.)
Copy the file into /usr/local, and extract it:
tar -zxvf sendmail-x.xx.x.tar.gz
cd into the newly created sendmail-x.xx.x directory, and follow the step-by-step instructions in the INSTALL file there.
My sendmail.mc file used for the generation of the sendmail.cf file was as follows (my domain: foo.bar, mail domain: mail.foo.bar, my ISP's relay: smtp.myisp.hu):
divert(-1)
divert(0)
VERSIONID(`$FreeBSD: src/etc/sendmail/freebsd.mc,v 1.10.2.8 2001/03/06 02:12:59 gshapiro Exp $')
OSTYPE(bsd4.4)
DOMAIN(generic)
FEATURE(access_db, `hash -o /etc/mail/access')
FEATURE(blacklist_recipients)
FEATURE(local_lmtp)
FEATURE(mailertable, `hash -o /etc/mail/mailertable')
FEATURE(genericstable, `hash -o /etc/mail/genericstable')
FEATURE(always_add_domain)
FEATURE(relay_entire_domain)
FEATURE(virtusertable, `hash -o /etc/mail/virtusertable')
EXPOSED_USER(`root')
MASQUERADE_AS(`foo.bar')
MASQUERADE_DOMAIN(`mail.foo.bar')
FEATURE(allmasquerade)
FEATURE(masquerade_envelope)
define(`confPRIVACY_FLAGS',`goaway')
define(`confMAX_HEADERS_LENGTH',`16384')
define(`confMAX_MESSAGE_SIZE',`50000000')
define(`confCONNECTION_RATE_THROTTLE',`3')
define(`confMAX_DAEMON_CHILDREN',`12')
define(`confSMTP_LOGIN_MSG',`great mailer')
define(`confMAX_RCPTS_PER_MESSAGE',`50')
define(`confTO_IDENT', `0')
define(`confTO_QUIT', `8m')
define(`SMART_HOST', `smtp.myisp.hu')
define(`confCW_FILE', `-o /etc/mail/local-host-names')
DAEMON_OPTIONS(`Name=IPv4, Family=inet')
define(`confCOPY_ERRORS_TO', `postmaster')
define(`confMAX_MIME_HEADER_LENGTH', `256/128')
define(`confNO_RCPT_ACTION', `add-to-undisclosed')
FEATURE(use_cw_file)
MAILER(local)
MAILER(smtp)
There are some files mentioned in the .mc file, which you shall also created, and your dns records in your local name server shall be created, too.