From Mageia wiki
Jump to: navigation, search


Drakconf multiflag.png
Other languages
English ; français ;
Synopsis:
DragonFly mail agent is a software for e-mail transmission server. Mail-Agent is a small program that runs in the background to check every 5 minutes the availability of new e-mails.

Dragonfly Mail Agent

What is Dragonfly Mail Agent

  • DMA is a small lightweight Mail Transport Agent (MTA). It accepts mails locally and delivers the mails either locally or to a remote destination. Remote delivery includes several features like TLS/SSL support and SMTP authentication.
  • If you wish to both send and receive emails using your own domain name, then DMA is not for you and you should install a full mail server such as Postfix or Sendmail.
  • If you wish to be able to receive emails generated by applications on your Mageia computer then DMA is ideal for you. Many applications such as fail2ban or backuppc need to send mails. Those mails will only be delivered if an MTA such as DMA is installed. The Mageia Security System msec is also able to send alert emails of possible security breaches. If an MTA such as DMA is not installed those mails will pile up in the file /dead.letter.
  • DMA is very easy to configure.

Installing DMA

DMA may be installed either using Mageia Control Centre, or by urpmi on the command line

# urpmi dma
installing dma-0.7-1.mga2.x86_64.rpm from /var/cache/urpmi/rpms                                                                           
Preparing...                     ########################################################################################################
      1/1: dma                   ########################################################################################################
----------------------------------------------------------------------
More information on package dma-0.7-1.mga2.x86_64
#########################################################
#							#
#	Edit /etc/dma/aliases to properly set		#
#	the human account who should get root mail	#
#							#
#########################################################

The text above tells us the first thing we must do to configure DMA is to edit the file /etc/dma/aliases

# Person who should get root's mail
root:		your@email

For many users, configuration is now complete and your applications can start sending emails. Refer to the section on Testing dma to see if it is working.

Advanced Configuration

SMTP Transport

The most common reason DMA does not work immediately is because ISPs often block port 25 (SMTP) except to their own SMTP servers. If your ISP does this then you must configure DMA to route through the ISP SMTP server. (If you use Gmail it is also possible to route via Google's SMTP servers on port 587)

Edit the file /etc/dma/dma.conf

SMARTHOST smtp_hostname

where smtp_hostname is the host name or IP address of your ISP's SMTP server. Your ISP's support pages should tell you what the hostname of the SMTP server is called.

If your ISP requires you to authenticate when connecting to smtp then edit the file /etc/dma/auth.conf

username|smtp_hostname:password

and uncomment the AUTHPATH /etc/dma/auth.conf line in the file /etc/dma/dma.conf.

Sending emails through Google

DMA can be configured to route emails through Google's SMTP servers.

In the file /etc/dma/dma.conf

SMARTHOST smtp.gmail.com
PORT 587
AUTHPATH /etc/dma/auth.conf
SECURETRANSFER
STARTTLS
MASQUERADE myuser@gmail.com
  • Google requires the use of STARTTLS.
  • The MASQUERADE myuser@gmail.com line ensures that all mails sent by DMA appear to come from the specified user. Google will reject emails that do not come from the correct Google account, or have not been registered as an additional email account. See [[1]]

In the file /etc/dma/auth.conf

myuser|smtp.gmail.com:mypassword
Sending emails through another provider

If you have a more private email provider you want to use, here is some guidance.

You should easily find on your provider website or your configuration page, the information on its SMTP, PORT and whether STARTTLS is required.

Nowadays, many providers use port 465 and don't need STARTTLS for sending email.


In the file /etc/dma/dma.conf

SMARTHOST smtp_of_my_provider
PORT 465
AUTHPATH /etc/dma/auth.conf
SECURETRANSFER
MASQUERADE myuser@my_provider
  • The MASQUERADE myuser@my_provider line ensures that all mails sent by dma appear to come from a registered user of your provider. Otherwise, there is a risk emails will be rejected.


In the file /etc/dma/auth.conf

myuser@my_provider|smtp_of_my_provider:mypassword

Testing DMA

To send a test mail from the console

$ mail -s "This is a test mail" your@email
This is a test

When you have finished composing the mail enter Control+D on a new line to send it.

The log files at /var/log/mail will inform you if sending the mail was successful or not.

Alternatives to DMA

  1. Full mail servers - Postfix, Sendmail
  2. Other lightweight MTA's - ssmtp, msmtp