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.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
send out emails fine but can't receive incoming emails
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: starting the Postfix mail system
postfix/master: daemon started -- version 2.9.3, configuration /etc/postfix
postfix/smtpd: connect from localhost[127.0.0.1]
postfix/smtpd: C26FA4093F: client=localhost[127.0.0.1]
postfix/cleanup: C26FA4093F: message-id=<firstname.lastname@example.org>
postfix/qmgr: C26FA4093F: from=<email@example.com>, size=581, nrcpt=1 (queue active)
postfix/smtpd: disconnect from localhost[127.0.0.1]
postfix/smtp: C26FA4093F: to=<firstname.lastname@example.org>, relay=mta6.am0.yahoodns.net[188.8.131.52]:25, delay=2.8, delays=0.1/0.04/1.1/1.6, dsn=2.0.0, status=sent (250 ok dirdel)
postfix/qmgr: C26FA4093F: removed
postfix/smtpd: connect from nm1.bullet.mail.sp2.yahoo.com[184.108.40.206]
postfix/smtpd: 74C524093F: client=nm1.bullet.mail.sp2.yahoo.com[220.127.116.11]
postfix/cleanup: 74C524093F: message-id=<1341282748.52540.YahooMailNeo@web113419.mail.gq1.yahoo.com>
postfix/qmgr: 74C524093F: from=<email@example.com>, size=4063, nrcpt=1 (queue active)
postfix/virtual: 74C524093F: to=<firstname.lastname@example.org>, relay=virtual, delay=1, delays=0.95/0.02/0/0.04, dsn=2.0.0, status=sent (delivered to maildir)
postfix/qmgr: 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:
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/
mail_location = maildir:%h
user_query = SELECT virtual_mailbox AS home, virtual_uid AS uid, virtual_gid AS gid FROM users where email = '%u';
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 03: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'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 :-)