axMail - an SMTP mailbox for the various linux node frontends.

PREFACE:

First off, sincere thanks to those who have written to tell me that
they use axMail, like what I've done to axMail, and for the 
enthusiasm shown via words and/or code contributions for the program
in hopes of keeping packet radio networks around the world alive!

INTRO:

Greetings and thanks for taking a look at the program. Below I've posted
a kind of history of the program to the best of my knowledge taking text
from existing files. Rather than trying to reinvent the wheel and after
seeing this program before on Labrat's radio.linux.org.au site, I decided
to try and give some life into it... partially with the assistance of Phil 
N1XTB nudging me pretty consistantly for many months in helping him get an 
SMTP agent in his linux based packet node server without having to install 
an xNOS overhead node ontop it. :) 

Please do take a moment and read the text based files included with this 
package so you're a bit familiar with what it does so that you don't get a 
false perception as to what it can and/or can not do. axMail just might 
not be what you're looking for or expecting for a node based plugin

CHANGE HISTORY:
axmail 2.6
  Updated 22 September, 2016 by Brian Rogers (N1URO) <n1uro@n1uro.net>
- changed version number in defines.h
- fixed error message when a pop client has deleted mail from the
  main mail spool file.
- removed excessive receipt warning spotted by a gent who identifies 
  himself as rigor. This was in mailcmd.c in do_readmsg()
- while looking at the end of that routine, it just gave me an itch that
  said "if you can look for a warning about a requested receipt, then
  numbnutz you can offer the reader a chance to just generate a receipt
  without having to do "SR" as previously stated at the end of the mail.
  So, with that said and to get feeling back in my genitals, I wrote a
  routine that asks the reader if they wish to send a receipt, and it
  also echos where it's destined and confirmation it was sent.
- added an "--- end of message #* ---" tag at the end of mail when it
  as finished displaying. This was done in mailcmd.c
- fixed an existing bug in the message routines where for each message
  it wasn't resetting the receipt pointer! This bug existed since I
  introduced the receipt "finder" in the messages. I'm shocked that
  it wasn't reported to me by someone earlier. Now *only* if a message
  has requested a receipt will it show that a receipt has been asked
  for... whew!
- So many missing online help files! Again I'm surprised no one brought
  this to my attention. How did we get along with them? "Oh my!" - Sulu
- Updated this README file.
axmail v2.5.1
  Updated 28 September, 2015 by Brian Rogers (N1URO) <n1uro@n1uro.net>
- added axmail.8 man page as per spec of Debian downstream.
- modified Makefile to include axmail.8 manpage installation for both
  new and upgrade options.
- modified defines.h and this document to reflect maintenance release.
 
axmail v2.5
  Updated 30 May, 2015 by Brian Rogers (N1URO) <n1uro@n1uro.net>
Changes:
- added new delivery receipt function to the send routine. This
  compliments the read receipt function in the event of high
  priority mail. Typically the read receipt is an option generated
  by the recipient who may not decide to generate one. At least this
  modification ensures with an ESMTP delivery that the sender using
  axMail will get a reciept from "MAILER-DAEMON" which will verify
  the status of delivered mail. This change was done in mailcmd.c
  and is designed with the sendmail binary included with postfix.
- updated this README file.
- updated version number in defines.h

axmail v2.4
  Updated 25 April, 2015 by Brian Rogers (N1URO) <n1uro@n1uro.net>
Changes:
- cleaned up mbox.c where I had originally placed the receipt checker
  routine in. This caused loops within the buffer that displayed the
  message. The true routine lives in mailcmd.c
- added patch to Makefile provided by Jaroslav at Red Hat for distribution
  downstream compiles to make packages.
- changed version in defines.h 
- major change in command.c, added a new Autofwd command to allow users to
  auto-forward mail from a remote system to their "home" axMail-FAX base
  system. Could also be used to forward mail to their internet accounts.
- added autofwd.hlp file.
- alphabetized the commandset listing, removed redundantly spelled commands.
- reworked Makefile and added an "upgrade" option so new files ONLY are
  deployed after make. Execute using: "make upgrade"
- updated this file.

axmail v2.3.1 
  Updated 5 February, 2015 by Brian Rogers (N1URO) <n1uro@n1uro.net>
Changes:
- added a flag in mailcmd.c where if the request for a receipt exists in a mail
  message, a bell and a warning sign is generated after the message has been
  read by the user with instructions to use SR to generate a receipt. This
  was a difficult routine for me to think of considering the various race
  conditions that can be expected and met.
- updated welcome.txt with version upgrade and new feature list.
- updated README.

axmail v2.3 
  Updated 5 February, 2015 by Brian Rogers (N1URO) <n1uro@n1uro.net>
Changes:
- Added a new "Receipt" request flag in mailcmd.c by request of Mitch AB4MW.
  This defaults to NO but when flagged to YES, a request will be sent to the
  remote client's agent. If the agent supports such, they will be prompted
  whether or not to honor your receipt request. This is history as NO AGENT
  FOR PACKET TERMINALS SUPPORTS THIS! The function of a generated read 
  receipt is similar to how HylaFax generates confirmation of transmission
  receipt mails to your mailbox. Currently mail read in axMail will NOT
  generate a receipt back. I may work on this later, but for now it doesn't
  exist.
* My thoughts of the receipt function is negative. The fact that I may be
  sending notification that I'm in my email client to a remote destination
  IMHO is such that a webcam may as well be turned on and watch me do email,
  and send the stream to "Big Brother" and I don't mean the television show.
  </rant>
- Updated defines.h with the new version number.
- Updated welcome.txt so the new version number is displayed.

axmail v2.2 
  Updated 25 December, 2014 by Brian Rogers (N1URO) <n1uro@n1uro.net>
Changes:
- Made some maintenance changes, but forgot to log them in here.
axmail v2.1.1
 Updated 30 October, 2014 by Brian Rogers (N1URO) <n1uro@n1uro.net>
Changes:
- Makefile
  Code provided by Bob Tenty VE3TOK to make it more compatable
  with newer GCC compiler requirements.
- utils.c
  Code provided by Bob Tenty VE3TOK to fix a warning produced when
  compiling.
- defines.h
  Changed version number to reflect the changes incorporated by 
  Bob Tenty VE3TOK and committed to the subversion repository.

axmail v2.1
 Updated 31 July, 2014 by Brian Rogers (N1URO) <n1uro@n1uro.net>
Changes:
- axmail.c
  Code provided by Jaroslov OK2JRQ fixes a potential security hole in
  the system privilege matching.
- global
  axMail is now under review for considerations as standard packaging in
  RedHat's fedora project. It appears it's going to be added as a package.

axmail v2.0
  Updated 8 July, 2013 by Brian Rogers (N1URO) <n1uro@n1uro.net>
Changes:
- defines.h
  Updated version number to reflect version release 2.0. Version 1.0.5
  was simply a maintenance test package to try and reincorporate what
  I had done up to version 1.0.6 which I believe was one of my last
  releases up to 2009. Since I've done all that I can recall at this
  point and time, I decided to match URONode's release numerics with
  a 2.0 release version.

axmail v1.0.5
  Updated 5 July, 2013 by Brian Rogers (N1URO) <n1uro@n1uro.net>
Changes:
- defines.h
  Updated email listings to reflect the most current ones I could find
  including my own. Also added 2013 to the years worked on axMail by
  me.

- quit.c
  Forced ALL mail, read or otherwise when user quits to save to the
  user's system mailbox. This is for reverse compatability with those
  who may also run a web-based email service on the internet such as
  NeoMail, EMUMail, etc. Prior, the system was supposed to separate
  any read mail (and all accompanying mail in that session) to the
  axmail ~/mbox file. We don't want this for the specific reason of
  "reverse email client" compatability.

axmail v1.0.4
  Updated 23 May, 2008 by Brian Rogers (N1URO) <brian@support.uroweb.net>
 Changes:
- setpwnam.c
  Changed the way SIGPIPE was handled. Instead of being ignored, it will
  now read a SIGQUIT properly if a QUIT is signaled to axmail either via
  a shell prompt, or a node frontend. I've been noticing especially on
  some timeouts that temp files don't flush as they should and the
  user's directory can start to fill up.

axMail v1.0.3
  Updated 2 December, 2007 by Brian Rogers (N1URO) <brian@support.uroweb.net>
Changes:
- mailcmd.c
  Reset the way I wanted to handle the user input routine for sending faxes.
  Commented out some more unneeded/unused code in the do_fax routine... will
  clean it up in next release or so.

- mailcmd.c
  cleaned up a bug I introduced in the never released 1.0.2 where the
  X-Mailer was duping itself after each line of the body of a message.

- sfax.hlp
  Reworded the SFax help file to help show some examples of how to format
  the header. 

axMail v1.0.2
  Updated 24 November, 2007 by Brian Rogers (N1URO) <brian@support.uroweb.net>
Changes:
- mailcmd.c
  Cleaned up some of the code in SFax. Also made some cosmetic changes.

axMail v1.0.1
  Updated 31 October, 2007 by Brian Rogers (N1URO) <brian@support.uroweb.net>
Changes:
- mailcmd.c
  Added a new routine to allow users to send faxes. This is defined by the
  command "SF" for Send Fax. The routine was taken from the "S"end function
  however since it's a one-way transmission, there is no reply available
  nor is there an option for users to fax to any fax service as some I know
  are pay services.
- config.h
  added definitions for faxgate in axmail.conf
- config.c
  added routine to allow for faxgate as a variable and be called from 
  mailcmd.c
- defines.h
  version upgraded from v1.0.0 (unreleased - test version) to
  v1.0.1
- etc/axmail.conf
  Added new line called "FaxGate" with an example of how to properly
  configure this line.
- etc/help/sfax.hlp
  Added new file "sfax.hlp" which is an online help file for the SFax
  command.

axMail v0.0.9
  Updated 26 September, 2006 by Brian Rogers (N1URO) <n1uro@n1uro.com>
Changes:
- mailcmd.c
  Added a new routine that prompts the sender whether or not the message
  is of an emergency/high priority mail message. If it's emergency message
  then the headers are appended with an X-code flagged in such a manner
  that Eudora and Outlook will display the received mail with a red flag
  of sorts. The idea of such came to me in thinking of "what can I do
  to help improve means of emergency communications using TCP/IP, Linux,
  and packet radio?" Having the ability to "red flag" an SMTP message
  I don't believe has yet to be available in any packet messaging
  system... axMail I hope is the first.

  If a user just hits enter, or selects "no" then the mail message
  is sent under normal send routines.

  found a minor bug in my routine where if an end user answered
  "yes" in wanting to send an emergency/high priority message the system
  ignored the request and sent it as 'normal' delivery. Made a minor
  change to bullet-proof the responce.

  Added online help text if user is unsure about sending a message
  flagged urgent or normal. This text is available when the user is
  prompted for priority selection by hitting "?" at the prompt.

- defines.h
  Version updated from v0.0.8 to v0.0.9

axMail v0.0.8
  Updated 2006 by Brian Rogers (N1URO) <n1uro@n1uro.com>
 
Changes:
 - mailcmd.c
   Rewrote and incorporated code provided by IW3IJQ how axMail inserts
   it's version number in the X-Mailer: string.
 - mailcmd.c   
   Added an X-Origin: string to show those peeking at mail headers
   just how the message was possibly sent... by AMATEUR RADIO!
 - axmail.conf
   Added config option in "AllowMail" for axhome, a rewrite of code
   submitted by Stefano IW3IJQ. While I stripped out home directory
   structures similar to that of qmail or axspawn, Stefano convinced
   me that it may be easier to manage home directories for axMail users
   who don't have shell access to branch out within a preset directory.
 - defines.h
   Updated version number from 0.0.7 to 0.0.8

 - axmail.c and config.c
   Rewrote and incorporated code to allow for the routines to use
   what Stefano IW3IJQ originally labled "newuhome" to use "axhome".
   While I was at it, I rewrote and shortened the error text pushed
   to a user who doesn't have permission to use such a directory.

 * Note: When I write error texts and menus, I try to write them for
   users on a multi-hop 1200 baud path thus the shorter the better as
   long as context isn't lost and for long distance hops where full
   paclen may cause retries (worse yet timeouts!)

axMail v0.0.7
  
  Updated 2005 by Brian Rogers (N1URO) <n1uro@n1uro.com>

Changes:
 - cosmetics
   My usual "I like seeing this this way" type cosmetics... too many
   to mention!

 - adduser.c
   changed the hard coding of user 'home' directories so that instead
   of them going into a period delimited sort, just dump em all into
   /home/<user> which seems to be "the norm" on most systems I've had
   to assist with.

 - adduser.c
   fixed a bug where creating a user was actually causing the program to
   segfault upon exit the first time a user went into the mailbox! The
   node frontends hid this segfault as the program still flushed itself
   from ram but I spotted it when running it at a command prompt. The
   segfault came when axMail attempted to write mail back to the user's
   system mailbox and it didn't exist. How I fixed this is listed next.
   This may just be a new bug that appeared with the upgrading of libs,
   this I'm unsure of and since I have no desire to go backwards I have
   decided to actually make a minor routine...

 - welcome.txt
   New users are now sent a "welcome" message that the sysop can easily
   customize to their desires. It's located at /etc/ax25/welcome.txt.
   I figured that since axMail was segfaulting because such a file did
   not exist, I might as well make use of this need by having the program
   send the user a greeting.   

 - defines.h
   Changed paths to be more in line with the more modern type configs
   as a default. Paths can still be defined by the sysop prior to 
   compiling axMail. 

 - Makefile
   I changed the default of make install to include all of the subroutines
   within the Makefile yet leaving such things as "make installbin" 
   available as runtime options if just a binary refresh creation is 
   desired. 

 - other
   I'm sure I missed a note or two *shrug*

axMail v0.0.6

  Tweeks made by Marius Petrescu (?) I know there was a ver 0.0.6 which
  I at one time had but lost and can't seem to find it. My (n1uro) 
  changes may have alread been incorporated.

axMail v0.0.5

  True mailbox functionalities created by Marius Petrescu.
  Added Mailbox save routines (compatible with the command line
  mail agent, including ~/mbox file)

axMail v0.0.4

  Copyright (c) 1996 Heikki Hannikainen (OH7LZB) <hessu@pspt.fi>
  
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


  Don't give this one to anyone yet... it is NOT ready for distribution!

  This is a simple mail user agent intended to provide the
mail functions in xNOS in a Linux ax.25 environment. If required,
it creates a normal user account for each new user (code mostly taken
from axspawn by Joerg Reuter (DL1BKE)), so that they can receive mail
on the system. axMail uses sendmail (or similar) to deliver mail, and
reads mail from each user's system mailbox (/var/spool/mail/username).
It does not provide any means of transferring mail between hosts.

  axMail provides a simple, low-overhead user interface, much similar
to /bin/mail, xNOS and the packet BBS systems. It's useful for providing 
good SMTP mail services for "dumb" ax.25 users over slow radio channels.

  axMail is intended to be called from node. It takes one command
line argument of the user's callsign (with or without SSID). It must
be run as root, but it setuid()'s itself to the respective user's
privileges as soon as possible. It might run from ax25d as well.
It can also be executed from a shell with user privileges.

  Some code (command parser, configuration file stuff) and the internal 
architecture was taken from the LinuxNode frontend by Tomi Manninen 
(OH2BNS). Thanks!

INSTALLATION:

	See the file: INSTALL

TODO:
  I know I can clean up the code a LOT more, will do so for a maintenance
  release which will most likely be v1.0.2.

	Suggestions?

-- 
Brian Rogers <n1uro@n1uro.net> [n1uro@n1uro.#cct.ct.usa.noam]
ftp://ftp.n1uro.net/packet
