[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT?] What's wrong with my exim4 configuration? [SOLVED]



Hi,

I want to conclude this thread with a summary. I hope some may benefit from this.

First many thanks to Gregory Nowak, Jonathan Dowland, Chris Davies, and Curt, who helped me along the way.

My purpose:
I wanted that the system mail notifications (cron failed jobs, etc.) to end up in my day-to-day mail box (read: public email), while a copy is kept in root local mail box (/var/mail/mail).

The initial state was the default debian configuration for exim4 which is not sending mail to external addresses.

The steps made are described in the original post (below).
In between I inserted few comments and corrections based on what I learned here.

Cheers,
Itay


On Sun, 10 Nov 2013, Itay wrote:

Hi,

I apologize for the long post.
I thought it's best to put as much information including stuff inserted into configuration files and relevant parts of log file.

I am struggling to configure exim4 on my home desktop to send system notifications to my public email address. So far with no success. The desktop is connected to home private LAN with 24hrs connection to internet.

Can someone please hold my hand and educate me: what am I doing wrong?

Here is what I did.
[I replaced smtp's port with NNN. Also, assume 'machine' is output of command 'hostname', while 'machine.homenetwork' is output of 'hostname -f']

Replace these values with your local values, of course.

1. Configure exim4

# sudo dpkg-reconfigure exim4-config

General type of mail configuration:
=> "mail sent by smarthost; received via SMTP or fetchmail"
System mail name
=> "fastmail.fm"
  Also tried the default: "machine.homenetwork"

This is wrong.
The original value "machine.homenetwork" was correct.
This original value was offered by default, by the configuration dialogue.

Note:
Most of the replies in this dialogue are stored in
	/etc/exim4/update-exim4.conf.conf
The reply to this specific question is quite an exception as it is stored in the file
	/etc/mailname

IP-addresses to listen on for incoming SMTP connections
=> "127.0.0.1" (default)
Other destinations for which mail is accepted
=> "machine.homenetwork" (default)
Machines to relay mail for
=> Leave empty (default).
IP address or host name of the outgoing smarthost
=> "mail.messagingengine.com::NNN".

Based on the data extracted from my email client I used the deprecated port number 465.
This I changed to 587.

Note that in contrast to one suggestion on this thread, the double-colon ('::') is required.
This is documented, I believe, in exim4-config dialogue.

Hide local mail name in outgoing mail?
=> No (default).
Keep number of DNS-queries minimal (Dial-on-Demand)?
=> No (default).
Delivery method for local mail
=> "mbox format in /var/mail/" (default)
Split configuration into small files?
=> No (default).

2. Put a line in /etc/aliases
'root: root,myemail@fastmail.fm'

First entry on the right-hand is for making the local copy.
Second entry is for directing the mail to my public address.

3. Inserted the following lines in /etc/email-addresses
root: myemail@fastmail.fm
root@localhost: myemail@fastmail.fm
root@localhost.localdomain: myemail@fastmail.fm
root@machine: myemail@fastmail.fm
root@machine.localdomain: myemail@fastmail.fm
root@machine.homenetwork: myemail@fastmail.fm
itayf: myemail@fastmail.fm
itayf@localhost: myemail@fastmail.fm
itayf@localhost.localdomain: myemail@fastmail.fm
itayf@machine: myemail@fastmail.fm
itayf@machine.localdomain: myemail@fastmail.fm
itayf@machine.homenetwork: myemail@fastmail.fm

This is perhaps over-doing, but doesn't seem to interfer.

4. Insert in /etc/exim4/passwd.client the following line:
smtp.mail.provider:myemail@fastmail.fm:ClearTextPassWord

4. Update configuration and restart exim4

# sudo update-exim4.conf
# sudo invoke-rc.d exim4 restart
[ ok ] Stopping MTA for restart: exim4_listener.
[ ok ] Restarting MTA: exim4.
# sudo exim4 -qff
# newaliases

Run 'newaliases' every time that you edit /etc/aliases.

5. Test message:
# /usr/sbin/exim4 -i root
This is a test message.
^D

In both exim4 runs mentioned above, add verbosity '-v' when encountering trouble.

Outcome:
Mail ended up in machine's root inbox, but not in my public inbox.

Relevant part from /var/log/exim4:

2013-11-10 11:00:50 1VfQsq-0003B3-7m <= myemail@fastmail.fm U=itayf P=local S=327 2013-11-10 11:00:50 1VfQsq-0003B3-7m == root@fastmail.fm R=smarthost T=remote_smtp_smarthost defer (-53): retry time not reached for any host
2013-11-10 11:21:15 Start queue run: pid=12330
2013-11-10 11:21:15 1Vf1nB-0000dQ-Pz == root@fastmail.fm <root@gandalf.furmanet> R=smarthost T=remote_smtp_smarthost defer (-53): retry time not reached for any host 2013-11-10 11:21:15 1Vf1nB-0000dQ-Pz == myemail@fastmail.fm <root@gandalf.furmanet> R=smarthost T=remote_smtp_smarthost defer (-53): retry time not reached for any host 2013-11-10 11:21:15 1VfPwb-0002iA-NI == myemail@fastmail.fm R=smarthost T=remote_smtp_smarthost defer (-53): retry time not reached for any host 2013-11-10 11:21:15 1VfNjL-000250-SG == root@fastmail.fm R=smarthost T=remote_smtp_smarthost defer (-53): retry time not reached for any host 2013-11-10 11:21:15 1VfQsq-0003B3-7m == root@fastmail.fm R=smarthost T=remote_smtp_smarthost defer (-53): retry time not reached for any host
2013-11-10 11:21:15 End queue run: pid=12330

Thanks in advance!
Itay

Notes:

A. I have no trouble to access my public email from my email client (alpine) and the email provider's web interface.
B. I was relying on the following documents:
https://wiki.debian.org/GmailAndExim4
https://library.linode.com/email/exim/send-only-mta-debian-6-squeeze
file://usr/share/doc/exim4-base/README.Debian.html
https://wiki.debian.org/PkgExim4UserFAQ

And now this thread as well :-)
http://lists.debian.org/debian-user/2013/11/msg00472.html

Once again: thanks to all that helped me out.

Itay


Reply to: