1

I want to use exim to send emails via my ISP's SMTP server. However, the Arch wiki is quite confusing (exim is much simpler on a Debian system). I followed instructions in the final section, modifying the SMTP address from mail.internode.on.net to my SMTP server, and modifying *@* $1@bullet.homenet.org Ffr to *@* $1@my_emaildomain.com Ffr. This worked when I was connected to the internet via my ISP.

However, to use this on my work network, I need to authenticate. I tried to follow the instructions listed for Gmail, while changing the url, but this failed with

authenticator iinet_route: cannot find authenticator driver "manualroute"

How can I set up exim for authentication? (FWIW I'm with iinet.)

EDIT

I realised I had been putting the "Gmail"-like settings in the wrong parts. I moved them around, and am no longer getting the error messages. However, exim now fails silently. I get no error message, but no mail is delivered.

Here are the changes I made to the factory default:

--- exim.conf.factory_default   2015-08-03 02:14:31.000000000 +1000
+++ exim.conf   2015-11-10 08:09:54.196287461 +1100
@@ -402,7 +402,7 @@

   # Deny unless the sender address can be verified.

-  require verify        = sender
+  #require verify        = sender

   # Accept if the message comes from one of the hosts for which we are an
   # outgoing relay. It is assumed that such hosts are most likely to be MUAs,
@@ -552,14 +552,19 @@
 # If the DNS lookup fails, no further routers are tried because of the no_more
 # setting, and consequently the address is unrouteable.

-dnslookup:
-  driver = dnslookup
-  domains = ! +local_domains
-  transport = remote_smtp
-  ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
+#dnslookup:
+#  driver = dnslookup
+#  domains = ! +local_domains
+#  transport = remote_smtp
+#  ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
 # if ipv6-enabled then instead use:
 # ignore_target_hosts = <; 0.0.0.0 ; 127.0.0.0/8 ; ::1
-  no_more
+#  no_more
+
+iinet_route:
+  driver = manualroute
+  transport = iinet_relay
+  route_list = * mail.iinet.net.au


 # This alternative router can be used when you want to send all mail to a
@@ -735,6 +746,12 @@
 address_reply:
   driver = autoreply

+iinet_relay:
+  driver = smtp
+  port = 587
+  hosts_require_auth = <; $host_address
+  hosts_require_tls = <; $host_address
+


 ######################################################################
@@ -769,6 +786,7 @@
 # There are no rewriting specifications in this default configuration file.

 begin rewrite
+*@* test_exim_sender@mydomain.foo.com Ffr



@@ -821,6 +839,12 @@
 #  server_advertise_condition = ${if def:tls_in_cipher }


+iinet_login:
+  driver = plaintext
+  public_name = LOGIN
+  hide client_send = : smtp_account@iinet.net.au : PASSWORD_HERE
+
+
 ######################################################################
 #                   CONFIGURATION FOR local_scan()                   #
 ######################################################################

And here is my full configuration file.

EDIT 2

I also tried changing the port to 465, which also fails silently. (FWIW 587 works fine in msmtp.)

EDIT 3

Here is the information on a failed email, using exim -Mvl. The original attempt to send used echo body | /usr/bin/mail -s subject -r sender@mydomain.foo.com recipient@mydomain.foo.com

2015-11-10 11:53:39 Received from test_exim_sender@mydomain.foo.com U=sparhawk P=local S=428 id=20151110005339.ag4kfrHaJ%sender@mydomain.foo.com
2015-11-10 11:53:41 recipient@mydomain.foo.com R=iinet_route T=iinet_relay defer (-42): authentication required but authentication attempt(s) failed

EDIT 4

I ran the mail command again (as per edit 3), and got a slightly different error. I've also linked to the full output of exim -d+all -M messageID <ID>

$ sudo exim -Mvl 1ZwMHr-0008I4-92
2015-11-11 14:41:31 Received from eximsender@mydomain.foo.com U=lee P=local S=426 id=20151111034131.VRuQn__aN%sender@mydomain.foo.com
2015-11-11 14:41:31 recipient@mydomain.foo.com R=iinet_route T=iinet_relay defer (-53): retry time not reached for any host

Full debug output is here.

Sparhawk
  • 19,941
  • You probably mistyped somewhere, as manualroute is used in the routers part and not in the authentication part. Add the parts you have edited to the question. – wurtel Nov 09 '15 at 10:53
  • @wurtel Ah, yes, I misinterpreted the wiki. I had put everything from the Gmail section at the end. I've updated the question. – Sparhawk Nov 10 '15 at 00:21
  • Exim is an email server, why send emails via another email server? – markmnl Nov 10 '15 at 01:29
  • @markmnl The rationale is in the first link of my question. – Sparhawk Nov 10 '15 at 01:34
  • If you submit a message to exim, and it's not getting delivered, then it will still be in the queue; exim does not silently discard messages. Check the queue (eximbpor simplymailqwhich should work), you can check the log for a given message ID by runningexim -Mvl messageID`. Or just check the exim mainlog / paniclog. That should give hints what's wrong. – wurtel Nov 10 '15 at 08:54
  • @wurtel Oh good to know. Yes, there are several messages there. As an aside, is there a way to get notification when it fails (that's the whole point of me using exim)? I've edited the question with the new information. – Sparhawk Nov 10 '15 at 09:21
  • The config looks OK to me. Getting a detailed debug trace can be done via exim -d+all -M messageID, hopefully that will help determine why the auth fails. Note that these messages have a temporary failed status, they will be retried (if you have exim running with a -q option, or have queue runs in cron). Upon a timeout or permanent error they will be returned to the envelope sender. – wurtel Nov 10 '15 at 10:07
  • You seem to be doing the authentication correctly (at least, the mechanism) but the remote servers responds with "535 #5.7.0 Authentication failed". This sounds like a simple typo or similar, nothing we can work out here. Note that the different error message in your edit 4 is because exim already knows that something's up with that destination and won't try to send this message until the retry time for the other messages in the queue is also up. – wurtel Nov 11 '15 at 07:49
  • @wurtel Ugh… You are right. I tested the previous smtp, but this one does seem to fail, despite working at the web login. So yes, it seems like it's a server-side issue. I tested another account, which works fine. Thank you for all your help. If you want to post up an answer, I'll upvote and accept. The pertinent fix was putting the settings in the right parts. – Sparhawk Nov 11 '15 at 23:22

1 Answers1

1

According to the error you get, you have put the stanzas from the gmail example in the wiki in the wrong sections. The exim config is built up in distinct parts, in order:

  • main
    contains global definitions and settings
  • acl
  • routers
    how to handle an address; first hit is used so order is important
  • transports
    defines ways to disposing of a message, these are referenced from the routers above; order is not important
  • retry
    how often to retry delivery
  • rewrite
    changing addresses e.g. to map internal addresses to globally usable addresses
  • authenticators
    defines ways of authenticating; both as server and as client

The error message authenticator iinet_route: cannot find authenticator driver "manualroute" clearly indicates that you have put a router stanza in the authenticators section.

Put each stanza in the relevant section (i.e. the router definition after the line begin routers and before the line begin transports, taking order into account; etc.) and the error should go away.

wurtel
  • 16,115