Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can you recommend a *SIMPLE* mail setup
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Biru
n00b
n00b


Joined: 29 Aug 2010
Posts: 20

PostPosted: Wed Sep 01, 2010 11:28 am    Post subject: Can you recommend a *SIMPLE* mail setup Reply with quote

I have a Gentoo server which I use for meddling/tinkering and getting to know the system. I have got Apache/PHP/MySQL, SSH, FTP all working fine and now I'd like to add mail. I had hoped it would be as easy as emerge postfix then editing /etc/postfix/postfix.conf but apparently not.

Is there a simple way of getting a mail server up and running to serve no more than two or three users on my system, preferably allowing SMTP/POP3 access using existing user accounts (that is, I can log in to my email user the same credentials I would if logging into FTP or SSH). As an aside, the server has a web accessible address using noip, and I'd like to be able to access it from the web.

Help?
Back to top
View user's profile Send private message
Biru
n00b
n00b


Joined: 29 Aug 2010
Posts: 20

PostPosted: Wed Sep 01, 2010 11:29 am    Post subject: Reply with quote

I should have clarified, the reason I ask for a simple one is that I've looked at a number of HOWTO pages and they all seem geared at much larger systems with webmail access etc going on. Perhaps later down the line I'll look at that, but right now, being able to receive emails through a normal mail client for one or two users is fine.
Back to top
View user's profile Send private message
Veldrin
Veteran
Veteran


Joined: 27 Jul 2004
Posts: 1945
Location: Zurich, Switzerland

PostPosted: Wed Sep 01, 2010 11:33 am    Post subject: Reply with quote

this should be possible... (i recently did it, and it seems to work; except for web access, which I do not have)

you will another program/package to provide pop3/imap functionality. I use dovecot, and am pretty happy with it. alternatively you could use cyrus.

I can post my config, but you have to wait till tonight.


cheers
V.
Back to top
View user's profile Send private message
Biru
n00b
n00b


Joined: 29 Aug 2010
Posts: 20

PostPosted: Wed Sep 01, 2010 1:33 pm    Post subject: Reply with quote

Thanks. Do all mtas require MySQL etc etc? I want to keep this as simple as possible.
Back to top
View user's profile Send private message
Veldrin
Veteran
Veteran


Joined: 27 Jul 2004
Posts: 1945
Location: Zurich, Switzerland

PostPosted: Wed Sep 01, 2010 2:04 pm    Post subject: Reply with quote

no at all - this just for some additional user maps, accounts et all

I use postfix, and it uses pam for authentication.
same goes for dovecot - databases are only/foremost needed for virtual hosting.
Back to top
View user's profile Send private message
Biru
n00b
n00b


Joined: 29 Aug 2010
Posts: 20

PostPosted: Thu Sep 02, 2010 10:46 am    Post subject: Reply with quote

So do I simply emerge postfix and dovecot, then edit the necessary files in /etc?
Back to top
View user's profile Send private message
Biru
n00b
n00b


Joined: 29 Aug 2010
Posts: 20

PostPosted: Thu Sep 02, 2010 11:30 am    Post subject: Reply with quote

Having issues with my config file in postfix...

I'm at the mynetworks section, concerning who postfix will trust. The problem is, I want to be able to access my mail server and send email from it wherever I am in the world. I could be accessing the mail server from a random wifi hotspot in an airport in South America, or on a friend's home ADSL connection in Germany... I want it to be able to trust based on password authentication, not on IP ranges. Is this possible?
Back to top
View user's profile Send private message
Biru
n00b
n00b


Joined: 29 Aug 2010
Posts: 20

PostPosted: Thu Sep 02, 2010 11:32 am    Post subject: Reply with quote

To make matters worse... I'm hosting on a dynamic IP, tied to a no-ip hostname which updates at boot. The mail server therefore is internet accessible on an address taking the form

myusername.servehttp.com
Back to top
View user's profile Send private message
Veldrin
Veteran
Veteran


Joined: 27 Jul 2004
Posts: 1945
Location: Zurich, Switzerland

PostPosted: Thu Sep 02, 2010 12:43 pm    Post subject: Reply with quote

mynetworks is used to define network where from you can send emails without authentication.

with authentication you can send from any source.
Back to top
View user's profile Send private message
Biru
n00b
n00b


Joined: 29 Aug 2010
Posts: 20

PostPosted: Thu Sep 02, 2010 1:08 pm    Post subject: Reply with quote

Cheers, that does make sense.
Back to top
View user's profile Send private message
Biru
n00b
n00b


Joined: 29 Aug 2010
Posts: 20

PostPosted: Thu Sep 02, 2010 3:26 pm    Post subject: I give up Reply with quote

I'm just getting nowhere here. I'm willing to paypal someone some money to login and set up postfix etc to create a functioning mailserver for my box. Bonus points if they log the steps as they do it to create a HOWTO for future.
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Thu Sep 02, 2010 6:13 pm    Post subject: Reply with quote

shouldnt be any need for that.

to do esmtp authentication, you need to

-get postfix set up to use SASL auth
-set up your SASL database

I will help more on this in a few, have to go help someone move a fridge. Mainly posting in here so that I see it later when I click "View Your Posts"

If it helps, here is a commented/sanitized revision of my own main.cf - http://pastebin.com/raw.php?i=euB3FvS4


If I can recover data from a dead hard drive, I can put up my old wiki that documents this all in detail =/


At any rate, we can get you a functional Postfix+Dovecot setup, plus SASL auth, with relative ease. Don't abandon hope just yet!
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
jodel
Tux's lil' helper
Tux's lil' helper


Joined: 28 Sep 2004
Posts: 113

PostPosted: Thu Sep 02, 2010 8:09 pm    Post subject: Reply with quote

I just posted this in another thread, but that's how to do it:
http://www.kurzor.org/entry/16/setting-up-a-mailserver-on-gentoo
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Fri Sep 03, 2010 12:06 am    Post subject: Reply with quote

jodel wrote:
I just posted this in another thread, but that's how to do it:
http://www.kurzor.org/entry/16/setting-up-a-mailserver-on-gentoo


slightly different from how I did it, but sensible enough I reckon

At the moment I use something a bit more convoluted (postfix + cyrus-imap via lmtp, custom ebuild to include cyrus autocreate patch), but for a long long while I'd just add local users (e.g. useradd -m -G users -s /sbin/nologin blahuser), and I made it such that Dovecot was domain-agnostic. Email to chris@domain1.tld and chris@domain2.tld would go to the same place - /home/chris/.maildir/


no virtual mapping of any sort,

(I forgot to include my dovecot.conf above, so here goes; too lazy to sanitize at this stage dovecot.conf )


@ Biru

hop on IRC, join #gentoo, and send me a /msg. I'll see if I can talk you through it.

Are you ok with a setup similar to my old one, where local /etc/passwd users are your mail users? I think that's probably the easiest way. Dovecot + Postfix, local users rather than virtual users. Most straightforward setup there is.

(NB: unless you /msg me, or type 'cach0rr0' in chan, i wont get notified.)
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
Biru
n00b
n00b


Joined: 29 Aug 2010
Posts: 20

PostPosted: Fri Sep 03, 2010 12:13 pm    Post subject: Reply with quote

Hi guys and thanks again for your help. Yeah, I'm just looking for a simple setup whereby if you have an actual login on the system, you have an associated email address on the system. For example, I login locally as martyn, so I would like to be able to receive email at martyn@mydomain.no-ip.com. Similarly, I would like it so that as I add users to the system, postfix is able to automatically route incoming mail to their /home/username/maildir or such. I'm going to give jodel's tutorial a go, as it does seem pretty straightforward, and I'll let you know how I get on. I really appreciate how helpful you guys have all been. :)
Back to top
View user's profile Send private message
Biru
n00b
n00b


Joined: 29 Aug 2010
Posts: 20

PostPosted: Fri Sep 03, 2010 1:11 pm    Post subject: Reply with quote

Ok, I was able to follow jodel's tutorial no problem, but still have a few problems... the router I have is the default one sent out by my ISP. It tries to be over friendly when it comes to portforwarding so instead of being able to specify ports manually, it lists games/applications etc... that is to say, if I chose Half Life 2, it would open 27015 or whatever it was that Half Life 2 works off. It has entries for POP3 and SMTP, but nothing for IMAP. So my next question is... how do I do this with POP3 and SMTP enabled as opposed to IMAP, and my second question is just one of syntax.

In /etc/postfix/main.cf (assuming my server is on the net at mydomain.servehttp.com)

I have used the following settings:

myhostname = mydomain.servehttp.com
myorigin = servehttp.com

Am I right in doing this? How does hosting a no-ip domain affect postfix and its config?

Thanks again guys...
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Fri Sep 03, 2010 10:04 pm    Post subject: Reply with quote

so to have it go to /home/<username>/.maildir/ have a look at the home_mailbox setting in my main.cf posted above. That's all you need to get the mail there.

To pick up the mail, dovecot.conf is what needs to be changed. You could take mine verbatim, and change the protocols line as seen below:

Code:

protocols = pop3


Not ideal, because it allows passwords to be sent cleartext, but if your router doesn't let you do real port forwarding, not sure of a way around it.
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Fri Sep 03, 2010 10:07 pm    Post subject: Reply with quote

Biru wrote:

In /etc/postfix/main.cf (assuming my server is on the net at mydomain.servehttp.com)

I have used the following settings:

myhostname = mydomain.servehttp.com
myorigin = servehttp.com

Am I right in doing this? How does hosting a no-ip domain affect postfix and its config?

Thanks again guys...


You would probably need to do

Code:

myhostname = mydomain.servehttp.com
myorigin = $myhostname


for the simple fact that 'servehttp.com' is not controlled by you.

(I'm assuming you can/have already, taken care of the requisite DNS changes needed to get mail routed to your host - it's pain with this that led me to say screw it, bought a real domain from no-ip, still use their dynamic DNS client to keep it updated)
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
Biru
n00b
n00b


Joined: 29 Aug 2010
Posts: 20

PostPosted: Mon Sep 06, 2010 5:07 pm    Post subject: Reply with quote

So I've now followed the tutorial to the letter, added support for POP3, but I think there's something not right still. Connections time out when I enable SSL and are refused when I disable SSL. :cry:
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Mon Sep 06, 2010 7:50 pm    Post subject: Reply with quote

pop3s is going to be on a different port (as is imaps - 995 or 993, i cant remember which of those ports is IMAP, and which is POP3), so port forwarding would still be a no-go

doing SMTP auth over TLS can take place on 25 without issue.

When you're testing the connection, are you doing so from the local machine? Does netstat show dovecot listening?
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum