Sendmail OSX part 2
get sendmail to work with AppleMailServer
get sendmail to work with AppleMailServer
Option 1 : get sendmail to work with AppleMailServer
OSX Server only. Not the recommended option.
Because we no longer run AppleMailServer at any of our customers’ sites I cannot guarantee success with this method under 10.1.5. It definitely worked with 10.1.4 though.
What we are trying to do here is get sendmail to pass any local messages to the AppleMailServer for local delivery. These messages are forwarded via SMTP on port 627. It is important if you use this approach that port 627 is blocked at your firewall to prevent others exploiting holes (such as the open relay bug) in AppleMailServer.
Create /etc/mail/mailertable. This file tells sendmail to deliver certain domains to a special mailer called "ams".
localhost ams:localhost
domain.com.au ams:localhost
Create /usr/share/sendmail/conf/mailer/AppleMailServer.m4. Here we define the mailer called "ams". This is the part that took me the longest to get right. I am by no means a sendmail expert, so please let me know if you have improvements to be made here. Make sure you don’t get too many line breaks in there, or just download it.
#########################################
- AppleMailServer specification ### #########################################
ifdef(`_ARG_’,`define(`AMS_PORT’,ARG)’)dnl
ifdef(`AMS_PORT’,,`define(`AMS_PORT’,627)’)dnlVERSIONID
Mams, P=[IPC], F=SMTP_MAILER_FLAGS">CONCAT, S=11/31, R=ifdef(`_ALL_MASQUERADE_’, `21/31’, `21’), E=\r\n,
L=2040,_OPTINS(`RELAY_MAILER_CHARSET’, `C=’, `,’)T=DNS/RFC822/SMTP, A=IPC $h AMS_PORT
OK. Now we can create the configuration file and we are all done. Be careful here with line breaks. Each line begins with a command like "define" or "feature", even though your browser may have wrapped text differently.
Create /etc/mail/sendmail.mc
###
- This basic sendmail.mc file provides basic sendmail service
- which is still a vast improvement over the built-in Apple
- Mail Server.
#
- After any change made here, execute this:
- cd /usr/share/sendmail/conf/m4
- m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
###
include(`/usr/share/sendmail/conf/m4/cf.m4’)
VERSIONID
OSTYPE
DOMAIN
define(`PROCMAIL_MAILER_PATH’,`/usr/bin/procmail’)
define(`confTRY_NULL_MX_LIST’,true)
define(`_USE_ETC_MAIL_’,true)
define(`confSMTP_LOGIN_MSG’,”$j ; $b”)
define(`confMAX_DAEMON_CHILDREN’,15)
define(`confPRIVACY_FLAGS’,``noexpn,authwarnings,novrfy,goaway’‘)
FEATURE
FEATURE
define(`confCW_FILE’, `-o /etc/mail/local-host-names’)
- deliver all messages through AppleMailServer relay
FEATURE
FEATURE
FEATURE
FEATURE
FEATURE
FEATURE
- relay addresses without a domain (eg. admin) to AppleMailServer
define(`LOCAL_RELAY’, `ams:localhost’)
- relay addresses with a domain (eg. admin@domain.com.au) to AppleMailServer
define(`MAIL_HUB’, `ams:localhost’)
MAILER
MAILER
MAILER
Now go into the Server Admin tool, select "configure mail server…" and select "sendmail" in the popup next to SMTP. Save the preferences. This will write some configuration into the sendmail.cf file, which doesn’t seem to work. Later on we rebuild that file anyway, so don’t worry about it.
Now move on to the “final step”:node/131.
Newsletter subscription
ish makes regular updates to ish onCourse, and we like to let our customers know about them as soon as they're available.
Latest News
- onCourse 1.7.17 bug fixes 25 Feb 2010
- Getting your stats lodged: onCourse and AVETMISS 18 Jan 2010
- Support and service level agreements 9 Oct 2009
- Evaluating software in the cloud 8 Oct 2009
- The wonders of 'xargs' 21 Sep 2009
