make Imap work with postfix / dovecot

Hello,

I set up a linode to be a mail server. Debian Lenny + postfix + dovecot + mysql + virtual mailboxes + Imap.

A user wants to use his Mac's Mail application to get to his mails. Reading the mail works but sending emails does not.

In the preferences of the Mail app, username and password are easy; the email account and its password.

(1) But, what is the "server name"?

(2) Can it be the default li103-217.members.linode.com?

(3) Do I have to rename that fully-qualified hostname?

(4) Assuming I own the domain example.com, could I user something like smtp.example.com? What kind of DNS entries should I make for that?

Thanks

9 Replies

@jcr:

(1) But, what is the "server name"?
Don't really understand the question. My version of Mail (3.6 - the current version) asks for Incoming Mail Server: (sounds like you have that set up OK) and Outgoing Mail Server (SMTP): - this need to be the name or IP address of an SMTP server.

~~![](<URL url=)http://www.xs4all.nl/~clissold/mail_window.png" />

@jcr:

(2) Can it be the default li103-217.members.linode.com?
Yes - but it needs to match the 'mydomain =' and 'myhostname =' directives in the postfix main.cf file.

@jcr:

(3) Do I have to rename that fully-qualified hostname?
Not necessarily - see (2).

@jcr:

(4) Assuming I own the domain example.com, could I user something like smtp.example.com? What kind of DNS entries should I make for that?
Yes. smtp.example.com. 7200 IN A 97.107.142.217 ~~

Hi Peter,

Thank for your help. Let me give a bit more of background.

On the server, I have several domains (virtualmailboxdomains is defined) and the incoming mail servers are:

mail.example.com

mail.foo.com

All works very well, except for the sending email from a local app like Mail with IMAP.

Ideally, the outgoing email servers would also be

mail.example.com

mail.foo.com

with the appropriate email /password

how could that work?

In any case, I followed your advice and adjusted my main.cf file:

I already had:

myhostname = liXX-231.members.linode.com

and I added

mydomain = liXX-231.members.linode.com

but that does not work any better.

Thanks again!

IMAP isn't involved in sending mail, so the title of this thread might be a little confusing. Mail is sent using SMTP, which puts it in the realm of Postfix.

What happens when you try to send mail from a client? Any error messages? What shows up in Postfix's log file?

The Mac's Mail app returns "The smtp server xxx is not responding…"

When I ping that server, it seems responsive though

If you do "netstat -nlp" on the server, where is postfix listening? (This will usually show up with "master" as the process name.)

Which port is Mail.app trying to connect to? Can you successfully "telnet your.server 25" and/or "telnet your.server 587" from your Mac?

Hoopycat,

I believe that postfix is listening to port 25. I am pasting the report below in case I am misreading it.

That's interesting because doing:

telnet server's ip 25

returns

Operation timed out

telnet: Unable to connect to remote host

telnet server's ip 587

returns

Connection refused

telnet: Unable to connect to remote host

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN      2376/vsftpd         
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      2340/cupsd          
tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN      2464/master         
tcp        0      0 :::993                      :::*                        LISTEN      2386/dovecot        
tcp        0      0 :::110                      :::*                        LISTEN      2386/dovecot        
tcp        0      0 :::143                      :::*                        LISTEN      2386/dovecot        
tcp        0      0 :::80                       :::*                        LISTEN      2477/httpd          
tcp        0      0 :::22                       :::*                        LISTEN      2330/sshd           
udp        0      0 0.0.0.0:68                  0.0.0.0:*                               2227/dhclient       
udp        0      0 0.0.0.0:631                 0.0.0.0:*                               2340/cupsd          
udp        0      0 67.18.186.231:123           0.0.0.0:*                               2364/ntpd           
udp        0      0 127.0.0.1:123               0.0.0.0:*                               2364/ntpd           
udp        0      0 0.0.0.0:123                 0.0.0.0:*                               2364/ntpd           
udp        0      0 fe80::fcfd:43ff:fe1:123     :::*                                    2364/ntpd           
udp        0      0 ::1:123                     :::*                                    2364/ntpd           
udp        0      0 :::123                      :::*                                    2364/ntpd           
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node PID/Program name    Path
unix  2      [ ACC ]     STREAM     LISTENING     4839   2340/cupsd          /var/run/cups/cups.sock
unix  2      [ ACC ]     STREAM     LISTENING     5347   2464/master         public/cleanup
unix  2      [ ACC ]     STREAM     LISTENING     4970   2386/dovecot        /var/run/dovecot/dict-server
unix  2      [ ACC ]     STREAM     LISTENING     5641   2538/saslauthd      /var/run/saslauthd/mux
unix  2      [ ACC ]     STREAM     LISTENING     4972   2386/dovecot        /var/run/dovecot/login/default
unix  2      [ ACC ]     STREAM     LISTENING     4978   2386/dovecot        /var/run/dovecot/auth-worker.2389
unix  2      [ ACC ]     STREAM     LISTENING     5030   2389/dovecot-auth   /var/spool/postfix/private/auth
unix  2      [ ACC ]     STREAM     LISTENING     5354   2464/master         private/tlsmgr
unix  2      [ ACC ]     STREAM     LISTENING     5358   2464/master         private/rewrite
unix  2      [ ACC ]     STREAM     LISTENING     5362   2464/master         private/bounce
unix  2      [ ACC ]     STREAM     LISTENING     5366   2464/master         private/defer
unix  2      [ ACC ]     STREAM     LISTENING     5370   2464/master         private/trace
unix  2      [ ACC ]     STREAM     LISTENING     5374   2464/master         private/verify
unix  2      [ ACC ]     STREAM     LISTENING     5378   2464/master         public/flush
unix  2      [ ACC ]     STREAM     LISTENING     5382   2464/master         private/proxymap
unix  2      [ ACC ]     STREAM     LISTENING     5386   2464/master         private/smtp
unix  2      [ ACC ]     STREAM     LISTENING     5390   2464/master         private/relay
unix  2      [ ACC ]     STREAM     LISTENING     5394   2464/master         public/showq
unix  2      [ ACC ]     STREAM     LISTENING     5398   2464/master         private/error
unix  2      [ ACC ]     STREAM     LISTENING     5402   2464/master         private/discard
unix  2      [ ACC ]     STREAM     LISTENING     5406   2464/master         private/local
unix  2      [ ACC ]     STREAM     LISTENING     5410   2464/master         private/virtual
unix  2      [ ACC ]     STREAM     LISTENING     5414   2464/master         private/lmtp
unix  2      [ ACC ]     STREAM     LISTENING     5418   2464/master         private/anvil
unix  2      [ ACC ]     STREAM     LISTENING     5422   2464/master         private/scache
unix  2      [ ACC ]     STREAM     LISTENING     5426   2464/master         private/maildrop
unix  2      [ ACC ]     STREAM     LISTENING     5430   2464/master         private/old-cyrus
unix  2      [ ACC ]     STREAM     LISTENING     5434   2464/master         private/cyrus
unix  2      [ ACC ]     STREAM     LISTENING     5438   2464/master         private/uucp
unix  2      [ ACC ]     STREAM     LISTENING     5442   2464/master         private/ifmail
unix  2      [ ACC ]     STREAM     LISTENING     5446   2464/master         private/bsmtp
unix  2      [ ACC ]     STREAM     LISTENING     5119   2405/socket --delay /var/spool/postfix/postgrey/socket
unix  2      [ ACC ]     STREAM     LISTENING     5572   2509/xfs            /tmp/.font-unix/fs7100

Your ISP is blocking access to port 25, this is actually quite common. You can either configure Postfix to listen to an additional port (usually 587), or use one of the various tunelling methods.

(1) would that mean that if I were to connect to the Internet from another ISP who allows port 25 (maybe in a totally different country), I would actually be able to connect to that port 25?

(2) I think I am going to open another port like 587

I added

587 inet n - n - - smtpd

to my master.cf file

[Is that enough?]

and it works!!!!

Thank you very much to all

That commented chunk of code in master.cf talking about "submission" exists for a reason…

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct