PDA

View Full Version : Dovecot running but mails are not delivered



brivelt
02-25-2015, 04:11 AM
Hi,

I do have some issues with delivering e-mails that should be send using phpmail, sendmail etc.

The problem is, when a client adds a contactform to their website, which send the contents to the given emailaddress the email is not delivered but the form tells it has been succesfully sent.

Any ideas?

toml
02-25-2015, 05:56 AM
There could be a few issues, first Dovecot does not deliver your email, that is what exim does. But you do need both exim and dovecot to agree to store email the same exact way so that when you connect to dovecot, it knows where to find your email. First thing is to look at your /var/log/exim/mainlog and find where it delivered that message, then double check that your /etc/exim.conf and /etc/dovecot/dovecot.conf files both are configured to use the same mechanism (Maildir). Assuming it was all installed via custombuild you may need to repeat those steps to make sure your config files are correct.

brivelt
02-25-2015, 06:42 AM
Thanks for your reply.

The log tells me the mail has been bounced.

I'm using the following exim config: http://files.directadmin.com/services/exim.conf
and the dovecot config isn't edited. and has mail_location set to: maildir:~/Maildir

I might miss some settings in exim.conf. What are the recommend/required settings in order to deliver an email?

toml
02-25-2015, 07:18 AM
If you haven't edited your exim.conf from the one above, then you are delivering email in mbox format to /var/spool/mail/$user and /var/virtual/mail/$domain/$user or something similar to that. You most likely want to go to your custombuild directory and do:
./build todovecot
that should re-write your conf files to use Maildir instead of mbox for mail delivery.

Or, I would recommend you grab the latest spamblocker from Jeff at:
http://www.nobaloney.net/spamblocker.html
that is already configured for Maildir and with some minor edits should work just fine, just make sure your exim.pl is compatible with that version of exim.conf, read the instructions carefully.

brivelt
02-25-2015, 07:20 AM
Hi toml,

I have downloaded the latest spamblocker v4.2.3 and changed the required configurations. I also have the required exim.pl but it's still not working.

toml
02-25-2015, 07:33 AM
Without more information no one will be able to help you. There are million reasons it wouldn't work, but the logs are the only way to help figure it out.

brivelt
02-25-2015, 07:45 AM
mainlog:

2015-02-25 16:41:01 cwd=/ 9 args: /usr/sbin/sendmail -FCronDaemon -i -odi -oem -oi -t -f root
2015-02-25 16:41:02 1YQe57-000JeK-JZ <= root@server4.lupio.nl U=root P=local S=882 T="Cron <root@server4> /usr/local/directadmin/dataskq" from <root@server4.lupio.nl> for root
2015-02-25 16:41:02 cwd=/var/spool/exim 4 args: /usr/sbin/exim -odi -Mc 1YQe57-000JeK-JZ
2015-02-25 16:41:02 1YQe57-000JeK-JZ ** dave@lupio.nl <root@server4.lupio.nl> F=<root@server4.lupio.nl> R=virtual_aliases:
2015-02-25 16:41:02 cwd=/var/spool/exim 8 args: /usr/sbin/exim -odi -t -oem -oi -f <> -E1YQe57-000JeK-JZ
2015-02-25 16:41:02 1YQe58-000JeN-4M <= <> R=1YQe57-000JeK-JZ U=mail P=local S=1718 T="Mail delivery failed: returning message to sender" from <> for root@server4.lupio.nl
2015-02-25 16:41:02 cwd=/var/spool/exim 4 args: /usr/sbin/exim -odi -Mc 1YQe58-000JeN-4M
2015-02-25 16:41:02 1YQe58-000JeN-4M ** dave@lupio.nl <root@server4.lupio.nl> F=<> R=virtual_aliases:
2015-02-25 16:41:02 1YQe58-000JeN-4M Frozen (delivery error message)
2015-02-25 16:41:02 1YQe57-000JeK-JZ Completed

toml
02-25-2015, 11:55 AM
mail delivery to root is typically disabled. Try adding something similar to:
root: nonroot@domain.com
to the bottom of your /etc/aliases file. That will redirect all root messages to a non-root email account. Obviously you need to change nonroot@domain.com to a valid email address you have access to.

brivelt
02-25-2015, 02:26 PM
already done.

# Person who should get root's mail
root: b.veldman@lupio.nl
diradmin: :blackhole:

No difference.

zEitEr
02-25-2015, 10:23 PM
after modifying /etc/aliases you should run


newaliases

as root.

brivelt
02-26-2015, 02:05 AM
No difference.

I tried to send an email using a php form.

2015-02-26 11:01:58 cwd=/home/mgbpyhdv/domains/eatthelemon.nl/public_html 5 args: /usr/sbin/sendmail -t -i -f mgbpyhdv@eatthelemon.nl
2015-02-26 11:01:58 1YQvGY-000Eqj-Jv <= mgbpyhdv@eatthelemon.nl U=mgbpyhdv P=local S=564 T="Website Visitor Message" from <mgbpyhdv@eatthelemon.nl> for info@eatthelemon.nl
2015-02-26 11:01:58 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1YQvGY-000Eqj-Jv
2015-02-26 11:01:58 1YQvGY-000Eqj-Jv ** info@eatthelemon.nl F=<mgbpyhdv@eatthelemon.nl> R=virtual_aliases:
2015-02-26 11:01:58 cwd=/var/spool/exim 7 args: /usr/sbin/exim -t -oem -oi -f <> -E1YQvGY-000Eqj-Jv
2015-02-26 11:01:58 1YQvGY-000Eqm-Ok <= <> R=1YQvGY-000Eqj-Jv U=mail P=local S=1365 T="Mail delivery failed: returning message to sender" from <> for mgbpyhdv@eatthelemon.nl
2015-02-26 11:01:58 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1YQvGY-000Eqm-Ok
2015-02-26 11:01:58 1YQvGY-000Eqj-Jv Completed
2015-02-26 11:01:59 1YQvGY-000Eqm-Ok => mgbpyhdv <mgbpyhdv@eatthelemon.nl> F=<> R=localuser T=local_delivery S=1465
2015-02-26 11:01:59 1YQvGY-000Eqm-Ok Completed

toml
02-26-2015, 07:44 AM
Try scanning some of the files in /var/spool/exim/input. Specifically one that may be named 1YQvGY-000Eqj-Jv-D (your message id followed by -D ) that should have more information about what the error was.

brivelt
02-27-2015, 01:45 AM
Can't find the file with the message id.

1YRHMv-0015o6-9n-H
mail 8 12
<>
1425029881 0
-ident mail
-received_protocol local
-body_linecount 31
-max_received_linelength 137
-allow_unqualified_recipient
-allow_unqualified_sender
-frozen 1425029881
-localerror
XX
1
root@server4.lupio.nl

144P Received: from mail by server4.lupio.nl with local (Exim 4.76)
id 1YRHMv-0015o6-9n
for root@server4.lupio.nl; Fri, 27 Feb 2015 10:38:01 +0100
040 X-Failed-Recipients: dave@lupio.nl
029 Auto-Submitted: auto-replied
060F From: Mail Delivery System <Mailer-Daemon@server4.lupio.nl>
026T To: root@server4.lupio.nl
059 Subject: Mail delivery failed: returning message to sender
049I Message-Id: <E1YRHMv-0015o6-9n@server4.lupio.nl>
038 Date: Fri, 27 Feb 2015 10:38:01 +0100

toml
02-27-2015, 07:11 AM
That is the file that ended with -H try looking for the one with the -D that is the one that will have the important information in it. This one just tells us what we already know (that it can't be delivered).

brivelt
02-27-2015, 07:34 AM
1YRHMv-0015o6-9n-D
This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

dave@lupio.nl
(generated from root@server4.lupio.nl)


------ This is a copy of the message, including all the headers. ------

Return-path: <root@server4.lupio.nl>
Received: from root by server4.lupio.nl with local (Exim 4.76)
(envelope-from <root@server4.lupio.nl>)
id 1YRHMv-0015o3-3V
for root@server4.lupio.nl; Fri, 27 Feb 2015 10:38:01 +0100
From: root@server4.lupio.nl (Cron Daemon)
To: root@server4.lupio.nl
Subject: Cron <root@server4> /usr/local/directadmin/dataskq
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
Message-Id: <E1YRHMv-0015o3-3V@server4.lupio.nl>
Date: Fri, 27 Feb 2015 10:38:01 +0100

/usr/local/directadmin/dataskq: /usr/lib64/libcrypto.so.10: no version information available (required by /usr/local/directadmin/dataskq)
/usr/local/directadmin/dataskq: /usr/lib64/libssl.so.10: no version information available (required by /usr/local/directadmin/dataskq)

toml
02-27-2015, 09:35 AM
That really doesn't help either, the real email and not the return one would have been a better choice. Either way, what do you see when you execute:
exim -bt root@server4.lupio.nl
exim -bt dave@lupio.nl

I am making a lot of assumptions like all your config files are correct, for example your:
/etc/virtual/domains
/etc/virtual/domainowners
/etc/virtual/lupio.nl/passwd
/etc/virtual/lupio.nl/aliases

Those are the files that should tell exim how to deliver the email to your dave@lupio.nl email box. I am also assuming that lupio.nl domain is hosted on the same box.

brivelt
03-04-2015, 04:40 AM
Hi toml,

The ouput of the commands are:

# exim -bt root@server4.lupio.nl
dave@lupio.nl is undeliverable:
<-- root@server4.lupio.nl
# exim -bt dave@lupio.nl
dave@lupio.nl is undeliverable:

I have checked the config files a dozen times as stated on http://help.directadmin.com/item.php?id=16

The lupio.nl domain is not hosted on the same box. That's why the 'from' address is root@server4.lupio.nl.

toml
03-04-2015, 08:44 AM
What is the output of the following command:
grep lupio.nl /etc/virtual/domains /etc/virtual/domainowners

brivelt
03-04-2015, 01:32 PM
it returns the following:
http://pastebin.com/ACvbwprT

toml
03-04-2015, 01:43 PM
Based on:
/etc/virtual/domains:lupio.nl
/etc/virtual/domains:server4.lupio.nl

You have both of these domains configured to deliver email locally.

If you are using an external email server, please see:
http://help.directadmin.com/item.php?id=8

brivelt
03-04-2015, 01:55 PM
Well lupio.nl is not on the DA server anymore. How should I remove it properly?

brivelt
03-04-2015, 02:18 PM
Already figured it out. Emails sent from DA are working now. But not when send from a php contact form using phpmail/sendmail.