Discussion:
[Pkg-exim4-users] Getting out-bound smtp Mail to Authenticate
martin McCormick
2015-08-21 16:20:40 UTC
Permalink
After reading the FAQ, exim man page and exim4-base/README.Debian,
I am getting closer to success with authenticating to my ISP's
smtp server but I am not there yet.

This system uses nmh to generate and read mail and then
can call either smtp or something close to sendmail to move the
messages in to the mail transport agent which is really exim4.

One thing I know for certain is that it can work. I
installed a package called msmtp which clames to work like
sendmail but squawks and errors out if it sees sendmail -bs as
msmtp will work if called without -bs when fed the text of the
out-going draft as in:

cat testfile |/usr/local/bin/sendmail -t

with sendmail in this case being a link to msmtp.

I have the right credentials including the right password
and the ISP's mail server is happy and sends the mail.

This is a cluge, however and I know I should get exim4 to
either authenticate correctly or call msmtp correctly to send the
outbound message. I don't really care at this point which ends up
being the solution but so far, I don't think I've got the
authentication process going correctly with exim.

So far, things are set as follows:

# password file used when the local exim is authenticating to a remote
# host as a client.
#skipping other comments
smtp.suddenlink.net:***@smtp.suddenlink.net:_BIGSECRET_

Exim4 is set to use a smarthost and fetchmail for all but local
deliveries and it does seem to make that decision properly.

The update-exim4.conf.conf file is as follows:

# /etc/exim4/update-exim4.conf.conf
#skipping other comments

dc_eximconfig_configtype='smarthost'
dc_other_hostnames=''
dc_local_interfaces='127.0.0.1'
dc_readhost='suddenlink.net'
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='smtp.suddenlink.net::465'
CFILEMODE='644'
dc_use_split_config='true'
dc_hide_mailname='true'
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'

As you can see in the output, it did make a connection to
the smtp serverbut the login name of ***@suddenlink.net was
never sent and I am not sure that the password was either. The
SMTP<< 454 Directory unavailable
error probably comes from there being no user ID sent.

The rest of this message is the doomed login session.

Thanks for any suggestions as to where I need to stuff the login
credentials.

Martin McCormick



Here is the output of
< /dev/null exim -d-all+transport testaddress.com

Exim version 4.80 uid=0 gid=0 pid=10384 D=10000000
Berkeley DB: Berkeley DB 5.1.29: (October 25, 2011)
Support for: crypteq iconv() IPv6 GnuTLS move_frozen_messages DKIM
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz dbmnz dnsdb dsearch nis nis0 passwd
Authenticators: cram_md5 plaintext
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore autoreply lmtp pipe smtp
Fixed never_users: 0
Size of off_t: 8
Compiler: GCC [4.7.2]
Library version: GnuTLS: Compile: 2.12.20
Runtime: 2.12.20
Library version: PCRE: Compile: 8.30
Runtime: 8.30 2012-02-04
WHITELIST_D_MACROS: "OUTGOING"
TRUSTED_CONFIG_LIST: "/etc/exim4/trusted_configs"
configuration file is /var/lib/exim4/config.autogenerated
log selectors = ffffffff 7ff7fffd
cwd=/home/martin 3 args: exim -d-all+transport ***@testaddress.com
trusted user
admin user
LOG: MAIN
Exim pid=10384 terminating with rc=0 >>>>>>>>>>>>>>>>
Exim version 4.80 uid=101 gid=105 pid=10386 D=10000000
Berkeley DB: Berkeley DB 5.1.29: (October 25, 2011)
Support for: crypteq iconv() IPv6 GnuTLS move_frozen_messages DKIM
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz dbmnz dnsdb dsearch nis nis0 passwd
Authenticators: cram_md5 plaintext
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore autoreply lmtp pipe smtp
Fixed never_users: 0
Size of off_t: 8
Compiler: GCC [4.7.2]
Library version: GnuTLS: Compile: 2.12.20
Runtime: 2.12.20
Library version: PCRE: Compile: 8.30
Runtime: 8.30 2012-02-04
WHITELIST_D_MACROS: "OUTGOING"
TRUSTED_CONFIG_LIST: "/etc/exim4/trusted_configs"
configuration file is /var/lib/exim4/config.autogenerated
log selectors = ffffffff 7ff7fffd
cwd=/var/spool/exim4 4 args: /usr/sbin/exim4 -d=0x10000000 -Mc 1ZSm6q-0002hU-6c
trusted user
admin user
Remote deliveries >>>>>>>>>>>>>>>>
T: remote_smtp_smarthost for ***@testaddress.com
remote_smtp_smarthost transport entered
***@testaddress.com
checking status of smtp.suddenlink.net
no message retry record
smtp.suddenlink.net [208.180.40.68]:465 status = usable
delivering 1ZSm6q-0002hU-6c to smtp.suddenlink.net [208.180.40.68] (***@testaddress.com)
Transport port=465 replaced by host-specific port=465
Connecting to smtp.suddenlink.net [208.180.40.68]:465 ... connected
waiting for data on socket
read response data: size=132
SMTP<< 220 txofep01.suddenlink.net ESMTP server (InterMail vM.8.04.03.20 201-2389-100-164-20150330) ready Fri, 21 Aug 2015 08:11:52 -0500
SMTP>> EHLO localhost
waiting for data on socket
read response data: size=169
SMTP<< 250-txofep01.suddenlink.net
250-HELP
250-XREMOTEQUEUE
250-ETRN
250-AUTH=LOGIN PLAIN
250-AUTH LOGIN PLAIN
250-PIPELINING
250-DSN
250-8BITMIME
250 SIZE 52428800
using PIPELINING
scanning authentication mechanisms
SMTP>> AUTH PLAIN ************************************************
waiting for data on socket
read response data: size=27
SMTP<< 454 Directory unavailable
plain authenticator yielded 2
ok=0 send_quit=1 send_rset=1 continue_more=0 yield=1 first_address is not NULL
SMTP>> QUIT
LOG: MAIN
SMTP error from remote mail server after AUTH PLAIN ************************************************: host smtp.suddenlink.net [208.180.40.68]: 454 Directory unavailable
added retry item for T:smtp.suddenlink.net:208.180.40.68:465: errno=0 more_errno=0,A flags=2
all IP addresses skipped or deferred at least one address
updating wait-remote_smtp_smarthost database
added to list for smtp.suddenlink.net
Leaving remote_smtp_smarthost transport
LOG: MAIN
== ***@testaddress.com R=smarthost T=remote_smtp_smarthost defer (0): SMTP error from remote mail server after AUTH PLAIN ************************************************: host smtp.suddenlink.net [208.180.40.68]: 454 Directory unavailable
LOG: MAIN
** ***@testaddress.com: retry timeout exceeded
writing data block fd=8 size=307 timeout=0
Exim version 4.80 uid=101 gid=105 pid=10389 D=10000000
Berkeley DB: Berkeley DB 5.1.29: (October 25, 2011)
Support for: crypteq iconv() IPv6 GnuTLS move_frozen_messages DKIM
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz dbmnz dnsdb dsearch nis nis0 passwd
Authenticators: cram_md5 plaintext
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore autoreply lmtp pipe smtp
Fixed never_users: 0
Size of off_t: 8
Compiler: GCC [4.7.2]
Library version: GnuTLS: Compile: 2.12.20
Runtime: 2.12.20
Library version: PCRE: Compile: 8.30
Runtime: 8.30 2012-02-04
WHITELIST_D_MACROS: "OUTGOING"
TRUSTED_CONFIG_LIST: "/etc/exim4/trusted_configs"
configuration file is /var/lib/exim4/config.autogenerated
log selectors = ffffffff 7ff7fffd
cwd=/var/spool/exim4 8 args: /usr/sbin/exim4 -d=0x10000000 -t -oem -oi -f <> -E1ZSm6q-0002hU-6c
trusted user
admin user
LOG: MAIN
<= <> R=1ZSm6q-0002hU-6c U=Debian-exim P=local S=1236
Exim pid=10389 terminating with rc=0 >>>>>>>>>>>>>>>>
Exim version 4.80 uid=101 gid=105 pid=10391 D=10000000
Berkeley DB: Berkeley DB 5.1.29: (October 25, 2011)
Support for: crypteq iconv() IPv6 GnuTLS move_frozen_messages DKIM
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz dbmnz dnsdb dsearch nis nis0 passwd
Authenticators: cram_md5 plaintext
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore autoreply lmtp pipe smtp
Fixed never_users: 0
Size of off_t: 8
Compiler: GCC [4.7.2]
Library version: GnuTLS: Compile: 2.12.20
Runtime: 2.12.20
Library version: PCRE: Compile: 8.30
Runtime: 8.30 2012-02-04
WHITELIST_D_MACROS: "OUTGOING"
TRUSTED_CONFIG_LIST: "/etc/exim4/trusted_configs"
LOG: MAIN
Completed QT=0s
Exim pid=10386 terminating with rc=0 >>>>>>>>>>>>>>>>
configuration file is /var/lib/exim4/config.autogenerated
log selectors = ffffffff 7ff7fffd
cwd=/var/spool/exim4 4 args: /usr/sbin/exim4 -d=0x10000000 -Mc 1ZSm6q-0002hZ-Mi
trusted user
admin user
Local deliveries >>>>>>>>>>>>>>>>
T: procmail_pipe for ***@localhost
procmail_pipe transport entered
direct command:
argv[0] = /usr/bin/procmail
direct command after expansion:
argv[0] = /usr/bin/procmail
Writing message to pipe
writing data block fd=8 size=44 timeout=3600
writing data block fd=8 size=1327 timeout=3600
writing data block fd=8 size=1 timeout=3600
procmail_pipe transport yielded 0
procmail_pipe transport returned OK for ***@localhost
LOG: MAIN
=> martin <***@localhost> F=<> P=<> R=procmail T=procmail_pipe S=1372 QT=1s DT=1s
LOG: MAIN
Completed QT=1s
Exim pid=10391 terminating with rc=0 >>>>>>>>>>>>>>>>
Nick Guerette
2015-08-21 17:22:05 UTC
Permalink
Two things:

First, in /etc/exim4/passwd.client
change the server name at the beginning of the line to use a wildcard,
to account for the fact that you ultimately are connecting to a server
like: txofep01.suddenlink.net, and change your login name to your actual
email address, with only the domain name and not the "smtp" hostname:

*.suddenlink.net:***@suddenlink.net:_BIGSECRET_

Second, if connecting to port 465 you probably need SSL on connect,
known as SMTPS, and this requires manually editing a conffile,
/etc/exim4/conf.d/transport/30_exim4-config_remote_smtp_smarthost if you
are using split configuration. Add the line:

protocol = smtps

See the description of the "protocol" option here:
http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_smtp_transport.html
Then, regenerate the configuration and restart exim:
dpkg-reconfigure exim4-config
service exim4 restart

Nick Guerette
Embedded Systems Engineer
Mosaic Industries, Inc.
510-790-8222
http://mosaic-industries.com/embedded-systems
Martin McCormick
2015-08-22 03:01:34 UTC
Permalink
Post by Nick Guerette
First, in /etc/exim4/passwd.client
change the server name at the beginning of the line to use a wildcard, to
txofep01.suddenlink.net, and change your login name to your actual email
Second, if connecting to port 465 you probably need SSL on connect, known
as SMTPS, and this requires manually editing a conffile,
/etc/exim4/conf.d/
transport/30_exim4-config_remote_smtp_smarthost if you are using split
protocol = smtps
A thousand thanks. I actually had added

protocol=smtps but may have failed to do

dpkg-reconfigure exim4-config

as it should have tried to log in with the wrong user ID but
didn't appear to even try.

Anyway, I am now sending this message in the normal manner without
resorting to the cybur equivalent of chewing gum, spit and
hay bailing wire.

Thanks to your help, it is so nice to have mail working
the way it is supposed to work.

Martin McCormick WB5AGZ

Loading...