Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am configuring postfix and dovecot on my server, but for some reason I can't receive mails. I've followed these instructions for configuring the mailserver. I've tested with pingability.com that port 25 is open (didn't get any errors for the mail), and I am able to send mails. I just can't recieve them, I don't see them in the maildir and I don't see them on squirrelmail.

I am not really a linux expert, so can anyone help me to resolve this problem?

My OS is CentOS 5.5

edit1: According to the logfile /var/log/maillog the mail is received, but probably not deliverd. If I check the logfile directly after i've sent an email, the last lines of the logfile look like this:

Mar 27 23:59:24 vps4195 postfix/smtpd[15822]: connect from mailserver[ip]
Mar 27 23:59:25 vps4195 postfix/smtpd[15822]: 01EE0AD18170: client=server[ip]
Mar 27 23:59:25 vps4195 postfix/cleanup[15826]: 01EE0AD18170: message-id=<someid>
Mar 27 23:59:25 vps4195 postfix/qmgr[7544]: 01EE0AD18170: from=<emailaddress>, size=1980, nrcpt=1 (queue active)
Mar 27 23:59:55 vps4195 postfix/smtpd[15822]: disconnect from server[ip]

edit2: The logfile also contains many of these entries, but I don't really know what to do with them:

Mar 28 00:00:16 vps4195 postfix/virtual[17954]: fatal: bad string length 0 < 1: virtual_mailbox_base =
Mar 28 00:00:17 vps4195 postfix/master[7538]: warning: process /usr/libexec/postfix/virtual pid 17954 exit status 1
Mar 28 00:00:17 vps4195 postfix/master[7538]: warning: /usr/libexec/postfix/virtual: bad command startup -- throttling

edit3: I've fixed the previous error (added a virtual_mailbox_base to the main.cf file), but now the log file gives me this error when it tries to receive an email:

Mar 28 00:11:33 vps4195 postfix/virtual[3089]: E8025AD180BB: to=<email>, relay=virtual, delay=0, delays=0/0/0/0, dsn=5.1.1, status=bounced (unknown user: "email")
Mar 28 00:11:33 vps4195 postfix/qmgr[3077]: E8025AD180BB: removed

edit4: got a little further this time, it looks like I missed a line in the main.cf, but then I got this error:

Mar 28 00:36:15 vps4195 postfix/qmgr[30545]: D7E6DAD18077: from=<mail>, size=755, nrcpt=1 (queue active)
Mar 28 00:36:15 vps4195 postfix/virtual[30610]: warning: recipient mail: not found in virtual_uid_maps
Mar 28 00:36:15 vps4195 postfix/virtual[30610]: D7E6DAD18077: to=<maill>, relay=virtual, delay=0.07, delays=0.05/0/0/0.01, dsn=4.3.5, status=deferred (mail system configuration error)

So I created the virtual_uid_maps and virtual_gid_maps entries in the main.cf file, and everything works now!

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

If I remember correctly, just installing the postfix RPM on a CentOS box gives you a mail server that listens only on localhost. If you hit "netstat -ltnp" you should have a line like so:

tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      2182/master

Make sure it says "0.0.0.0" (rather than "127.0.0.1"). If you don't, add something like:

inet_interfaces = all

to main.cf.

If your server was listening to all interfaces, the /var/log/maillog (at least I think that's where the log is in CentOS) should probably be your next stop. See if there are any relevant lines in there that talks about the mail you expecetd to receive. It should look something like this:

Mar 27 23:14:39 whisper postfix/smtpd[19351]: connect from remote.mailserver.com[A.B.C.D]
Mar 27 23:14:39 whisper postfix/smtpd[19351]: 5E007301D: client=remote.mailserver.com[A.B.C.D]
Mar 27 23:14:39 whisper postfix/cleanup[19355]: 5E007301D: message-id=<his-message-id>                                 
Mar 27 23:14:39 whisper postfix/qmgr[2579]: 5E007301D: from=<sender@example.com>, size=3190, nrcpt=1 (queue active)
Mar 27 23:14:39 whisper postfix/smtpd[19351]: disconnect from remote.mailserver.com[A.B.C.D]

This says the mail was successfully received. On my server the next step is spam cleaning. Then comes the delivery:

Mar 27 23:14:40 whisper postfix/pickup[19293]: 3C05785C0: uid=65534 from=<sender@example.com>     
Mar 27 23:14:40 whisper postfix/cleanup[19355]: 3C05785C0: message-id=<his-message-id>
Mar 27 23:14:40 whisper postfix/qmgr[2579]: 3C05785C0: from=<sender@example.com>, size=3286, nrcpt=1 (queue active)
Mar 27 23:14:40 whisper postfix/local[19363]: 3C05785C0: to=<recipient@example.com>, relay=local, delay=0.06, delays=0.03/0.02/0/0.01, dsn=2.0.0, status=sent (delivered to mailbox)
Mar 27 23:14:40 whisper postfix/qmgr[2579]: 3C05785C0: removed

If you have a line like the next-to-last, mail should be delivered to dovecot, and you need to trace the problem there.

share|improve this answer
    
thanks for your reply! In the maillog file, the first part is there, so the mail was successfully received. The delivery part isn't there, so probably something is wrong after the mail is received. Do you have any ideas on how to solve this? –  Tiddo Mar 27 '11 at 22:02
add comment

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.