[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Lightweight alternative MTA? [was: Re: Starting MTA:]



Hi,

Unless you are very low in memory and lacks CPU power and swap space, it
is not worth the trouble to do nodaemon.  I do not use it.

I use QUEUERUNNER='queueonly' now since I do not need to have SMTP port
listening daemon but nice to have queue daemon.  My laptop is normal one
and is powerful enough not to worry swapping problem.

I made few post on nondaemon as for people with extreme concern on
having daemon.  Please understand it as "it can be done". But I think it
is not really worth the trouble for most of us.

For the sake of learning mail system, I respond to some of your points.

On Thu, Sep 24, 2009 at 09:59:53AM -0700, Mike McClain wrote:
> Hi Osamu,
>     Thanks for the response. I really don't get it when it comes to mail.

Have you read 
  http://www.debian.org/doc/manuals/debian-reference/ch06.en.html#_the_mail_system

> MTA/MDA/MUA are kind of confusing, if you know where I can find a 2 page
> explanation of email I'd really like to read it.
>     I use /usr/bin/mail, mutt, fetchmail and exim4.

Big questions are:
 * do you want outgoing mail?
 * do you want functioning /etc/aliases ?

> The man page for /usr/bin/mail claims it's a "mail processing system".

It will send mail using sendmail(8).  It will put mail in outgoing
queue.  Sendmail also run as queue daemon.  If it sees mail in queue, it
send out. 

> Mutt is an MUA.
> Fetchmail's man page claims, 'mail-retrieval and forwarding utility'.
> Exim4's manpage claims it's an MTA, but fetchmail's manpage refers to
> exim as an MDA.

exim works as both MTA and MDA depending on how it is used.  it may pass
message to another MDA such as procmail too.

> How does /usr/bin/mail know to put outbound mail in /var/spool/exim4/input?
> I killed the exim daemon and mail still puts mail in .../exim4/input
> even though 'exim4/input' doesn't appear in any file in /etc/ or
> root's environment.

Since daemon are for listening to SMTP mail to recieve mail and queue
processing, this happens.

> > > When I tried this and the mail stopped getting delivered until I
> > > restored /etc/default/exim4.

Because you are did not process queue.  "exim -q" command does it.  In
normal daemon mode, exim do this from daemon every 15 min. or so.

> > Are you talking about delivering to external hosts?
> 
> No, rather fetchmail failed since there was no connection on port 25.

So configure it to use pipe.

 http://www.debian.org/doc/manuals/debian-reference/ch06.en.html#_the_remote_mail_retrieval_and_forward_utility

> > Sure, that what you did unless you run some explicit command, cron script or hook script.
> 
> Would you restate this another way? I'm not understanding it.

I explained as above: "exim -q".

> > daemon has 2 functionalities:
> >  (1) listening to port 25 (SMTP) to get connected from external hosts.
> >  (2) pushing out queued messages to hosts.
> > 
> > You certainly do not need (1) 
> 
> OK, fetchmail's manpage gives examples for connecting directly to procmail
> and sendmail

Here sendmail is generic mail interface command name.  exim also provide
it.  This is what you want to do.  connecting via pipe.

> but not exim and exim4's 30 page/60 screen manpage said nothing
> about it's return value on disk full and I didn't see anything to suggest
> how to take input directly from fetchmail.

If error happens, pipe becomes broken and fetchmail understand there is
problem.

> Further exploration shows that sendmail is actually a link to exim so
> I guess that would work but I saw in another thread that cron's messages
> won't get delivered if there's no MTA deamon running. True?

I thought it needs to have sendmail command but not daemon listening to
SMTP port.

> > but you still need to do (2) if you wish
> > to send mail to external host via local mail system like exim or
> > postfix.  (If you configure MUA to connect to external MTA directly this
> > is not issue.)
> > 
> > Simple fix is to use queueonly or ppp instead.  (Since you are dialup,
> > ppp is more suitable to save fee.)
> 
> OK I set QUEUERUNNER='ppp' and the mail went out but there is still
> an exim deamon running, not sure how that helped.

This send mail by executing hook script in /etc/network/if-up.d when ip
connection is created.  

In case of nodaemon, you need to do "exim -q" to send mail if you send
mail via exim after ppp connection.
 
> > As I think of this for mutt, it may be easier to create shell script
> > which runs "exim -q" or postfix's equivalent command when mutt
> > terminates or receive SIGTERM etc.  
> > 
> > 
> > Please note that we are talking laptop type use case. 
> How would this differ from a desktop on dialup?

laptop: I should have said no swap, low CPU power laptop.  normal laptop
like mine has enough of everything.
 
> >  * /usr/sbin/sendmail is available and it can work with /etc/aliases.
> >  * log daemon may send some mail but to local user
> >  * send messages via smarthost with 
> >    - the message submission port (587) or 
> >    - SMTP/SSL port (465)
> >  * receive messages via ISP using getmail or fetchmail with
> >    - POP3 (110) or 
> >    - TLS/POP3 port (995).
> > 
> > Quite likely, you have cron or daemon doing POP3. I use cron to run
> > getmail every 15 min when IP connection is active.  I could stop exim
> > and run it from similar script.
> > 
> <snip>  
> No, I just have a script that connects if not already connected
> then runs exim4 -qqff and fetchmail then shuts down the connection
> if it opened it.

This is like PPP.
 


Reply to: