1

I'm trying to setup my debian server to download email from a gmail account (e.g. [email protected]) and then forward it to a 3rd party email. The reason I can't just setup email forwarding within gmail is because I need the headers to reflect that the email is coming from [email protected]. When I use gmail's forwarding, then it leaves the headers unchanged.

I'm first trying to setup exim4 to just use gmail to send. I set it up as a smarthost via the instructions on the Debian wiki, but when I try to send a test email, it gives me the following errors in the exim4 log:

2011-06-26 06:34:37 1QapTx-0000rh-Cu <= root@ETC_MAILNAME U=root P=local S=360
2011-06-26 06:34:37 1QapTx-0000rh-Cu ** [email protected]: Unrouteable address
2011-06-26 06:34:38 1QapTx-0000rj-R4 Error while reading message with no usable sender address (R=1QapTx-0000rh-Cu): at least one malformed recipient address: root@ETC_MAILNAME - malformed address: _MAILNAME may not follow root@ETC
2011-06-26 06:34:38 1QapTx-0000rh-Cu Process failed (1) when writing error message to root@ETC_MAILNAME (frozen)

Anyone have any idea what might be the issue?

Edit: Running Debian 6.0 "squeeze" and Exim version 4.72 #1 built 12-May-2011 19:03:39

Here is /etc/exim4/exim4.conf:

# /etc/exim4/update-exim4.conf.conf
#
# Edit this file and /etc/mailname by hand and execute update-exim4.conf
# yourself or use 'dpkg-reconfigure exim4-config'
#
# Please note that this is _not_ a dpkg-conffile and that automatic changes
# to this file might happen. The code handling this will honor your local
# changes, so this is usually fine, but will break local schemes that mess
# around with multiple versions of the file.
#
# update-exim4.conf uses this file to determine variable values to generate
# exim configuration macros for the configuration file.
#
# Most settings found in here do have corresponding questions in the
# Debconf configuration, but not all of them.
#
# This is a Debian specific file

dc_eximconfig_configtype='smarthost'
dc_other_hostnames=''
dc_local_interfaces='127.0.0.1 ; ::1'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='smtp.gmail.com::587'
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname='false'
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
5
  • Post /etc/exim4/update-exim4.conf.conf. These correspond to your user entries. Also, please post Debian and exim version you are using. Also, do you have /etc/mailname set to something? Jun 26, 2011 at 21:23
  • All the searches I've done lead to some rootkit. Eg bugs.debian.org/cgi-bin/bugreport.cgi?bug=607542 forums.debian.net/viewtopic.php?f=11&t=58312 reddit.com/r/netsec/comments/en650/… If you are running lenny take a look. Jun 26, 2011 at 21:40
  • posted my version numbers and I don't think those apply to me.
    – mteng
    Jun 27, 2011 at 0:00
  • btw, thanks for the suggestions. Apologies for not posting the version info earlier. also added my update-exim4.conf.conf file.
    – mteng
    Jun 27, 2011 at 0:06
  • Tip - if you want someone to be notified of your message, start it with @username. anywhere in the body will work too. What about /etc/mailname? It should not be necessary to edit it manually, but would not hurt to look at it. Jun 27, 2011 at 0:11

3 Answers 3

2

It appears you are missing a definition for the macro ETC_MAILNAME. Also you appear to be running fetchmail as root which is not recommended. I would get exim4 delivering email to the desired host, and then configure fetchmail to fetch your mail.

However, I am not sure why you are using fetchmail and exim4 to replicate functionality that is available in gmail. You can set this up in the Forwarding and POP/IMAP settings of gmail.

EDIT: Normally ETC_MAILNAME is substituted with the contents of /etc/mailname which should be the FQDN (Fully Qualified Domain Name eg. mailer.example.com) of your host for mail purposes. This may be different from the hosts name.

You should add an alias for root to a non-privileged account in /etc/aliases if you don't already have one.

What you are proposing to do by replacing the FROM address on the email with the forwarders address will redirect most replies to the email account which is doing the forwarding. Without some special processing I don't think your Exim solution will do what you want.

Normally forwarding is reflected in the Subject heading. Often by adding a prefix like FWD:.

2
1

Your problem appears to be that you have left your mail name blank. you have

dc_other_hostnames='' 

in update-exim4.conf.conf.

dc_other_hostnames should not be empty, I don't think. Run dpkg-reconfigure exim4-config again and add a mail name. If you want expert advice you could talk to the people on the Debian Exim mailing list. Mark Haber etc.

3
  • Looking into dc_other_hostnames, it looks like that value is used to determine which are the hostnames for mail that should be delivered locally, but I'm actually just trying to get exim4 setup to send mail externally and it's telling me that the addresses are unroutable.
    – mteng
    Jun 28, 2011 at 0:21
  • @mteng: I am using exim4 on my local machine to use an external server as a smarthost. I've set dc_other_hostnames."it's telling me that the addresses are unroutable" is too vague to be helpful. What is your current setup, and what error message are you seeing? You can update your original post. Jun 28, 2011 at 8:29
  • The actual error is already in the original post. It literally says, "[email protected]: unroutable address"
    – mteng
    Jun 28, 2011 at 12:37
0

I use kaili(Debian7) and it works well .Something queit near from you. the followings are some details.

enter code here dc_eximconfig_configtype='smarthost'
dc_other_hostnames=''
dc_local_interfaces='127.0.0.1'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='smtp.gmail.com::587'
CFILEMODE='644'
dc_use_split_config='true'
dc_hide_mailname='false'
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'



root@fk404:~# dpkg -l|grep exim
ii  exim4                                   4.80-7                             all          metapackage to ease Exim MTA (v4) installation
ii  exim4-base                              4.80-7                             i386         support files for all Exim MTA (v4) packages
ii  exim4-config                            4.80-7                             all          configuration for the Exim MTA (v4)
ii  exim4-daemon-light                      4.80-7                             i386         lightweight Exim MTA (v4) daemon

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .