From Mageia wiki
Jump to: navigation, search


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 /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 Googles smtp servers on port 587)

Edit /etc/dma/dma.conf

SMARTHOST smtp_hostname
where smtp_hostname is the host name or IP address of your ISPs SMTP server. Your ISPs 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 /etc/dma/auth.conf

username|smtp_hostname:password
and uncomment the AUTHPATH /etc/dma/auth.conf line in /etc/dma/dma.conf.

Sending emails through Google

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

In /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 /etc/dma/auth.conf

myuser|smtp.gmail.com: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