Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to setup my debian server to download email from a gmail account (e.g. forwarder@gmail.com) 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 forwarder@gmail.com. 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 ** 3rdparty@email.com: 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'
share|improve this question
    
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? –  Faheem Mitha Jun 26 '11 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. –  Faheem Mitha Jun 26 '11 at 21:40
    
posted my version numbers and I don't think those apply to me. –  mteng Jun 27 '11 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 '11 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. –  Faheem Mitha Jun 27 '11 at 0:11

3 Answers 3

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:.

share|improve this answer
    
What do I have to set that macro to? And where do I do that? Also, I tried to explain why I'm not just using the gmail forwarding, but it has to do with wanting the headers to reflect that the mail is being forwarded. For example, if a@a.com sends an email to b@b.com and b@b.com forwards it to c@c.com, when c@c.com sees the mail, it will look as if it's coming from a@a.com if I setup forwarding in gmail. I actually want c@c.com to see the mail as coming from b@b.com. –  mteng Jun 26 '11 at 18:01
    
I've added additional information to my answer. Please note that what you are trying to do will break the ability to reply to most email. –  BillThor Jun 28 '11 at 18:07

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.

share|improve this answer
    
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 '11 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. –  Faheem Mitha Jun 28 '11 at 8:29
    
The actual error is already in the original post. It literally says, "emailto@example.com: unroutable address" –  mteng Jun 28 '11 at 12:37

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

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.