imip-agent

Annotated docs/wiki/MailIntegration--MTA

1362:d96b4761e6f0
2017-10-24 Paul Boddie Remove superfluous result collection slicing and count method parameter.
paul@984 1
= Mail Transfer Agents =
paul@984 2
paul@984 3
Although this documentation does not seek to cover the details of configuring
paul@984 4
mail transfer agent (MTA) software, some hints and tips are offered to help
paul@984 5
avoid frustration.
paul@984 6
paul@988 7
<<TableOfContents(2,3)>>
paul@988 8
paul@984 9
== General ==
paul@984 10
paul@984 11
Some general measures are presented below.
paul@984 12
paul@984 13
=== Hostname ===
paul@984 14
paul@984 15
The `hostname` command should provide a suitable hostname on the system, or MTAs
paul@984 16
may behave strangely. This can be tested with the following command:
paul@984 17
paul@984 18
{{{
paul@984 19
hostname -f
paul@984 20
}}}
paul@984 21
paul@984 22
It should report a fully-qualified hostname.
paul@984 23
paul@988 24
=== Mailname ===
paul@988 25
paul@988 26
The contents of `/etc/mailname` should probably be the fully-qualified hostname,
paul@988 27
at least for Exim and Postfix. See
paul@988 28
[[https://wiki.debian.org/EtcMailName|the Debian Wiki page]] for more details.
paul@988 29
paul@984 30
=== Interfaces ===
paul@984 31
paul@988 32
Some software attempts to listen on interfaces that may not be supported. For
paul@988 33
example, Exim may be configured to listen on both IPv4 and IPv6 interfaces, even
paul@988 34
in environments (such as User Mode Linux) where IPv6 interfaces may not be
paul@988 35
available.
paul@988 36
paul@988 37
=== Authentication ===
paul@988 38
paul@988 39
It is highly undesirable to allow anyone to connect to a mail server to send
paul@988 40
mail. However, it is highly convenient to allow imip-agent to connect to the
paul@988 41
mail server on the same host without having to provide credentials. Consequently,
paul@988 42
the configuration of an MTA must permit the latter without allowing the former.
paul@988 43
paul@988 44
Fortunately, many MTAs are configured to allow local connections because programs
paul@988 45
typically rely on such traditional behaviour, but this may be worth checking if
paul@988 46
mail server logs indicate authentication failures when imip-agent is attempting
paul@988 47
to send mail.
paul@984 48
paul@984 49
== Exim ==
paul@984 50
paul@984 51
On Debian, the following command can be run to adjust the configuration:
paul@984 52
paul@984 53
{{{
paul@984 54
dpkg-reconfigure exim4-config
paul@984 55
}}}
paul@984 56
paul@984 57
The following questions are especially interesting:
paul@984 58
paul@984 59
{{{{#!table
paul@984 60
'''Question''' || '''Remarks'''
paul@984 61
==
paul@984 62
IP-addresses to listen on for incoming SMTP connections
paul@984 63
|| Remove IPv6 interfaces in User Mode Linux or other environments without
paul@984 64
.. IPv6 support or Exim will not bother listening on IPv4 interfaces either.
paul@984 65
==
paul@984 66
System mail name
paul@984 67
|| State the fully-qualified hostname, not just the domain name, which is
paul@984 68
.. what the dialogue suggests is sufficient. For example:
paul@984 69
{{{
paul@984 70
mailserver.example.com
paul@984 71
}}}
paul@984 72
==
paul@984 73
Other destinations for which mail is accepted
paul@984 74
|| This is a colon-separated list that should indicate the local domain as
paul@984 75
.. well as the unqualified hostname. For example:
paul@984 76
{{{
paul@984 77
mailserver:example.com
paul@984 78
}}}
paul@984 79
}}}}
paul@1136 80
paul@1136 81
== Useful Commands ==
paul@1136 82
paul@1136 83
The following commands prove useful when troubleshooting and appear to be
paul@1136 84
available as shown within a Debian environment.
paul@1136 85
paul@1136 86
{{{#!table
paul@1136 87
'''Task''' || '''Exim''' || '''Postfix'''
paul@1136 88
==
paul@1136 89
Check the mail queue
paul@1136 90
||<colspan="2"> `mailq`
paul@1136 91
==
paul@1136 92
Process the mail queue
paul@1136 93
|| `sendmail -q` (or `exim -q` or `runq`)
paul@1136 94
|| `sendmail -q` (or `postqueue`)
paul@1136 95
==
paul@1136 96
Flush the mail queue
paul@1136 97
|| `exim -qff`
paul@1136 98
|| `postqueue -f`
paul@1136 99
==
paul@1136 100
Deliver a specific message
paul@1136 101
|| `exim -M <identifier>`
paul@1136 102
|| `postqueue -i <identifier>`
paul@1136 103
==
paul@1136 104
Test delivery for an address
paul@1136 105
||<colspan="2"> `sendmail -bt <address>` (see also `sendmail -v -bv <address>` and `sendmail -v -bvs <address>`)
paul@1136 106
}}}
paul@1136 107
paul@1136 108
See [[http://bradthemad.org/tech/notes/exim_cheatsheet.php|Exim Cheatsheet]] and [[http://www.postfix.org/DEBUG_README.html|Postfix Debugging Howto]] for more guidance.