hi, I wonder how MTAs work.
when they receive email, MTAs save the email to a files, one for content, one for header.
however, how do they detect new email comes up?
in my imagnation, there some possibles:
1. when they receive email, they give a signal to mailsender thread to delivery the email, then MTA start to find new files in queue directory. finished email delivery, the mailsender thread waiting for next signal.
2. mailsender thread have a loop, they detect the queue directory every 10 seconds, once new files have been detected, mailsender thread start to delivery these emails. then repeat the loop.
another question comes up, if MTAs use another thread to process the delivery, how do they works for queuing?
sorry, I have read Sendmail and QMail 's source code, but I couldn't make sense.