Discussion:
[Pkg-exim4-users] Difficulty getting exim4 to authenticate to smarthost
Tim Johnson
2016-12-30 20:42:43 UTC
Permalink
First off, I'm going to apologize in advance. I'm sure that I'm doing
something wrong, but I've looked at post after post, and feel like
I've tried everything I've seen suggested, and still am stuck with the
same issue.

I'm attempting to get exim4 to send non-local email out through an
smtp smarthost server which happens to require authentication.

I've taken several stabs at configuring my exim4.conf, passwd.client,
and exim4.conf.localmacros files configured appropriately, and each
time, I can see changes reflected in the output when attempting to
send a message with 'exim4 -v -f ***@xxxxxx.com ***@xxxx.com'. But
each attempt results in the smarthost telling exim that it needs
authentication, exim (as far as I can tell) fails to send any
authentication information, and the result is a 530 error.

Also, if I attempt to send a message with 'swaks --auth --to
***@xxxx.com --from ***@xxxxxx.com --server
smtpout.secureserver.net' all works fine. I can confirm that the
email arrives at its destination successfully.

In my exim4.conf I changed the smarthost because I noticed that
specifying smtpout.secureserver.net resulted in a conversation with
one of no telling how many servers. I just manually specified one of
those responding servers which seemed to work okay.

Again, I've taken a lot of stabs at this and it would be ridiculous to
to write the details of every attempt. Below is my current
configuration which I'm believing should work - even though it isn't,
and I'm also aware it's likely something I'm doing wrong:

-------------------------------------------------------------
--------exim4.conf (relevant portion)-------------
.............
# debconf-driven macro definitions get inserted after this line
UPEX4CmacrosUPEX4C = 1
##############################################
# the following macro definitions were created
# dynamically by /usr/sbin/update-exim4.conf
.ifndef MAIN_LOCAL_INTERFACES
MAIN_LOCAL_INTERFACES=127.0.0.1
.endif
.ifndef MAIN_PACKAGE_VERSION
MAIN_PACKAGE_VERSION=4.84.2-2+deb8u1
.endif
.ifndef MAIN_LOCAL_DOMAINS
MAIN_LOCAL_DOMAINS=@:localhost:localdomain.com
.endif
.ifndef MAIN_RELAY_TO_DOMAINS
MAIN_RELAY_TO_DOMAINS=empty
.endif
.ifndef ETC_MAILNAME
ETC_MAILNAME=localdomain.com
.endif
.ifndef LOCAL_DELIVERY
LOCAL_DELIVERY=mail_spool
.endif
.ifndef MAIN_RELAY_NETS
MAIN_RELAY_NETS=: 127.0.0.1 : ::::1
.endif
.ifndef DCreadhost
DCreadhost=empty
.endif
.ifndef DCsmarthost
DCsmarthost=p3plsmtpa08-01.prod.phx3.secureserver.net
#DCsmarthost=smtpout.secureserver.net
.endif
.ifndef DC_eximconfig_configtype
DC_eximconfig_configtype=smarthost
.endif
.ifndef DCconfig_smarthost
DCconfig_smarthost=1
.endif
##############################################
..............

--------------------------------------------------------------






---------------------------------------------------------------
-----------------passwd.client--------------------------

# Example:
### target.mail.server.example:login:password
#smtpout.secureserver.net:login_name:login_password
p3plsmtpa08-01.prod.phx3.secureserver.net:login_name:login_password

---------------------------------------------------------------






---------------------------------------------------------------
------------exim4.conf.localmacros-----------------

AUTH_CLIENT_ALLOW_NOTLS_PASSWORDS = true

---------------------------------------------------------------







---------------------------------------------------------------
------output when attempting to send-----------

SERVERNAME:/etc/exim4# exim4 -v -f ***@domain.com ***@gmail.com
this is a test
LOG: MAIN
<= ***@domain.com U=root P=local S=339
SERVERNAME:/etc/exim4# delivering 1cMxJ4-000302-OZ
R: smarthost for ***@gmail.com
T: remote_smtp_smarthost for ***@gmail.com
Connecting to p3plsmtpa08-01.prod.phx3.secureserver.net
[173.201.193.102]:25 ... connected
SMTP<< 220 p3plsmtpa08-01.prod.phx3.secureserver.net :SMTPAUTH: ESMTP
SMTP>> EHLO SERVERNAME
SMTP<< 250-p3plsmtpa08-01.prod.phx3.secureserver.net hello
[72.16.238.29], secureserver.net
250-HELP
250-AUTH LOGIN PLAIN
250-SIZE 30000000
250-PIPELINING
250-8BITMIME
250 OK
SMTP>> MAIL FROM:<***@domain.com> SIZE=1371
SMTP>> RCPT TO:<***@gmail.com>
SMTP>> DATA
SMTP<< 530 authentication required
SMTP<< 503 need MAIL before RCPT
SMTP<< 503 need MAIL before DATA
SMTP>> QUIT
LOG: MAIN
SIZE=1371: host p3plsmtpa08-01.prod.phx3.secureserver.net [173.201.193.102]: 530 authentication required
LOG: MAIN
<= <> R=1cMxJ4-000302-OZ U=Debian-exim P=local S=1394
LOG: MAIN
Completed
delivering 1cMxJE-000307-0M
R: system_aliases for ***@domain.com
R: userforward for ***@domain.com
R: procmail for ***@domain.com
R: maildrop for ***@domain.com
R: lowuid_aliases for ***@domain.com (UID 1001)
R: local_user for ***@domain.com
LOG: MAIN
== ***@domain.com R=local_user T=mail_spool defer (2): No such
file or directory: failed to chdir to /home/sender

SERVERNAME:/etc/exim4#

-------------------------------------------------------------------





------------------------------------------------------------------
------------------result of swaks--------------------------


***@SERVERNAME:~$ swaks --auth --to ***@gmail.com --from
***@domain.com --server smtpout.secureserver.net
Username: ***@domain.com
Password: password
=== Trying smtpout.secureserver.net:25...
=== Connected to smtpout.secureserver.net.
<- 220 p3plsmtpa06-09.prod.phx3.secureserver.net :SMTPAUTH: ESMTP
-> EHLO SERVERNAME
<- 250-p3plsmtpa06-09.prod.phx3.secureserver.net hello
[72.16.238.29], secureserver.net
<- 250-HELP
<- 250-AUTH LOGIN PLAIN
<- 250-SIZE 30000000
<- 250-PIPELINING
<- 250-8BITMIME
<- 250 OK
-> AUTH LOGIN
<- 334 VXNlcm5hbWU6
-> YmFja3VwcGNAbGFzY29saW5hc3BsYXN0aWNzdXJnZXJ5LmNvbQ==
<- 334 UGFzc3dvcmQ6
-> YmFja3Vw
<- 235 ... authentication succeeded :: MyeFck9onSm92
-> MAIL FROM:<***@domain.com>
<- 250 <***@domain.com> sender ok
-> RCPT TO:<***@gmail.com>
<- 250 <***@gmail.com> recipient ok
-> DATA
<- 354 OK
-> Date: Fri, 30 Dec 2016 08:58:49 -0600
-> To: ***@gmail.com
-> From: ***@domain.com
-> Subject: test Fri, 30 Dec 2016 08:58:49 -0600
-> X-Mailer: swaks v20130209.0 jetmore.org/john/code/swaks/
->
-> This is a test mailing
->
-> .
<- 250 MyeFck9onSm92 mail accepted for delivery
-> QUIT
<- 221 p3plsmtpa06-09.prod.phx3.secureserver.net :SMTPAUTH: closing connection
=== Connection closed with remote host.
***@SERVERNAME:~$

-----------------------------------------------------------------
Andreas Metzler
2016-12-31 13:12:53 UTC
Permalink
Post by Tim Johnson
First off, I'm going to apologize in advance. I'm sure that I'm doing
something wrong, but I've looked at post after post, and feel like
I've tried everything I've seen suggested, and still am stuck with the
same issue.
[...]

Hello,

I am not sure whether this is going to make you feel better or worse:
At first glance I cannot see the error.
Post by Tim Johnson
------output when attempting to send-----------
I would try this with an additional -d .

cu Andreas
--
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'
Tim Johnson
2016-12-31 13:24:38 UTC
Permalink
Adam Barratt's response got it. Sorry, missed replying to the list on this:

Thank you very much. I'd be hammering on this for a
week. I'd generated the exim4.conf file because I got tired of
grepping for settings to modify - that was the mistake.

Thank you and it's working perfectly now. I really appreciate the help

Happy New Year.

On Sat, Dec 31, 2016 at 3:46 AM, Adam D. Barratt
Post by Tim Johnson
First off, I'm going to apologize in advance. I'm sure that I'm doing
something wrong, but I've looked at post after post, and feel like
I've tried everything I've seen suggested, and still am stuck with the
same issue.
I'm attempting to get exim4 to send non-local email out through an
[...]
Post by Tim Johnson
-------------------------------------------------------------
--------exim4.conf (relevant portion)-------------
.............
# debconf-driven macro definitions get inserted after this line
UPEX4CmacrosUPEX4C = 1
##############################################
# the following macro definitions were created
# dynamically by /usr/sbin/update-exim4.conf
[...]
Post by Tim Johnson
------------exim4.conf.localmacros-----------------
AUTH_CLIENT_ALLOW_NOTLS_PASSWORDS = true
If you've supplied an explicit exim4.conf then nothing will be reading
exim4.conf.localmacros - that file is only used as part of
update-exim4-conf's use of exim4.conf.template to
produce /var/lib/exim4/config.autogenerated,
Does adding the macro definition in to exim4.conf directly help? (Or
removing the explicit configuration file and just specifying the
smarthost via debconf and update-exim4.conf.conf.)
Regards,
Adam
Loading...