9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] smtpd using 9front
       [not found] <604830541.2001918.1512941310047.ref@mail.yahoo.com>
@ 2017-12-10 21:28 ` G B
  2017-12-10 21:45   ` Lyndon Nerenberg
  2017-12-10 22:07   ` Steve Simon
  0 siblings, 2 replies; 3+ messages in thread
From: G B @ 2017-12-10 21:28 UTC (permalink / raw)


Previously I was using OpenSMTPD on OpenBSD for my smtpd server, but I thought I'd try the 9front smtpd server, but I have some questions if anyone would care to indulge me in getting it setup for multiple domains to accept and send mail.


Under
7.7 - Mail server configuration and maintenance

7.7.1
For the smtpd.conf file the line would read:
ourdomains domain1.org, domain2.net, domain3.com

7.7.2
For the rewrie, the line would read:
(ttr|domain1.org|domain2.net|domain3.com)!(.*)??? alias \2

7.7.4 
remotemail is where I am a little lost in what to use for multiple domains:

7.7.5 SMTP over TLS
Do I create a certificate for each domain?

Lastly, what do I enter in /cfg/$sysname/cpustart to start smtpd each time the server boots?

Thanks for any help and I apologize for my ignorance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.9fans.net/private/9fans/attachments/20171210/e846b8b1/attachment.html>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] smtpd using 9front
  2017-12-10 21:28 ` [9fans] smtpd using 9front G B
@ 2017-12-10 21:45   ` Lyndon Nerenberg
  2017-12-10 22:07   ` Steve Simon
  1 sibling, 0 replies; 3+ messages in thread
From: Lyndon Nerenberg @ 2017-12-10 21:45 UTC (permalink / raw)
  To: G B, Fans of the OS Plan 9 from Bell Labs


> On Dec 10, 2017, at 1:28 PM, G B <g_patrickb@yahoo.com> wrote:
> 
> 7.7.5 SMTP over TLS
> Do I create a certificate for each domain?

For SMTP relay (port 25 w/STARTTLS), MTAs ignore the CN in the server's certificate, so you can just set up a single cert with the host's canonical name.

For Submission (port 465/587) you can generally get away as above, although a very few MUAs might pop up a certificate warning if they can't find a CN that matches the host name they think they are connecting to.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [9fans] smtpd using 9front
  2017-12-10 21:28 ` [9fans] smtpd using 9front G B
  2017-12-10 21:45   ` Lyndon Nerenberg
@ 2017-12-10 22:07   ` Steve Simon
  1 sibling, 0 replies; 3+ messages in thread
From: Steve Simon @ 2017-12-10 22:07 UTC (permalink / raw)


I am on the Labs distribution rather than 9front but I use plan9 as my mail server.

> 
> 7.7.1
> For the smtpd.conf file the line would read:
> ourdomains domain1.org, domain2.net, domain3.com
> 

	Yep

> 7.7.2
> For the rewrie, the line would read:
> (ttr|domain1.org|domain2.net|domain3.com)!(.*)??? alias \2
> 

I have 3 seperate rules in rewrite:

	# your local names
	\l!(.*)						alias		\1
	quintile\.net!(.*)			alias		\1
	\l\.quintile\.net!(.*)		alias		\1


> 7.7.4 
> remotemail is where I am a little lost in what to use for multiple domains:
> 

I tweek the standard rules a little to ease debugging:

	echo /bin/upas/smtp -h $fd $addr $sender $* > /mail/tmp/rem.cli
	exec /bin/upas/smtp -h $fd $addr $sender $* >[2] /mail/tmp/rem.err

/mail/tmp is useful as it is always there (not just bound by your profile,
and writable by the user none.

I send through a mail gateway (necessary these days as many smtp servers insist
the email comes from the remote server's MX relay.

The gateway address comes from the smtp= entry in /lib/ndb/local

> 7.7.5 SMTP over TLS
> Do I create a certificate for each domain?
> 
you don't need a certificate to send email, but the fingerprint (checksom) of your
mail relay's certificate is stored on plan9 to ensure there is not man in the middle.

This lives in /sys/lib/tls/smtp and looks like 
	x509 sha1=CE3A0D3EDA4B77A353C09EA865B7F8C209714341
You can have several entries if your mail relay is multiple
machines hiding behind a single dns name,

The easist way is to just try and send some mail and it should fail with
an error "unknown fingerprint" but also listing the fingerprint. if you add
this to /sys/lib/tls/smtp your next attempt should work.

> Lastly, what do I enter in /cfg/$sysname/cpustart to start smtpd each time the server boots?

You only need to start auth/cron. My /cron/upas/cron has the following entries: 

	# kick mail retries (replace mailserver with your system)
	0,30 * * * *	local	/bin/upas/runq -a /mail/queue /mail/lib/remotemail

	# broadcast news
	3 6 * * *	local	/mail/lib/mailnews

	# clean up after grey list
	47 4 * * *	local	rm -rf /mail/grey/tmp/*/*

I have a compined auth/file/cpu server so all the above run on the host
'local' if you have a bigger setup your config may change.

for a different and probably still correct the labs mail setup is detailed in
the wiki here: https://9p.io/wiki/plan9/mail_configuration/index.html
You are best using the 9front faq where that is clear but a 2nd opinion may
help if it is confusing.

-Steve
-------------- next part --------------
An embedded message was scrubbed...
From: G B <g_patrickb at yahoo.com>
Subject: [9fans] smtpd using 9front
Date: Sun, 10 Dec 2017 21:28:30 +0000 (UTC)
Size: 7664
URL: <http://mail.9fans.net/private/9fans/attachments/20171210/cf59c2e1/attachment.mht>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-10 22:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <604830541.2001918.1512941310047.ref@mail.yahoo.com>
2017-12-10 21:28 ` [9fans] smtpd using 9front G B
2017-12-10 21:45   ` Lyndon Nerenberg
2017-12-10 22:07   ` Steve Simon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).