| Home Register Memberlist Help Search Quick Links No Replies |
|
#1
|
||||
|
||||
|
Since I am not sure where else to start on this forum, I am going to start with some basic tips for exim troubleshooting. I am relatively familiar with exim, and I actually happen to enjoy using and fixing it.
Exim Troubleshooting Logs Main logging - /var/log/exim_mainlog or /var/log/exim/mainlog Main panic log - /var/log/exim_paniclog or /var/log/exim/paniclog Main reject log - /var/log/exim_rejectlog or /var/log/exim/rejectlog Also, logging for services like IMAP, POP3 and Spam Assassin writes to /var/log/maillog (not really exim here, but I might as well mention this log file) ___________________________________ Port Checking Exim usually runs on port 25 and possibly 26 or 587 for an alternate port. To check if it is working on a server, telnet would be a good tool to use: Code:
telnet servername 25 Code:
telnet IP# 25 Code:
Trying IP#... Connected to domain.com. Escape character is '^]'. 220-server.domain.com ESMTP Exim 4.69 #1 Sat, 21 Nov 2009 17:18:29 -0800 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail. Notably, the response in the 220-server.domain.com ESMTP area indicates the server's port 25 response. The PTR or rDNS (reverse DNS) record should be the same in the DNS zone as this response, so basically server.domain.com. If the rDNS does not match the server's response, many email servers may reject or spam flag the email sent by the server. To find out the PTR record for a domain's IP, use the following command: Code:
dig -x IP# +short Code:
server.domain.com To see the hostname for a server on the server itself, issue the following command: Code:
hostname The hostname must be a fully qualified domain name (FQDN) with a DNS zone A record on the server. A subdomain for a domain on the server works best, since many servers will have a conflict in functionality if a domain name with a site on the server is used for the server's hostname. As such, avoid using mydomain.com and pick something like server.mydomain.com for the hostname instead. ___________________________________ Checking exim's mainlog To check how an email sent or received on the server routed, or for error messages received for that email address, exigrep command should be issued: Code:
exigrep admin@mydomain.com /var/log/exim_mainlog The output may look similar to the following: Code:
2009-11-21 04:02:34 1NBofi-0003mK-Sq <= root@server.domain.com U=root P=local S=53427 2009-11-21 04:02:38 1NBofi-0003mK-Sq => admin@mydomain.com R=lookuphost T=remote_smtp H=gmail-smtp-in.l.google.com [IP#] 2009-11-21 04:02:38 1NBofi-0003mK-Sq Completed I did want to mention why exigrep is being used rather than a simple egrep or grep for the log. I can illustrate this with running an egrep on the log and then comparing it to the exigrep above. First, let's say we egrep for the email account admin@mydomain.com: Code:
egrep admin@mydomain.com /var/log/exim_mainlog Code:
2009-11-21 04:02:38 1NBofi-0003mK-Sq => admin@mydomain.com R=lookuphost T=remote_smtp H=gmail-smtp-in.l.google.com [IP#] Code:
2009-11-21 04:02:34 1NBofi-0003mK-Sq <= root@server.domain.com U=root P=local S=53427 2009-11-21 04:02:38 1NBofi-0003mK-Sq => admin@mydomain.com R=lookuphost T=remote_smtp H=gmail-smtp-in.l.google.com [IP#] 2009-11-21 04:02:38 1NBofi-0003mK-Sq Completed ___________________________________ Checking MX record entries To see the MX record entries for a domain, use the following command: Code:
dig mx domain.com +short Code:
0 domain.com. Code:
5 alt1.server.domain.com. 5 alt2.server.domain.com. 10 alt3.server.domain.com. 0 server.domain.com. Of note, the MX records received from running dig are dependent on the server's resolver. This means that one machine might return different results than another machine if their resolvers have different records returning. Sometimes, MX records are changed and a resolver caches the old records for a period of time, so always check a couple of different sources for the MX record information. ___________________________________ Resolver routing records To see how a specific server will route a given email address, check the routing for that email using the following command: Code:
exim -bt admin@mydomain.com Code:
admin@mydomain.com router = lookuphost, transport = remote_smtp host mydomain.com [IP#] MX=0 Code:
admin2@mydomain.com router = lookuphost, transport = remote_smtp host alt1.server.domain.com [IP1] MX=5 host alt2.server.domain.com [IP2] MX=10 host alt3.server.domain.com [IP3] MX=30 ___________________________________ Sending Test Email from Command Line To send a test email from one server to another, the following command would be used: Code:
exim -odf -v admin@mydomain.com Example message. . An example output that might occur for such a session would be the following: Code:
LOG: MAIN
<= root@server.domain.com U=root P=local S=336
delivering 1NC1Y4-0007T7-VS
Connecting to server.mydomain.com [receiving-IP#]:25 ... connected
SMTP<< 220-server.mydomain.com ESMTP Exim 4.69 #1
Sat, 21 Nov 2009 19:47:27 -0600
220-We do not authorize the use of this system to transport
unsolicited,
220 and/or bulk e-mail.
SMTP>> EHLO server.domain.com
SMTP<< 250-server.mydomain.com Hello domain.com [sending-IP#]
250-SIZE 52428800
250-PIPELINING
250-AUTH PLAIN LOGIN
250-STARTTLS
250 HELP
SMTP>> STARTTLS
SMTP<< 220 TLS go ahead
SMTP>> EHLO server.domain.com
SMTP<< 250-server.mydomain.com Hello domain.com [sending-IP#]
250-SIZE 52428800
250-PIPELINING
250-AUTH PLAIN LOGIN
250 HELP
SMTP>> MAIL FROM:<root@server.mydomain.com> SIZE=1368
SMTP>> RCPT TO:<admin@mydomain.com>
SMTP>> DATA
SMTP<< 250 OK
SMTP<< 250 Accepted
SMTP<< 354 Enter message, ending with "." on a line by itself
SMTP>> writing message and terminating "."
SMTP<< 250 OK id=1NC1Y1-00052F-8p
SMTP>> QUIT
LOG: MAIN
=> admin@mydomain.com R=lookuphost
T=remote_smtp H=server.domain.com [receiving-IP#]
X=TLSv1:AES256-SHA:256
LOG: MAIN
Completed
To increase the logging debug output for the session, replace the -v with a -d instead, resulting in this command: Code:
exim -odf -d admin@mydomain.com |
|
#2
|
|||
|
|||
|
Hi Miraenda, thanks for your tutorial
![]() I have a small issue with Exim that i hope you might be able to help me with. Here is the scenario, i have installed and configured everything and can receive mail for admin@mydomain.com (it gets stored in the local Maildir). Then i set up a forward address for admin: Code:
admin: myadress@gmail.com Code:
exim -odf -v admin@mydomain.com Example message. . Then i send the same email to admin@mydomain from an external address (regular email). I then check the mainlog on the server with exigrep: Code:
2010-04-20 04:24:56 1O48lM-00059d-46 SA: Debug: SAEximRunCond expand returned: '1' 2010-04-20 04:24:56 1O48lM-00059d-46 SA: Debug: check succeeded, running spamc 2010-04-20 04:24:58 1O48lM-00059d-46 SA: Action: flagged as Spam but accepted: score=5.4 required=5.0 (scanned in 2/2 secs | Message-Id: l2j36ba9b061004200124u95ab8ae1mbc12490e83da2d14@mail.gmail.com). From <myotheraddress@gmail.com> (host=mail-bw0-f219.google.com [209.85.218.219]) for admin@mydomain.com 2010-04-20 04:24:58 1O48lM-00059d-46 <= myotheraddress@gmail.com H=mail-bw0-f219.google.com [209.85.218.219] P=esmtp S=2480 id=l2j36ba9b061004200124u95ab8ae1mbc12490e83da2d14@mail.gmail.com 2010-04-20 04:25:03 1O48lM-00059d-46 => myaddress@gmail.com <admin@mydomain.com> R=dnslookup T=remote_smtp H=cluster.onlinemailscanner.com [81.4.88.154] 2010-04-20 04:25:03 1O48lM-00059d-46 Completed Do you have any idea what could be causing this? Thanks in advance for any insight. ![]() -lite |
|
#3
|
||||
|
||||
|
Hi and welcome lite
![]() For this routing: Code:
2010-04-20 04:24:56 1O48lM-00059d-46 SA: Debug: SAEximRunCond expand returned: '1' 2010-04-20 04:24:56 1O48lM-00059d-46 SA: Debug: check succeeded, running spamc 2010-04-20 04:24:58 1O48lM-00059d-46 SA: Action: flagged as Spam but accepted: score=5.4 required=5.0 (scanned in 2/2 secs | Message-Id: l2j36ba9b061004200124u95ab8ae1mbc124...mail.gmail.com). From <myotheraddress@gmail.com> (host=mail-bw0-f219.google.com [209.85.218.219]) for admin@mydomain.com 2010-04-20 04:24:58 1O48lM-00059d-46 <= myotheraddress@gmail.com H=mail-bw0-f219.google.com [209.85.218.219] P=esmtp S=2480 id=l2j36ba9b061004200124u95ab8ae1mbc124...mail.gmail.com 2010-04-20 04:25:03 1O48lM-00059d-46 => myaddress@gmail.com <admin@mydomain.com> R=dnslookup T=remote_smtp H=cluster.onlinemailscanner.com [81.4.88.154] 2010-04-20 04:25:03 1O48lM-00059d-46 Completed Also, is the sender address to admin@mydomain.com actually myotheraddress@gmail.com as it's hard to believe that a gmail address would get flagged as spam by your machine. If it is, you might need to update the SpamAssassin rulesets to ensure you have the latest ones: sa-update -D Or, on cPanel systems: /scripts/update_sa_rules Thanks.
__________________
Miraenda ~ Ex uno disce omnes ~ |
|
#4
|
|||
|
|||
|
Thanks for your reply Miraenda
![]() I did another test to avoid that spam score: Code:
2010-04-20 08:58:55 1O4D2V-0005MU-7M SA: Debug: SAEximRunCond expand returned: '1' 2010-04-20 08:58:55 1O4D2V-0005MU-7M SA: Debug: check succeeded, running spamc 2010-04-20 08:58:56 1O4D2V-0005MU-7M SA: Action: scanned but message isn't spam: score=2.7 required=5.0 (scanned in 1/1 secs | Message-Id: r2u36ba9b061004200558pb18b963ajdfefce56520cff34@mail.gmail.com). From <*****.*****@gmail.com> (host=mail-bw0-f219.google.com [209.85.218.219]) for admin@mydomain.com 2010-04-20 08:58:56 1O4D2V-0005MU-7M <= *****.*****@gmail.com H=mail-bw0-f219.google.com [209.85.218.219] P=esmtp S=2512 id=r2u36ba9b061004200558pb18b963ajdfefce56520cff34@mail.gmail.com 2010-04-20 08:59:02 1O4D2V-0005MU-7M => *****.*****@gmail.com <admin@mydomain.com> R=dnslookup T=remote_smtp H=gmail-smtp-in.l.google.com [74.125.67.27] 2010-04-20 08:59:02 1O4D2V-0005MU-7M Complete ![]() Here too when i remove the forward the mail gets delivered to the local Maildir without problems, and sending it from the server itself (with exim -odf) does get it delivered to gmail almost instantly. Strange huh? |
|
#5
|
||||
|
||||
|
If the message were actually stuck, you could view the headers:
exim -Mvh <message-id> So, like the following: exim -Mvh 104D2V-0005MU-7M But it doesn't really seem the message is stuck. Do you have any other filters on that account? It should show the filter processing it, though, and I only see the spam filtering. If you do have any other filters, I would take them offline. If you have anything other than spam assassin handling scanning main also, I would take it offline. Again, if you send the email from outside to the machine to that admin@mydomain.com address, is it reaching admin@mydomain.com itself even? I realize it isn't going to gmail, but is it at least getting into the admin@mydomain.com box? Thanks.
__________________
Miraenda ~ Ex uno disce omnes ~ |
|
#6
|
|||
|
|||
|
You mean stuck as in the queue? The queue shows empty with exim -bp | exiqsumm.
Quote:
). If i keep the forward and send a mail locally to admin, it gets delivered to remote (gmail) fine. So the only failing scenario is mail coming from outside, going outside...I will check for other filters running. For reference, this was the how-to i followed to install everything: http://koivi.com/exim4-config/ Thanks again
|
|
#7
|
||||
|
||||
|
I wasn't actually wondering about when the forward was removed for it as I did see you state that. I wanted to know with the forward existing if you get the message in your admin@mydomain.com account as, if the box exists, you should both get a copy in that box and then it should also forward. So, I wanted to know if you got the email in that admin@mydomain.com box *with* the forwarder existing.
If the message is there in the box, it would be helpful to see the header (for the message that did arrive at admin@mydomain.com but did not forward to gmail). It's a very strange scenario that I've never seen happening when a filter wasn't involved somehow impacting routing.
__________________
Miraenda ~ Ex uno disce omnes ~ |
|
#8
|
|||
|
|||
|
Ah right i understand
![]() The message does get saved, here it is integrally: http://pastebin.org/162678 All the filters/routers are 'stock' Debian afaik, i haven't made any changes unless they were specifically mentioned in the how-to. |
|
#9
|
||||
|
||||
|
You aren't by chance trying to email from your gmail account to that admin@mydomain.com account and then have it re-forward to your same gmail account?
I tested that myself by sending from my gmail account to an email account on my machine (miraenda@lunaradmin.com), which I put a forward on back to my same gmail account. Gmail wouldn't route it even though the email shows the same as your example above on it completing: [root@synthesis ~]# exigrep miraenda@lunaradmin.com /var/log/exim_mainlog 2010-04-20 13:09:20 1O4Jl2-0005RE-J0 <= me@gmail.com H=mail-vw0-f48.google.com [209.85.212.48] P=esmtp S=1857 id=k2r4f1bee21004201309v5b678b1aw60e9af7040b194c3@ mail.gmail.com 2010-04-20 13:09:23 1O4Jl2-0005RE-J0 => me@gmail.com <miraenda@lunaradmin.com> R=lookuphost T=remote_smtp H=gmail-smtp-in.l.google.com [209.85.222.25] 2010-04-20 13:09:23 1O4Jl2-0005RE-J0 Completed Google is probably seeing it as a loop, so it's not going to deliver it. You cannot send an email from a gmail account to forward back to that same gmail account by transmitting it through your server. If you are using a different gmail account than is being forwarded, I'm not sure why it isn't working. If you are using the same account for gmail to re-forward it back to, I'd test with a new gmail account that's different because I think that's going to work. It's just when using the same gmail account that is being forwarded that you won't get the email (and this is why the local deliveries worked as they aren't coming from the exact same gmail account). Thanks.
__________________
Miraenda ~ Ex uno disce omnes ~ |
|
#10
|
|||
|
|||
|
Uh oh, i believe you are right Miraenda... I was using different email addresses to test, but i was sending them through gmail. Apparently it doesn't matter whether it's a gmail address, as long as you send through gmail it will be seen as a loop...
![]() I just sent a few messages through php and they all are delivered. ![]() Wow, silly, thanks a lot for that suggestion though! -lite Last edited by litemotiv; 21 April 2010 at 02:28. Reason: typo |
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. |
||