LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-25-2010, 07:03 AM   #1
edderkop
LQ Newbie
 
Registered: Aug 2007
Location: Stuttgart, Germany
Distribution: Debian, Ubuntu, Darwin, FreeBSD
Posts: 18

Rep: Reputation: 0
Need help setting up sendmail with virtual accounts


Hi all

I am in the unfortunate position to migrate existing mail accounts from a qmail server to sendmail - yes, I know that's crazy but it seems that we absolutely need to deploy sendmail, as it is required by our newsletter program.

To begin with, I don't have the slightest idea how to set up sendmail to deliver incoming mails to virtual accounts. To make this a bit clearer, here's our current directory structure, used by qmail in conjunction with vpopmail:

Code:
/
 |__ home/
    |__ vpopmail/
       |__ domains/
          |__ firstdomain.com/
             |__ john.doe/
                |__ Maildir
                   |__ cur
                   |__ new
                   |__ tmp
             |__ joe.bloggs/
                |__ Maildir
                   |__ cur
                   |__ new
                   |__ tmp
             |__ wilmaflintstone/
                |__ Maildir
                   |__ cur
                   |__ new
                   |__ tmp
             |__ barny.rubble/
                |__ Maildir
                   |__ cur
                   |__ new
                   |__ tmp
          |__ seconddomain.com/
             |__ fredflintstone
                |__ Maildir
                   |__ cur
                   |__ new
                   |__ tmp
             |__ bamm-bamm.rubble/
                |__ Maildir
                   |__ cur
                   |__ new
                   |__ tmp
          |__ seconddomain.org/
             |__ ...
          |__ seconddomain.net/
             |__ ...
          |__ thirddomain.org/
             |__ ...
          |__ ...
That's what I need to set up with sendmail (the exact directory structure isn't important). As for now, incoming mails get moved to a user directory under /home, e.g. /home/johndoe/Maildir.

Can anyone so much as point me in the right direction? What do I need to employ? Can something like that be achieved with procmail? I've googled extensively but I either used the wrong keywords or sendmail is used so rarely nowadays that there really isn't much information available anymore.

Thanks in advance!

edderkop
 
Old 01-26-2010, 01:13 AM   #2
amonamarth
Member
 
Registered: Dec 2009
Location: Los Angeles
Distribution: Fedora ,CentOS, RHEL
Posts: 59

Rep: Reputation: 17
Here is some help

EdderKop:

Please take this reply as just a direction to look into.

I trust you know the proper way to setup the sendmail configuration file(/etc/mail/sendmail.cf) is to use a macro file first, normally sendmail.mc, and "compile" it(probably not the right terminology) with the "m4" utility.

Well ...
Include this line into your macro file(your ".mc" file): FEATURE(`virtusertable')dnl
This will configure sendmail to look into the virtual users database file, normally found at /etc/mail/virtusertable.db. In this directory there is a similar file named virtusertable, which can be edited. I think you would include virtual users here, once done just run: "makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable" which will append your new entries into the database file.

Check this link: http://www.sendmail.org/tips/virtualHosting
 
1 members found this post helpful.
Old 01-26-2010, 02:16 AM   #3
darvil
LQ Newbie
 
Registered: Jan 2010
Distribution: centOS
Posts: 19

Rep: Reputation: 1
Hi EdderKop

I'm going to assume you already have the emails created.

What I will suggest for migration is to use imapsync (http://freshmeat.net/projects/imapsync/). Email migration used to be a real PITA for me until I discovered this tool. I have used it to migrate from postfix to qmail, from postfix to zimbra and qmail to zimbra. Best way to do is to install it on another linux server and run some simple commands and everything will get moved. I'm not sure about sendmail (although I think its close to postfix), but postfix had emails all stored in a single file while qmail has it all seperated. Of course none of this is a concern imapsync.

Its the best way I've found. There probably is a better way but I don't know of any so far.
 
Old 01-26-2010, 03:21 AM   #4
edderkop
LQ Newbie
 
Registered: Aug 2007
Location: Stuttgart, Germany
Distribution: Debian, Ubuntu, Darwin, FreeBSD
Posts: 18

Original Poster
Rep: Reputation: 0
Hi darvil
Quote:
Originally Posted by darvil View Post
Hi EdderKop

I'm going to assume you already have the emails created.

What I will suggest for migration is to use imapsync
Thanks. I've in fact already worked with imapsync, for a previous migration where we already had to move a small part of our existing email accounts to Zimbra. It really is a very handy tool and once I've set up a working environment with sendmail, I'll certainly use it again to migrate our accounts.

Thanks for your suggestion! :-)
 
Old 01-26-2010, 03:24 AM   #5
edderkop
LQ Newbie
 
Registered: Aug 2007
Location: Stuttgart, Germany
Distribution: Debian, Ubuntu, Darwin, FreeBSD
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by amonamarth View Post
EdderKop:

Please take this reply as just a direction to look into.

...
Thanks, that's a good starting point. I hope that I'll get this sorted out in the next few days.
 
Old 01-26-2010, 08:03 AM   #6
edderkop
LQ Newbie
 
Registered: Aug 2007
Location: Stuttgart, Germany
Distribution: Debian, Ubuntu, Darwin, FreeBSD
Posts: 18

Original Poster
Rep: Reputation: 0
I've been playing around with the virtusertable and the possibilities it provides to map several user names or domains to one account are nice and will certainly come in handy but it's unfortunately still not what I'm looking for (or I am missing something). Is there a possibility to use not actual system accounts to have mail delivered to but subdirectories, as lined out in the directory tree above? So, a mail that is addressed to johndoe@example.com would with my present configuration go to the Maildir in the home directory /home/johndoe (i.e. /home/johndoe/Maildir). With the virtusertable I can configure sendmail in such a way, that mail for, say, johnny.doe@example.com is delivered to johndoe, too. I want, however, to gather all the mailings under one single account called, say, mail. The directory structure I envisage should look something like the following:

Code:
/home/mail/
           |__ example.com
              |__ johndoe
                 |__ cur
                 |__ new
                 |__ tmp
              |__ janedoe
                 |__ cur
                 |__ new
                 |__ tmp
              |__ ...
           |__ foo.net
              |__ ...
           |__ ...
I.e. I don't want to have a user account on the mail server's system for every single mail account, but rather the mail accounts represented as subdirectories under /home/mail/domainname/accountname.

Any ideas?
 
Old 01-26-2010, 12:36 PM   #7
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,056

Rep: Reputation: 78
If this is proving difficult, perhaps you should consider altering your newsletter program? If it's written in PHP, I might be able to help you figure that out.
 
Old 01-27-2010, 03:53 AM   #8
edderkop
LQ Newbie
 
Registered: Aug 2007
Location: Stuttgart, Germany
Distribution: Debian, Ubuntu, Darwin, FreeBSD
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sneakyimp View Post
If this is proving difficult, perhaps you should consider altering your newsletter program?
I can't tell you how many times I've been phantasizing about such a thing - a nice, easy to administrate, newsletter program that works well together with postfix or any other modern MTA.

Unfortunately my boss won't have it. I begin to wonder, though, if I should not just tell her to forget the whole thing, that it's just not possible to get that trash to work or worth spending any more time on.

Last edited by edderkop; 01-27-2010 at 03:59 AM. Reason: typo
 
Old 01-27-2010, 12:26 PM   #9
amonamarth
Member
 
Registered: Dec 2009
Location: Los Angeles
Distribution: Fedora ,CentOS, RHEL
Posts: 59

Rep: Reputation: 17
procmail

I wonder if procmail can help you? I know it can be configured to redirect messages to other folders, users, even pipe them through programs. Perhaps a good mix of sendmail virtualuser table and procmail recipes?
 
1 members found this post helpful.
Old 01-27-2010, 12:29 PM   #10
amonamarth
Member
 
Registered: Dec 2009
Location: Los Angeles
Distribution: Fedora ,CentOS, RHEL
Posts: 59

Rep: Reputation: 17
Make sure you check procmail's site here: http://www.procmail.org/. The mailing-lists are phenomenal, I use them every so often.
 
1 members found this post helpful.
Old 01-28-2010, 02:43 AM   #11
edderkop
LQ Newbie
 
Registered: Aug 2007
Location: Stuttgart, Germany
Distribution: Debian, Ubuntu, Darwin, FreeBSD
Posts: 18

Original Poster
Rep: Reputation: 0
Thanks for your suggestion, amonamarth. The use of procmail sounds reasonable and should in fact be feasible if I can parse out the domain and user parts from the recipient address. Fortunately, I've already set up sendmail to use procmail, so that mail is delivered into Maildirs instead of the default mbox format. So, I'd just need to figure out the correct rulesets. I'll look into this next. Thanks!
 
  


Reply

Tags
account, procmail, sendmail, users, virtual



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
VIrtual accounts nderitualex Linux - Newbie 1 03-21-2005 03:39 AM
Virtual accounts nderitualex Linux - General 1 03-21-2005 03:04 AM
What is virtual accounts nderitualex Linux - Newbie 1 02-21-2005 07:42 AM
Virtual accounts in Postfix technochef Linux - Software 2 10-25-2004 04:12 PM
Virtual mail accounts objorkum Linux - Networking 1 09-18-2004 05:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration