HOWTO Setup Nullmailer: Difference between revisions

From Research
Jump to navigation Jump to search
No edit summary
 
(17 intermediate revisions by the same user not shown)
Line 3: Line 3:
messages through a fixed set of "upstream" hosts.  It is also designed
messages through a fixed set of "upstream" hosts.  It is also designed
to be secure.
to be secure.
<br>
We use nullmailer on a number of servers, where minimalist functionality is all that is required.  All mail (typically only cron-job outputs, like '''logwatch''' and '''tripwire''' are then sent to our research-admin mailing-list, on ponyexpress.iat.sfu.ca.  From ponyexpress, the admin-list will fire off copies to all subscribed research-administrators.


== Install Nullmailer ==
== Install Nullmailer ==
  # emerge nullmailer -va
  <font color=red>hostname</font> <font color=blue>~ #</font> '''emerge nullmailer -va'''
 
This may pull in '''sys-process/supervise-scripts''' (or, you can emerge it manually), which will then require:
<font color=red>hostname</font> <font color=blue>~ #</font> '''rc-update add svscan default'''
<font color=red>hostname</font> <font color=blue>~ #</font> '''ln -fs /var/spool/nullmailer/service /service/nullmailer'''
''(note:  older servers use the /var/nullmailer directory, rather than /var/spool/nullmailer...)''
Note:  you may have to create the '''/service''' directory first, by hand...<br>
<br>
and
<font color=red>hostname</font> <font color=blue>~ #</font> '''/etc/init.d/svscan start'''


== Configuration ==
== Configuration ==
Line 11: Line 22:


'''/etc/nullmailer/adminaddr'''
'''/etc/nullmailer/adminaddr'''
  admin@siat.sfu.ca
  admin@ponyexpress.iat.sfu.ca


'''/etc/nullmailer/defaultdomain'''
'''/etc/nullmailer/defaultdomain'''
Line 20: Line 31:


'''/etc/nullmailer/remotes'''
'''/etc/nullmailer/remotes'''
  bismarck.iat.sfu.ca smtp
  ponyexpress.iat.sfu.ca smtp
 
'''/etc/mailname'''
$hostname.iat.sfu.ca


== Status ==
== Status ==
Line 26: Line 40:


== Testing ==
== Testing ==
Send a message to root, then wait a while for it to be picked up and sent onwards.
(note:  you may have to '''emerge mailx''' to get the '''mail''' command)
  <font color=red>hostname</font> <font color=blue>~ #</font> '''mail -s "this is a nullmailer test from tirpitz" root'''
<br>
Send a message to root, then wait a brief moment for it to be picked up and sent onwards.
  <font color=red>hostname</font> <font color=blue>~ #</font> '''mail -s "this is a nullmailer test" root'''
  Type your message, complete it with a '''ctrl-D + Enter'''
  Type your message, complete it with a '''ctrl-D + Enter'''
If everything is going properly, the adminaddr should receive a shiny new message in a short period of time!
==Clearing the Queue==
  <font color=red>hostname</font> <font color=blue>~ #</font> '''rm /var/spool/nullmailer/queue/*'''

Latest revision as of 20:16, 27 February 2019

From the authour's web-site: Nullmailer is a mail transport agent designed to only relay all its messages through a fixed set of "upstream" hosts. It is also designed to be secure.
We use nullmailer on a number of servers, where minimalist functionality is all that is required. All mail (typically only cron-job outputs, like logwatch and tripwire are then sent to our research-admin mailing-list, on ponyexpress.iat.sfu.ca. From ponyexpress, the admin-list will fire off copies to all subscribed research-administrators.

Install Nullmailer

hostname ~ # emerge nullmailer -va

This may pull in sys-process/supervise-scripts (or, you can emerge it manually), which will then require:

hostname ~ # rc-update add svscan default
hostname ~ # ln -fs /var/spool/nullmailer/service /service/nullmailer
(note:  older servers use the /var/nullmailer directory, rather than /var/spool/nullmailer...)

Note: you may have to create the /service directory first, by hand...

and

hostname ~ # /etc/init.d/svscan start

Configuration

Edit the following files to configure the machine to send mail to our mailing server (Bismarck).

/etc/nullmailer/adminaddr

admin@ponyexpress.iat.sfu.ca

/etc/nullmailer/defaultdomain

iat.sfu.ca

/etc/nullmailer/me

$hostname.iat.sfu.ca

/etc/nullmailer/remotes

ponyexpress.iat.sfu.ca smtp

/etc/mailname

$hostname.iat.sfu.ca

Status

hostname ~ # mailq

Testing

(note: you may have to emerge mailx to get the mail command)
Send a message to root, then wait a brief moment for it to be picked up and sent onwards.

hostname ~ # mail -s "this is a nullmailer test" root
Type your message, complete it with a ctrl-D + Enter

If everything is going properly, the adminaddr should receive a shiny new message in a short period of time!


Clearing the Queue

 hostname ~ # rm /var/spool/nullmailer/queue/*