send out emails fine but can't receive incoming emails
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
send out emails fine but can't receive incoming emails
Hi,
I have this strange problem here. I can send emails out but don't see any incoming emails when I should have received them. I tested it to my external email account as well as locally to myself. None actually works.
Here is the log file from /var/log/mail.log
postfix/postfix-script[3198]: starting the Postfix mail system
postfix/master[3199]: daemon started -- version 2.9.3, configuration /etc/postfix
postfix/smtpd[3391]: connect from localhost[127.0.0.1]
postfix/smtpd[3391]: C26FA4093F: client=localhost[127.0.0.1]
postfix/cleanup[3400]: C26FA4093F: message-id=<6c89bd325bf02b8b4e66d8d55a09a1b7@mycompanydomain.com>
postfix/qmgr[3201]: C26FA4093F: from=<mharry@mycompanydomain.com>, size=581, nrcpt=1 (queue active)
postfix/smtpd[3391]: disconnect from localhost[127.0.0.1]
postfix/smtp[3403]: C26FA4093F: to=<myself@yahoo.com.au>, relay=mta6.am0.yahoodns.net[98.136.217.202]:25, delay=2.8, delays=0.1/0.04/1.1/1.6, dsn=2.0.0, status=sent (250 ok dirdel)
postfix/qmgr[3201]: C26FA4093F: removed
postfix/smtpd[3415]: connect from nm1.bullet.mail.sp2.yahoo.com[98.139.91.71]
postfix/smtpd[3415]: 74C524093F: client=nm1.bullet.mail.sp2.yahoo.com[98.139.91.71]
postfix/cleanup[3400]: 74C524093F: message-id=<1341282748.52540.YahooMailNeo@web113419.mail.gq1.yahoo.com>
postfix/qmgr[3201]: 74C524093F: from=<myself@yahoo.com.au>, size=4063, nrcpt=1 (queue active)
postfix/virtual[3419]: 74C524093F: to=<mharry@mycompanydomain.com>, relay=virtual, delay=1, delays=0.95/0.02/0/0.04, dsn=2.0.0, status=sent (delivered to maildir)
postfix/qmgr[3201]: 74C524093F: removed
From the log file, it seems that I should have received and read the emails from my roundcubemail.
Usually means it has been delivered (written to file) *somewhere*. That *somewhere* is defined by what your sql returns thanks to virtual_mailbox_maps (/etc/postfix/mysql/mysql-virtual_mailboxes.cf). At a guess I'd say look in /home/vmail/mharry/new OR /home/vmail/mycompanydomain/mharry/new. Poke around with the ls in these areas and see what turns up.
If you can find where the mail has been delivered to, you can then cross check that both Dovecot & Roundcube are looking in the right place for it.
That's what my first guess was after reading from the log file and saw that it says "delivered to Maildir" but became doubtful when not receiving any emails at all.
I already poked into /home/vmail/mycompanydomain/mharry/new and /home/vmail/mycompanydomain/mharry/cur, and found that all my "sent emails" files are in /home/vmail/mycompanydomain/mharry/new. Also what confuses me all the more is that I found /Maildir folder under /home/vmail/mycompanydomain/mharry/ and in it, there are /cur, /new and /tmp. So something must have been incorrectly configured. But I got a feeling my roundcube has not been reading from the right inbox.
I'd forget Roundcube for a moment and get Dovecot working. You've established that Postfix is delivering correctly. If I were troubleshooting this I'd next check that I could telnet to Dovecot on 110 (pop) and log in, running basic POP commands to check to see if I could read messages. Telnet is useful as you get good error feedback.
I suspect the issue is Dovecot is looking in the wrong place. The older 'how to' articles were great, but Dovecot's config has changed slightly (you may have some clues in the logs), and this broke stuff - particularly the home directory of Virtual Mail users.
My notes from the last mail server I put together with Dovecot reads:
Quote:
Relative home directory paths are giving errors now. They were never supported, but earlier they just didn't usually cause problems. If you were using e.g. mail_location = maildir:/var/mail/%h, just change it to mail_location = maildir:%h and add /var/mail/ prefix to home dirs.
SO OUR FIX IS:
edit dovecot.conf change
mail_location = maildir:/path/to/mail/%h/
TO
mail_location = maildir:%h
edit dovecot-sql.conf
user_query = SELECT virtual_mailbox AS home, virtual_uid AS uid, virtual_gid AS gid FROM users where email = '%u';
TO
user_query = SELECT concat('/path/to/mail', virtual_mailbox) AS home, virtual_uid AS uid, virtual_gid AS gid FROM users where email = '%u';
Obviously these are system specific and if this is your problem you'll need to alter them to suit your setup. Before that, though, I'd check for any clues in the logs. Can you talk to Dovecot by Telnet OK and log in?
Last edited by leslie_jones; 07-04-2012 at 02:02 AM.
Can you talk to Dovecot by Telnet OK and log in?
Yes, I can by telnet.
Leslie, prior to telnet, I actually did a test by sending a dummy email from my Yahoo email address, however, as you could tell, both the exists and recent show 0 number of emails (when it's suppose to have received an email from my Yahoo). So I got a feeling that dovecot is not looking in the right place (which I agree with you).
$ telnet mycompanydomain.com 143
Connected to mycompanydomain.com.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot IMAP4 Server ready.
a login mharry mharrypassword
a OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS SPECIAL-USE SEARCH=FUZZY] Logged in
b select inbox
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.
* 0 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1341200706] UIDs valid
* OK [UIDNEXT 1] Predicted next UID
* OK [NOMODSEQ] No permanent modsequences
b OK [READ-WRITE] Select completed.
At this point, I'll read through your notes see if I can adjust it to suit my system requirements.
I suspect that it's just looking in the wrong place for the mailbox - or does not have the correct permissions. This will all be set in dovecot.conf around these lines:
I'm not familiar with Roundcube, but a quick look at its page and it looks like it talks IMAP to Dovecot - so fix that, you fix Roundcube. But... I may be wrong! Glad you have it working, that's a great start to the day :-)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.