You are not logged in.

#1 2009-07-22 20:22:16

madeye
Member
From: Denmark
Registered: 2006-07-19
Posts: 331
Website

[SOLVED] Mail server to fetch mail from various accounts

For some time now I've played with the idea to download all my email to my own server and access it through imap and webmail there.
I have found this great article on setting up a complete mail server, but am unsure if it is overkill for what I want.

What I want to do with the mail server is to download mail from my pop3 accounts and store it on my server in different folders for the same user (sub folders in the same mailbox).
I want to access it using imap and webmail.
I want to send email with different from addresses (corresponding to my pop3 addresses) through this mail server.
This mail server will send the outgoing mail to my ISPs mail server for further delivery. ( it should of course be saved in the users sent folder too)


When following the guide,the first thing that I stumbled over was that a hostname and domain is set in the postfix configuration. I have no domain name to use for the local server and as I am not going to receive mail directly (port 25) do I need to set it?


The article/guide I am trying to follow is located at: http://www.hypexr.org/linux_mail_server.php

I have never setup a mail server before, but hope that I can learn as I go along. I don't mind trying different approaches if that is what it takes. And if I need to start from scratch a couple of times, then that's OK too.

EDIT: Marked as SOLVED. I am now able to fetch my mail and access it through imap and webmail. I am using dovecot and fdm as suggested in this thread. For webmail I am using roundcube, as I found it to be better than squirrelmail.

Last edited by madeye (2009-08-02 09:45:42)


MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage

Offline

#2 2009-07-22 21:57:46

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: [SOLVED] Mail server to fetch mail from various accounts

I would just use fdm and dovecot for the 'get mail from various accounts (fdm) and make it avail over pop and imap (dovecot)'.
I would just send the mail directly using the various accounts' smtp servers with my client via msmtp and a good conf file or something.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2009-07-22 22:34:33

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,355

Re: [SOLVED] Mail server to fetch mail from various accounts

I know you mentioned pop3, but I use IMAP using offlineimap. For pop3 I guess just retrieving with getmail to a Maildir store and serving with dovecot's IMAP would be sufficient?


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#4 2009-07-22 23:14:28

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,223
Website

Re: [SOLVED] Mail server to fetch mail from various accounts

madeye wrote:

When following the guide,the first thing that I stumbled over was that a hostname and domain is set in the postfix configuration. I have no domain name to use for the local server and as I am not going to receive mail directly (port 25) do I need to set it?

Every computer *needs* a hostname, and preferably a domain name IMHO. If you don't have a registered domain name, it's perfectly OK to use something like .local so the FQDN of your server could be:
server.madeye.local

I've got a similar setup to what you're doing - I use the .fukawi2.local domain internally (even though I do have several domains), and one of my servers downloads all my POP mail to the local machine (using fetchmail) then serves it out to me via IMAP and Webmail (using Dovecot and Squirrelmail)

Offline

#5 2009-07-23 07:47:11

madeye
Member
From: Denmark
Registered: 2006-07-19
Posts: 331
Website

Re: [SOLVED] Mail server to fetch mail from various accounts

@cactus
I will look at dovecot and fdm. I don't want to make my setup more complicated than necessary, and from the description on the website, dovecot sounds to be fairly easy to tackle. I will give a status later smile
If I send the outgoing mail directly through my ISPs smtp server, will I still have a copy in my send folder?

@ngoonee
I've never heard of IMAP offlinemaps. I will check it out.

@fukawi2
OK. I will set it to my internal hostname then. I always use ld as the root domain on my LocalDomain machines.


Thanks to everyone.


MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage

Offline

#6 2009-07-23 09:24:38

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,223
Website

Re: [SOLVED] Mail server to fetch mail from various accounts

madeye wrote:

If I send the outgoing mail directly through my ISPs smtp server, will I still have a copy in my send folder?

As long as your client is setup to save the message to your Sent folder, then it doesn't matter what SMTP server you use - your ISP, your own or Microsoft's!

Offline

#7 2009-07-24 09:18:29

madeye
Member
From: Denmark
Registered: 2006-07-19
Posts: 331
Website

Re: [SOLVED] Mail server to fetch mail from various accounts

OK. It looks like my IMAP server is running, but I can not access it. The fault I get in Claws is

[11:04:19] IMAP4< * OK Dovecot ready. 
* IMAP connection is un-authenticated
[11:04:19] IMAP4> 1 CAPABILITY 
[11:04:19] IMAP4< * CAPABILITY IMAP4rev1 SASL-IR SORT THREAD=REFERENCES MULTIAPPEND UNSELECT LITERAL+ IDLE CHILDREN NAMESPACE LOGIN-REFERRALS UIDPLUS LIST-EXTENDED I18NLEVEL=1 AUTH=PLAIN 
[11:04:19] IMAP4< 1 OK Capability completed. 
[11:04:19] IMAP4> Logging rene to 127.0.0.1 using LOGIN
** IMAP error on 127.0.0.1: parse error (very probably non-RFC compliance from the server)
** IMAP4 connection broken
[11:04:19] IMAP4< Error logging in to 127.0.0.1

The output of dovecot -n is

# 1.1.17: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.30-ARCH x86_64
ssl_disable: yes
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable: /usr/lib/dovecot/imap-login
mail_location: maildir:~/Maildir
mail_debug: yes
auth default:
  passdb:
    driver: passwd-file
    args: /etc/passwd.dovecot

I have probably missed something in the configuration somewhere. Does anyone have a working configuration for what I try to do? Could I please have a look at that and compare it to my own.


MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage

Offline

#8 2009-07-24 09:41:54

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,355

Re: [SOLVED] Mail server to fetch mail from various accounts

Here's my dovecot -n, which is working, based on offlineimap as I said before. I use plaintext authentication.

# 1.1.17: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.30-ARCH x86_64  ext3
protocols: imap
listen: localhost
ssl_disable: yes
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable: /usr/lib/dovecot/imap-login
mail_location: maildir:/home/data/Profiles/OfflineIMAP/root:LAYOUT=fs:INBOX=/home/data/Profiles/OfflineIMAP/root
auth default:
  passdb:
    driver: pam
  userdb:
    driver: passwd

Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#9 2009-07-24 10:16:45

madeye
Member
From: Denmark
Registered: 2006-07-19
Posts: 331
Website

Re: [SOLVED] Mail server to fetch mail from various accounts

Thanks ngoonee,

That did the trick. I should try not to be too clever, then my setup would have worked from the beginning! smile

The problem was with the authentication. I was trying to use a simple passwd file, and that didn't work. Now I just use the user credentiels from the standard linux login. Much easier that way too.
I will only be using one user anyway. And that user has a login account on the server.

So now I just need to figure out how to use fdm to retrieve my mail from the various pop3 servers.

UPDATE:
This is starting to annoy me just a little bit. I can fetch mail from my two pop3 test accounts(test1 and test2), but I can't seem to find the correct way to store mail from test2 in a subfolder in the inbox.
I can store it physically in a sub folder beneath my maildir folder, but it does not show up in my client.
The fdm config file contains

action "inbox" maildir "/var/mail/%u/Maildir"
action "test2folder" maildir "/var/mail/%u/Maildir/test2"

account "test1" pop3 server "server.domain" user "test1" pass "pass1"
account "test2" pop3 server "server.domain" user "test2" pass "pass2"

match account "test1" action "inbox"
match account "test2" action "test2folder"

This gets mail from test1 to the inbox, but mail from test2 is lost (stored in physical subfolder).

I guess the "test2folder" action needs to be changed. Anyone have a good idea what it should be?

EDIT: Nevermind! I figured it out. All it took was that I needed to hold my head under cold water for 10 minutes. Then I remembered dot files are hidden. A simple ls -a showed me the light!
The rule should just be

action "test2folder" maildir "var/mail/%u/Maildir/.INBOX.test2folder

Thanks for being my therapist for this session roll

Last edited by madeye (2009-07-24 13:47:50)


MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage

Offline

#10 2009-07-24 16:12:22

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,355

Re: [SOLVED] Mail server to fetch mail from various accounts

Note, if you do not want to use .folders and .folder.subfolder, use the :LAYOUT=fs:INBOX=/home/data/Profiles/OfflineIMAP/root line I have in my dovecot.conf. It basically means that all subfolders as you see them in your mail client are actual subfolders in the hard disk. Much easier for me to read, and that's the way evo likes its maildirs as well (which is where I got it from in the first place).


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#11 2009-07-24 20:26:55

parintachin
Member
Registered: 2009-05-25
Posts: 72

Re: [SOLVED] Mail server to fetch mail from various accounts

just as a sidenote don't take .local ! .local is registered for mdns (avahi ,zeroconf and the like ) so you could get some problems with resolving names and some other stress.
you can set every domainname you like hostname.domainname .
don't forget that you need a way to resolve the adress either with dns or /etc/hosts

Last edited by parintachin (2009-07-24 20:27:20)

Offline

Board footer

Powered by FluxBB