(I posted this on Superuser but I realized that it was probably better handled here)
I've recently set up a development server at my job to test out certain features. I am setting up exim4 to be the MTA for the server. However, when I test and send emails to my account on the server, even though I have multiple entries in /etc/aliases
it only sends to one of the email addresses.
The entry is my /etc/aliases
file is:
joshua: **@gmail.com, **@apps.gmail.com
Below is the output of tail /var/log/exim4/mainlog
. I've changed the email addresses, but the rest of the data is the same. **@gmail.com
is my regular gmail account, **@apps.gmail.com
is a Google apps account for my job, and account@this.server
is the server's domain name.
2013-02-04 02:39:55 1U2Geh-0000aO-LZ DKIM: d=gmail.com s=20120113 c=relaxed/relaxed a=rsa-sha256 [verification succeeded]
2013-02-04 02:39:55 1U2Geh-0000aO-LZ <= **@gmail.com H=mail-wi0-f179.google.com [209.85.212.179] P=esmtp S=1757 id=CAM+SEUAx2UK8cDKe-MO22maib0at4kO=J+tQniEy=rxmPpbgjg@mail.gmail.com
2013-02-04 02:39:56 1U2Geh-0000aO-LZ => **@apps.gmail.com <account@this.server> R=dnslookup T=remote_smtp H=aspmx.l.google.com [2607:f8b0:4002:c04::1b] X=TLS1.2:RSA_ARCFOUR_SHA1:128 DN="C=US,ST=California,L=Mountain View,O=Google Inc,CN=mx.google.com"
2013-02-04 02:39:56 1U2Geh-0000aO-LZ => **@gmail.com <account@this.server> R=dnslookup T=remote_smtp H=gmail-smtp-in.l.google.com [2607:f8b0:4002:c02::1b] X=TLS1.2:RSA_ARCFOUR_SHA1:128 DN="C=US,ST=California,L=Mountain View,O=Google Inc,CN=mx.google.com"
2013-02-04 02:39:56 1U2Geh-0000aO-LZ Completed
When I send a test email, it sends to my apps email address but not my gmail address.
I thought it might be an issue with exim4
not sending to multiple email addresses, so I changed the /etc/aliases
file to only reflect my **@gmail.com
email address but it also failed to send even though there were no specific errors in the mainlog
.
I also tested to see if I could send emails directly to my gmail account. I ran the command
echo "Test" | mail -s "Subject" "**@gmail.com"
and it succeeded.
Basically, when I send an email to joshua@this.server
it successfully sends an email to **@apps.gmail.com
but not **@gmail.com
. However, when I send an email directly to **@gmail.com
it goes through. Any ideas?
UPDATE: I was messing around with /etc/sudoers.d
and accidentally made an invalid file, and sudo
wouldn't work until I fixed it. I set up sudo
to send emails when errors occur. When an error occurred, it sent an email to root@this.server
which sent an email to my email address. I tested by sending an email directly to root@this.server
but it still did not send to my email address. Here is the mainlog
2013-02-04 10:13:39 1U2Njn-0000gc-UB <= joshua@this.server U=joshua P=local S=572
2013-02-04 10:13:40 1U2Njn-0000gc-UB => **@gmail.com <root@this.server> R=dnslookup T=remote_smtp H=gmail-smtp-in.l.google.com [2607:f8b0:4002:c04::1a] X=TLS1.2:RSA_ARCFOUR_SHA1:128 DN="C=US,ST=California,L=Mountain View,O=Google Inc,CN=mx.google.com"
2013-02-04 10:13:40 1U2Njn-0000gc-UB Completed
2013-02-04 10:23:10 1U2Nt0-0000gz-Kz DKIM: d=gmail.com s=20120113 c=relaxed/relaxed a=rsa-sha256 [verification succeeded]
2013-02-04 10:23:10 1U2Nt0-0000gz-Kz <= **@gmail.com H=mail-we0-f171.google.com [74.125.82.171] P=esmtp S=1737 id=CAM+SEUDYoGWBb1btq_WQ9gRcWbvoSOoBhr2XrA=8QPbCsreLSg@mail.gmail.com
2013-02-04 10:23:11 1U2Nt0-0000gz-Kz => **@gmail.com <root@this.server> R=dnslookup T=remote_smtp H=gmail-smtp-in.l.google.com [2607:f8b0:4002:c04::1b] X=TLS1.2:RSA_ARCFOUR_SHA1:128 DN="C=US,ST=California,L=Mountain View,O=Google Inc,CN=mx.google.com"
2013-02-04 10:23:11 1U2Nt0-0000gz-Kz Completed
The first entry is the email that sent correctly (when I attempted to sudo with an invalid sudoers.d file) and the second entry is the test email I sent to root@this.server
.
UPDATE 2: These are the headers I receive when I get a successful email to my Gmail account:
Delivered-To: **@gmail.com
Received: by 10.216.72.209 with SMTP id t59csp48841wed;
Mon, 4 Feb 2013 07:34:59 -0800 (PST)
X-Received: by 10.101.175.18 with SMTP id c18mr7560000anp.3.1359992098647;
Mon, 04 Feb 2013 07:34:58 -0800 (PST)
Return-Path: <joshua@this.server>
Received: from this.server ([2607:fe50:0:6200:206:5bff:fefc:6123])
by mx.google.com with ESMTPS id i16si8003851anl.12.2013.02.04.07.34.58
(version=TLSv1.2 cipher=RC4-SHA bits=128/128);
Mon, 04 Feb 2013 07:34:58 -0800 (PST)
Received-SPF: neutral (google.com: 2607:fe50:0:6200:206:5bff:fefc:6123 is neither permitted nor denied by best guess record for domain of joshua@this.server) client-ip=2607:fe50:0:6200:206:5bff:fefc:6123;
Authentication-Results: mx.google.com;
spf=neutral (google.com: 2607:fe50:0:6200:206:5bff:fefc:6123 is neither permitted nor denied by best guess record for domain of joshua@this.server) smtp.mail=joshua@kenya.acomp.usf.edu
Received: from joshua by this.server with local (Exim 4.80)
(envelope-from <joshua@this.server>)
id 1U2O4i-0000hR-Je
for root@this.server; Mon, 04 Feb 2013 10:35:16 -0500
To: root@this.server
Auto-Submitted: auto-generated