Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Email System For The Home Network - Version 2.1
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, ... 25, 26, 27  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
beowulf
Apprentice
Apprentice


Joined: 07 Apr 2003
Posts: 225

PostPosted: Sun Jun 01, 2003 10:59 pm    Post subject: Reply with quote

jordant wrote:
beowulf:

Thanks for the excellent tutorial. I just setup a second server on my home network for this exact purpose. After following through the tutorial, most of the stuff worked great (SMTP server doesn't appear to be running at all though?). IMAP is working awesome.

Right now I've set fetchmail up to grab from two separate e-mail accounts. Do you know if I can setup (either client side or on the server) to have it reply using that identity depending on what account I'm using? Or do I have to setup two separate users on the box and have two IMAP connections with diff logins in my e-mail client?

Once again, thanks for the great tutorial.

--jordant

Thanks for giving it a shot! What do you mean by the SMTP server isn't running... does "/etc/init.d/postfix status" reveal anything? If not, try restarting the server and checking in your process list "ps aux | grep postfix"

Regarding the fetchmail situation. If i understand you correctly, you use 2 different email accounts. You want to be able to reply to any email received through an email with the appropriate email... FOr instance, mail enters to "jordant@isp.com" so you wish to reply using the "jordant@isp.com" identity. Likewise if another email came in for "jordant@ispisp.com" you would reply with that email.

There's a number of ways to do this.... off the top of my head, and the way i would do this.... I would use Procmail to sort the email into two seperate maildirs. Such as this recipe line:
Code:

:0
* ^To:.jordant@isp\.com
.isp1/

:0
* ^To:.jordant@ispisp\.com
.ispisp/


Then in Kmail check your email, and once the new directories appear in Kmail, right click on it and select "Properties". Under the "Identity: Sender pulldown menu, choose the identity to match the directory. So for mail folder ".ispisp" you would choose your "ISP ISP" identity.

In Sylpheed-Claws, it can be done the same way, right clicking on the .maildir and then choosing properties. Later selecting the default identity to go with that folder.

If this isn't what you meant, let me know and i'll try to help you further.

Hope this helps, and thanks again for giving it a try :)
_________________
I have nothing witty to say here... ever :-(
Back to top
View user's profile Send private message
jordant
n00b
n00b


Joined: 31 May 2003
Posts: 68
Location: Vancouver, BC

PostPosted: Sun Jun 01, 2003 11:28 pm    Post subject: Reply with quote

beowulf wrote:

Thanks for giving it a shot! What do you mean by the SMTP server isn't running... does "/etc/init.d/postfix status" reveal anything? If not, try restarting the server and checking in your process list "ps aux | grep postfix"


Postfix is running. In evolution, when I try to send mail or do anything on that server it can't connect. I've checked and port 25 isn't even open. It's not a big deal since I could still send e-mail through my ISP's mail server.

beowulf wrote:

Regarding the fetchmail situation. If i understand you correctly, you use 2 different email accounts. You want to be able to reply to any email received through an email with the appropriate email... FOr instance, mail enters to "jordant@isp.com" so you wish to reply using the "jordant@isp.com" identity. Likewise if another email came in for "jordant@ispisp.com" you would reply with that email.

Yep, exactly. I use one for personal, and one for work. I don't want to reply to work e-mail with my personal e-mail address.

beowulf wrote:

There's a number of ways to do this.... off the top of my head, and the way i would do this.... I would use Procmail to sort the email into two seperate maildirs. Such as this recipe line:
Code:

:0
* ^To:.jordant@isp\.com
.isp1/

:0
* ^To:.jordant@ispisp\.com
.ispisp/


Then in Kmail check your email, and once the new directories appear in Kmail, right click on it and select "Properties". Under the "Identity: Sender pulldown menu, choose the identity to match the directory. So for mail folder ".ispisp" you would choose your "ISP ISP" identity.

In Sylpheed-Claws, it can be done the same way, right clicking on the .maildir and then choosing properties. Later selecting the default identity to go with that folder.


Okay, I could have them sorted that way. Any idea how to do it in Ximian Evolution? I don't use Kmail... I think I said before, I could have two separate IMAP accounts but that's a little bit of a pain.

Thanks for the help.

--jordant
Back to top
View user's profile Send private message
beowulf
Apprentice
Apprentice


Joined: 07 Apr 2003
Posts: 225

PostPosted: Mon Jun 02, 2003 12:07 am    Post subject: Reply with quote

Having never used evolution.... i couldn't tell you. Try to search for a way to set properties on a subfolder of INBOX. Or, perhaps ask in the Desktop forums how you can accomplish this given that you want to associate one email address with one IMAP folder.

Have you told Evolution to connect to your SMTP server using TLS or SSL? Is there a firewall preventing you from accessing port 25? Have you run nmap on your server? Did you set the use flag "ssl" when emerging evolution?

here's a few links i found while searching on google:
Link 1
Link 2
Link 3
Link 4

Hope this helps
_________________
I have nothing witty to say here... ever :-(


Last edited by beowulf on Tue Jun 03, 2003 5:40 am; edited 1 time in total
Back to top
View user's profile Send private message
puddpunk
l33t
l33t


Joined: 20 Jul 2002
Posts: 681
Location: New Zealand

PostPosted: Tue Jun 03, 2003 4:30 am    Post subject: Reply with quote

Hey there beowulf. Thats a great guide, put a lot of questions that I had out.

Just one thing, I pull mail from a mailbox on my ISP (I'll have some examples later), the mailbox has 4 alias's pointing to it, so I want to split what i download from that mailbox into 4 different accounts (all have accounts on the linux server).

i.e. I have 4 linux users (with home dirs etc...) chris, russell, sue and steve. I have a main account, e.g. mainmail@isp.com. But my ISP has set it up so chris.rs@isp.com, russell.rs@isp.com, sue.rs@isp.com, steve.rs@isp.com gets dumped into mainmail@isp.com which I can download over POP3.

How can I configure procmail to split those 4 email addresses into 4 different mailboxes on the linux server?

Any help appreciated,
Cheers,
Chris.
Back to top
View user's profile Send private message
beowulf
Apprentice
Apprentice


Joined: 07 Apr 2003
Posts: 225

PostPosted: Tue Jun 03, 2003 5:32 am    Post subject: Reply with quote

Hey puddpunk, thanks for trying it out.

To answer your question, the most immediate thought that comes to my mind is by running fetchmail and procmail in daemon mode under root privaleges. Here's one untested example that may work, may not, but should give you an idea of how i'd start:
Code:

root@server # vi /etc/fetchmailrc

set postmaster "[chris i guess...]
set bouncemail
set properties ""
#Poll the server
poll pop.mail.isp.com with proto POP3
    auth password user "sue.rs" there with password "pass_isp" is sue here with options
        warnings 3600 mda "/usr/bin/procmail -d %s"
    auth password user "chris.rs" there with password "pass123_isp" is chris here with options
        warnings 3600 mda "/usr/bin/procmail -d %s"
    auth password user "russell.rs" there with password "pass_isp" is russell here with options
        warnings 3600 mda "/usr/bin/procmail -d %s"
    auth password user "steve.rs" there with password "pass_isp2rf" is steve here with options
        warnings 3600 mda "/usr/bin/procmail -d %s"

Assuming you don't use SSL to connect, if you do, remove the phrase "auth password" from the file completely. Don't forget to protect the file...
Code:
 root@server # chmod 710 /etc/fetchmailrc

And then a procmailrc file that would need to be in the user's home directory (make sure you make the directory ".maildir/":
Code:

root@server # vi /home/sue/.procmailrc

MAILDIR=$HOME/.maildir/
DEFAULT=$MAILDIR

:0
* ^Subject:.Cron*
.cron-jobs/

You might also want to copy it to /etc/skel so that if you do add another user, the file is there automagically. You could also make the maildir directory there too...

Next, before you start the daemon, set the amount in seconds that you want fetchmail to run... Right now it's at 60, but I believe that's too much... perhaps 3600 or 7200..
Code:
 vi /etc/conf.d/fetchmail

Finally, start it up and add it to the default runtime
Code:

root@server # /etc/init.d/fetchmail start
root@server # rc-update add fetchmail default

Theoretically this should work... no guarantees... but it's a place to start. I've never needed to do this though, but from what i've learned about fetchmail/procmail this should work.

Hope this helps

[edit: fixed up the code tags... can't figure out why it spans so wide... /]
[edit2: trying to fix the width of this post /]
_________________
I have nothing witty to say here... ever :-(
Back to top
View user's profile Send private message
puddpunk
l33t
l33t


Joined: 20 Jul 2002
Posts: 681
Location: New Zealand

PostPosted: Tue Jun 03, 2003 7:13 am    Post subject: Reply with quote

Hey beowulf, thanks for the swift reply :)

Just looking at that config file, I don't see exactly how that applies to my situation. There is only one POP3 box that I need to poll xtr<something>@isp.com, but in that mailbox are emails that have "chris.rs@isp.com", "sue.rs@isp.com" etc... in the TO: field. I want it to pull all that email down, then sort that into each users (chris, sue, steve etc...) home directory.

Thanks for all your help beowulf!
Back to top
View user's profile Send private message
Proteus
Guru
Guru


Joined: 14 Jul 2002
Posts: 346
Location: Hamburg, Germany

PostPosted: Tue Jun 03, 2003 12:47 pm    Post subject: Reply with quote

Thank you very much for this tutorial. I got it working now but still have one more question:

Quote:
2 messages for username at pop3.isp.de (2979 octets).
reading message username@pop3.isp.de:1 of 2 (1493 octets) .procmail: Incomplete recipe flushed
reading message username@pop3.isp.de:2 of 2 (1486 octets) .procmail: Incomplete recipe flushed


What does "Incomplete recipe flushed" mean? The mails do seem to be received allright....

Also, it seems that the smtp server is usable only when not using SSL. Shouldn't that be the other way around?
_________________
Greetings,
Proteus
Back to top
View user's profile Send private message
beowulf
Apprentice
Apprentice


Joined: 07 Apr 2003
Posts: 225

PostPosted: Tue Jun 03, 2003 9:18 pm    Post subject: Reply with quote

puddpunk:

Geeze, that's what i get for answering posts half asleep. hehe I completely misread your post. To answer your question "properly" now...

There are a few ways to do this, one is by setting up a file in /etc/
Code:
 root@server # vi /etc/procmailrc

:0
* ^To:.chris\.rs*
/home/chris/.maildir/

:0
* ^To:.sue\.rs*
/home/sue/.maildir/

# ...the same for the other two accounts

Then, in /etc/fetchmailrc use this:
Code:

poll pop.mail.isp.com with proto POP3
    auth password user "xtr_asdf" there with password "pass_isp"  with options
        warnings 3600 mda "/usr/bin/procmail /etc/procmailrc"

This will be run as root though... There is another way around running it as root, One user will need write permission in all their home directories... and then in your $HOME/.procmailrc file, you could use the above example... I have never tested this... but i believe it should work.

Another idea that came to mind... Running fetchmail/procmail as your user, you could forward the email. here's an example recipe line and hopefully you can take it from there:
Code:

:0
* ^To:.sue\.rs*
!sue@localhost

# Default action leave it to yourself, and let all mail that doesnt match
# be delivered to your maildir... Remember the procmailrc is procedural

If all else fails, there's always the "network and security" forums, or the man pages. My method may not be the best...

Proteus, thanks for going at the guide. Do you think you could post your procmailrc file? You can also check that each "recipe" contains 3 lines. A ":0", a regex line as well as an action line. Could be a typo? Not sure, but procmail is choking on one of the recipes...

[Edit:
Also, could you post your /etc/postfix/main.cf file too?
Code:
grep -v "^#" /etc/postfix/main.cf | sed '/./,/^$/!d'

/]

Hope this helps both of you guys :)
_________________
I have nothing witty to say here... ever :-(
Back to top
View user's profile Send private message
ghetto
Guru
Guru


Joined: 10 Jul 2002
Posts: 369
Location: BC, Canada

PostPosted: Wed Jun 04, 2003 12:07 am    Post subject: Reply with quote

wow this looks like a great guide, ive been fooling around with the virtmailhost guide for like a week now and I cant seem to get the entire thing to work.

What I really want to know is how hard would it be to throw a squirrelmail example into the guide? pleeeeaaaasssse?

I only have one domain, and I got that by using a dyndns redirect pointed at my box. All I want is to be able to recieve mail directly to this box from the internet by using local usernames followed by the dyndns redirect name( so local user 'alex' would recieve mail sent to alex@dyndns_redirect_name.com ).

I also want local users to have the choice of accessing their email locally or through squirlmail.

The first part is fine, I have that working already from the virtmailhost guide, but I cant seem to get the squirlmail part to work. I can login using the aliases that I have setup through phpmyadmin just like it says to do in the virtmailhost guide, but I after they login then all they can do is view mail, squirrelmail refuses to send any email.

So what I think I'll do is just completely trash my setup, and start all over using your guide. Then I'll try squirrelmail if everything else seems to working alright. Hopefully by then you might have come up with a squirrelmail example for me. :D

Thanks tones for the guide.
_________________
Blizzard you suck.
Back to top
View user's profile Send private message
puddpunk
l33t
l33t


Joined: 20 Jul 2002
Posts: 681
Location: New Zealand

PostPosted: Wed Jun 04, 2003 1:41 am    Post subject: Reply with quote

Cheers beowulf! What a sport!

I don't really mind running fetch/procmail as root. They are quite mature peices of software, and my box is reasonably secure.

Thanks again beowulf,
Chris.
Back to top
View user's profile Send private message
puddpunk
l33t
l33t


Joined: 20 Jul 2002
Posts: 681
Location: New Zealand

PostPosted: Wed Jun 04, 2003 2:04 am    Post subject: Reply with quote

Lol! Back again beowulf!

Is there a way to get the procmail that runs off the /etc file, to deliver to another procmail that reads each users ~/.procmail file? So that you have the main sorting procmail that splits all the users up, then a "personal" procmail to filter mail per-user based on each individual users ~/.procmail file?

If thats not possible, what about sieve? How easy is that to impliment? Does it work with MS Outlook 2000?

Thanks Beowulf,
Chris.
Back to top
View user's profile Send private message
beowulf
Apprentice
Apprentice


Joined: 07 Apr 2003
Posts: 225

PostPosted: Wed Jun 04, 2003 3:08 am    Post subject: Reply with quote

ghetto:

I have never used Squirrel Mail as i have never liked checking my email using a browser... Never liked webmail. That said, I believe running this setup should allow a rather easy insertion of squirrel mail. I *believe* one could simply "emerge squirrel-mail" (check the package name though) and then configure it. Since Squirrel mail is simply a front end to your IMAP server, the integration shouldn't be hard at all. I would start with the desktop guide and see what they do. http://www.gentoo.org/doc/en/desktop.xml#doc_chap8

I see no reason why this wouldn't work... since the backend stuff is transparent to Squirrel Mail. Courier-IMAP has already been set up in accordance to the desktop guide, and i cannot forsee any problems. However, it wouldn't be the first time i've been wrong...

Local access can be provided using an Email client, or even the web mail interface, so that shouldn't pose a problem.

I will attempt to insert Squirrel Mail into my setup though... As I believe it would make a nice addition to the guide. If you'll give me a day or two to work it out... I should be able to add the new section. It's kind of late right now, and i have prior arrangements for the better part of tomorrow...

puddpunk:

I'm venturing into the unknown with this guess... but from what i know about procmail, you could theoretically pipe the result into itself? Maybe, not quite sure....

How about this recipe line:
Code:

root@server # vi /etc/procmailrc

:0
* ^To:.chris\.rs*
| /usr/bin/procmail -d chris

Theoretically, that tells it to pipe the email to itself and deliver to "user" chris, who would then run their own $HOME/.procmailrc file... I have never tested this, don't know if it will work, or any side-effects that could arise... but theoretically it could work...
_________________
I have nothing witty to say here... ever :-(
Back to top
View user's profile Send private message
Proteus
Guru
Guru


Joined: 14 Jul 2002
Posts: 346
Location: Hamburg, Germany

PostPosted: Wed Jun 04, 2003 3:58 am    Post subject: Reply with quote

Here is my main.cf:

Code:
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
mail_owner = postfix
inet_interfaces = 192.168.0.10, localhost
mydestination = cruncher.local.net, localhost.local.net
alias_maps = hash:/etc/mail/aliases
alias_database = hash:/etc/mail/aliases
home_mailbox = .maildir/
relay_domains = $mydestination
mynetworks = 192.168.0.0/24,127.0.0.0/8
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, check_relay_domains                                                               
smtp_sasl_password_maps = hash:/etc/postfix/saslpass
smtpd_use_tls=yes
smtpd_tls_auth_only = yes
smtpd_tls_key_file = /etc/postfix/newreq.pem
smtpd_tls_cert_file = /etc/postfix/newcert.pem
smtpd_tls_CAfile = /etc/postfix/cacert.pem
smtpd_tls_loglevel = 3
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom


This is .procmailrc:
Code:
MAILDIR=$HOME/.maildir/
DEFAULT=$MAILDIR

:0
* ^Subject:.Cron*
.cron-jobs/

:0
* ^List-Id:.*gentoo-dev\.gentoo\.org
.gentoo-user/

:0
* ^List-Id:.*gentoo-announce\.gentoo\.org
.gentoo-announce/

:0
* ^List-Id:.*gentoo-gwn\.gentoo\.org
.gentoo-gwn/

:0
* ^From:.*gentoo\.org


Since I don't really know what those recipes are or where to find them I cannot check them...
_________________
Greetings,
Proteus
Back to top
View user's profile Send private message
beowulf
Apprentice
Apprentice


Joined: 07 Apr 2003
Posts: 225

PostPosted: Wed Jun 04, 2003 4:18 am    Post subject: Reply with quote

Okay, for the postfix file. You're missing a few lines... I would recommend adding this:
Code:

root@server # vi /etc/postfix/main.cf

smtp_sasl_auth_enable = yes
smtp_sasl_security_options =

Aside from that, it should work... What kind of errors are you getting when trying to login using TLS?

RE: Procmail recipe problem.

A procmail recipe is usually 3 lines inside of a .procmailrc file. For example:
Code:

:0
* ^From:.*gentoo\.org
.gentoo/

As you can see there are 3 lines to a procmail "recipe". I appologize for the error in the guide regarding the missing line. I have since edited the guide to include the missed line.

Therefore, your whole .procmailrc file should look like this:
Code:
MAILDIR=$HOME/.maildir/
DEFAULT=$MAILDIR

:0
* ^Subject:.Cron*
.cron-jobs/

:0
* ^List-Id:.*gentoo-dev\.gentoo\.org
.gentoo-user/

:0
* ^List-Id:.*gentoo-announce\.gentoo\.org
.gentoo-announce/

:0
* ^List-Id:.*gentoo-gwn\.gentoo\.org
.gentoo-gwn/

:0
* ^From:.*gentoo\.org
.gentoo/

You should notice a ".gentoo/" line at the very end. This is the line that i missed and was the cause of the error. Sorry again,

Hope this helps.
_________________
I have nothing witty to say here... ever :-(
Back to top
View user's profile Send private message
Proteus
Guru
Guru


Joined: 14 Jul 2002
Posts: 346
Location: Hamburg, Germany

PostPosted: Wed Jun 04, 2003 6:14 pm    Post subject: Reply with quote

Thanks alot, now everything seems to work just perfectly ;-)



My main.cf already included
Code:
smtp_sasl_auth_enable = yes

but it read
Code:
smtp_sasl_security_options = noanonymous

instead of
Code:
smtp_sasl_security_options =
.



Your support here is just incredible. I think a lot of people owe you something, including me.
_________________
Greetings,
Proteus
Back to top
View user's profile Send private message
ghetto
Guru
Guru


Joined: 10 Jul 2002
Posts: 369
Location: BC, Canada

PostPosted: Wed Jun 04, 2003 7:03 pm    Post subject: Reply with quote

Proteus wrote:
Thanks alot, now everything seems to work just perfectly ;-)



My main.cf already included
Code:
smtp_sasl_auth_enable = yes

but it read
Code:
smtp_sasl_security_options = noanonymous

instead of
Code:
smtp_sasl_security_options =
.



Your support here is just incredible. I think a lot of people owe you something, including me.


Yes I noticed that In the virtmail host guide it says "noanonymouse" but with that setting I checked my logs and it showed a "fatal" message attached to "noanonymouse" and after I deleted it I was able to telnet into 143 on localhost and got the proper reply's from the server.

However I went back to following the virtmail host guide from the begining, gonna give it one more shot, but I just cant get the darn thing to authenticate when I try to run fetchmail to retrieve mail from the courier-imap.
This is the message fetchmail gives me:
Code:
fetchmail: 6.2.2 querying division22.merseine.nu (protocol IMAP) at Wed, 04 Jun 2003 12:52:55 -0700 (PDT): poll started
fetchmail: IMAP< * OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE] Courier-IMAP ready. Copyright 1998-2003 Double Precision, Inc.  See COPYING for distribution information.
fetchmail: IMAP> A0001 CAPABILITY
fetchmail: IMAP< * CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE
fetchmail: IMAP< A0001 OK CAPABILITY completed
fetchmail: IMAP> A0002 LOGIN "root" ""
fetchmail: IMAP< A0002 NO Login failed.
fetchmail: IMAP> A0003 *
fetchmail: Authorization failure on root@division22.merseine.nu
fetchmail: IMAP> A0004 LOGOUT
fetchmail: IMAP< A0003 NO Error in IMAP command received by server.
fetchmail: IMAP< * BYE Courier-IMAP server shutting down
fetchmail: IMAP< A0004 OK LOGOUT completed
fetchmail: 6.2.2 querying division22.merseine.nu (protocol IMAP) at Wed, 04 Jun 2003 12:53:00 -0700 (PDT): poll completed
fetchmail: Query status=3 (AUTHFAIL)
fetchmail: normal termination, status 3
Done.


This is what my .fetchmailrc looks like
Code:

# cat .fetchmailrc
# Configuration created Wed Jun  4 12:45:38 2003 by fetchmailconf
set postmaster "postmaster"
set bouncemail
set no spambounce
set properties ""
poll division22.merseine.nu with proto IMAP
       user 'root' there with password '8l&)++wssZ..' is 'root' here


I dont know what you guys think but it looks like this should work, so my problem must be with either postfix or courier-imap.. or maybe cyrus-sasl, or perhaps mysql, heh.. the virt-mailhost doc sure is ambitious isnt it?

Deffinitly no shortage of things that can go wrong.

Any help is deffinitly appreciated. Until I get this to work there is no point trying to use squirrelmail.
_________________
Blizzard you suck.
Back to top
View user's profile Send private message
Proteus
Guru
Guru


Joined: 14 Jul 2002
Posts: 346
Location: Hamburg, Germany

PostPosted: Wed Jun 04, 2003 7:31 pm    Post subject: Reply with quote

I have never used the "virtual mailhost how-to", I read through it but found that it was far too complex for what I wanted. For example I don't need to use mysql, I don't have that much users, it's just me.

Therefor I unfortunately cannot help you with any problems regarding the how-to.

I merely waited for someone to post a tutorial for what I needed.
Well, beowulf did. But I think that he knows a lot about this stuff so maybe he can help you...

(Are you sure you need the "virtual mailhost how-to"? Maybe what beowulf described fits your needs as well? It just seems to work better and without too much hicups.)
_________________
Greetings,
Proteus
Back to top
View user's profile Send private message
ghetto
Guru
Guru


Joined: 10 Jul 2002
Posts: 369
Location: BC, Canada

PostPosted: Wed Jun 04, 2003 8:31 pm    Post subject: Reply with quote

I basically just need webemail for virtual users, but I dont need virtual domains, one domain is enough for all my users.

..and I also need email for me, Im the only local user on this box.

The problem is that I want the web email to be very secure, I will have up to maybe 20-50 people using it when its setup and I would hate for anything bad to happen to them if they put important data into there emails. Thats why Im trying to get the virtmail host document to work, because it seems more focused on virtual users, like webemail.

Https, imaps, and authmysqld using squirrelmail for virtual users seems like exactly what I need. But maybe you're right.

But Im begining to think this might be the better guide simply because it works, the virtmailhost guide seems kind of broken. But in a way thats why I want to use it so that I can iron out the bugs and submit an update to gentoo-doc with all the little quirks worked out.

Here is a link to my postfix [url=24.77.80.239/main.cf]main.cf[/url] I have put restricted access on my url ..but thats only to keep out the search engine spiders, the username is 'alex' and the password is 'password'

im open to sudgestions still
_________________
Blizzard you suck.
Back to top
View user's profile Send private message
beowulf
Apprentice
Apprentice


Joined: 07 Apr 2003
Posts: 225

PostPosted: Wed Jun 04, 2003 8:42 pm    Post subject: Reply with quote

Proteus:
I'm happy to hear the guide was helpful for you and it works!

ghetto:

An exit code of "3" means authentication failed when polling as i'm sure you know. This narrows the places where the problem could lie. Since you're following the virtual mailhost guide, you are using MySQL. Is there a mail user in the MySQL db for root?

What does this output:
Code:
cat /usr/lib/sasl2/smtpd.conf


What does this output:
Code:
grep -v "^#" /etc/courier-imap/authdaemonrc | grep authmodulelist=


What does this output:
Code:
grep -v "^#" /etc/courier-imap/authdaemond.conf


And finally, how about this file:
Code:
grep -v "^#" /etc/pam.d/imap


Those are the places I would check first. From what i can see, the fetchmailrc file is fine, i don't think it's a postfix issue since you're trying to receive email (or fetch in this case). My money is on Courier-Imap and MySQL being the reason you can't authenticate.

hope this helps
_________________
I have nothing witty to say here... ever :-(
Back to top
View user's profile Send private message
ghetto
Guru
Guru


Joined: 10 Jul 2002
Posts: 369
Location: BC, Canada

PostPosted: Wed Jun 04, 2003 9:17 pm    Post subject: Reply with quote

beowulf
An exit code of "3" means authentication failed when polling

I cant even begin to say how glad I am to get some help with this
Thanks tones beowulf.:D

beowulf
Is there a mail user in the MySQL db for root?

yes, here is a snip from the database:
> select * from alias;
| id | alias | destination
| 1 | root | root@division22.mersine.nu


What does this output:
Code:
cat /usr/lib/sasl2/smtpd.conf

pwcheck_method:saslauthd
mech_list: LOGIN PLAIN

What does this output:
Code:
grep -v "^#" /etc/courier-imap/authdaemonrc | grep authmodulelist=

authmodulelist="authmysql authpam"

What does this output:
Code:
grep -v "^#" /etc/courier-imap/authdaemond.conf

AUTHDAEMOND="authdaemond.mysql"

And finally, how about this file:
Code:
grep -v "^#" /etc/pam.d/imap

auth optional pam_mysql.so server=localhost db=mailsql user=mailsql \
passwd=Fh33dl2vbn^ table=users usercolumn=email passwdcolumn=clear crypt=0
account required pam_mysql.so server=localhost db=mailsql user=mailsql \
passwd=Fh33dl2vbn^ table=users usercolumn=email passwdcolumn=clear crypt=0

so I guess the question is where in courier-imap and mysql is the error

However.. one more thing, Im not sure if this makes a hugh difference or not but you'll notice in my fetchmailrc that I had it written that the user who was logging in is named 'root' but that is incorrect, the acutal user who should have been logging in according to mysql is 'root@division22.merseine.nu'

However you will notice in my fetchmail output that it says that user 'root@division22.merseine.nu' failed to Authenticate.
So what I think is happening is that my postfix is appending my hostname onto the end of my user name when they try to log in.

I think I can prove this because when i setup fetchmail to use the proper username, which in this case is 'root@divisioin22.mersine.nu' then the output from fetchmail is that user 'root@division22.merseine.nu@division22.merseine.nu' failed to Authenticate.

What do you make of that?

:D
_________________
Blizzard you suck.
Back to top
View user's profile Send private message
beowulf
Apprentice
Apprentice


Joined: 07 Apr 2003
Posts: 225

PostPosted: Wed Jun 04, 2003 10:43 pm    Post subject: Reply with quote

hehe... hmmm... well all the outputs look right... And assuming you've created the hundred /etc/postfix/mysql*.cnf files that are needed correctly... only a few more ideas have come to my mind...

Have you tried authenticating with a regular email client? Maybe fetchmail is having problems... hehe grasping at straws kind of...

Also, though not mentioned in the guide, I noticed that it uses the saslauthd service. Now in /etc/conf.d/ there is a conf file for said service. Could this be where the problem lies?
Code:

root@server # saslauthd -v
saslauthd 2.1.10
authentication mechanisms: ???????????????
root@server # cat /etc/conf.d/saslauthd | grep SASL_AUTHMECH=
SASL_AUTHMECH=?????

Perhaps, and i know the probability is low... perhaps this is where the problem lies? I *believe* it should say "pam" in there but i could be wrong...

Aside from that, I really don't know what is going wrong...

I would try with another email client so as to determine whether fetchmail is the culprit... Other than that, I really don't know what's going on...

Hope this helps....
_________________
I have nothing witty to say here... ever :-(
Back to top
View user's profile Send private message
ghetto
Guru
Guru


Joined: 10 Jul 2002
Posts: 369
Location: BC, Canada

PostPosted: Thu Jun 05, 2003 5:18 pm    Post subject: Reply with quote

No regular clients dont work anybetter than fetchmail it seems, and that file you pointed me at for saslauthd does infact say 'pam' so that ok and if i go like this:
`saslauthd -v`
saslauthd 2.1.12
authentication mechanisms: getpwent pam rimap shadow

So pam "should" be working.

I dont know what else to do.
However this morning I woke up and started all the server and now Im getting Query status=2 error. So I guess I'll look that up and see what broken now.

Can I ask where you found the info on what query status errors numbers mean?
_________________
Blizzard you suck.
Back to top
View user's profile Send private message
beowulf
Apprentice
Apprentice


Joined: 07 Apr 2003
Posts: 225

PostPosted: Thu Jun 05, 2003 7:07 pm    Post subject: Reply with quote

Exit status of 2 means this:

2 An error was encountered when attempting to open a socket to
retrieve mail. If you don't know what a socket is, don't worry
about it -- just treat this as an 'unrecoverable error'. This
error can also be because a protocol fetchmail wants to use is
not listed in /etc/services.

I find this information in "man fetchmail"... Have you edited your /etc/services to say remove IMAP over SSL etc...?

sorry man, i don't understand why it isn't working... it's far beyond my limited knowledge... :-|
_________________
I have nothing witty to say here... ever :-(
Back to top
View user's profile Send private message
ghetto
Guru
Guru


Joined: 10 Jul 2002
Posts: 369
Location: BC, Canada

PostPosted: Fri Jun 06, 2003 12:20 am    Post subject: Reply with quote

hmm.. that was dumb, i forgot to take down my firewall before using fetchmail, I take it down completely when Im working on this imap server problem but I forgot to take it down so fetchmail couldnt access the port. Thats why I got exit status 2.

Once I get everything working I'll adapt my tables to reflect my computers new purpose however until then I like to keep rather paranoid iptable rules.

oh and thanks about the `man fetchmail` I had already read it, or so I thought, but I guess I didnt finish reading all the way down to the bottom because I didnt see the EXIT CODES section at all.

oh yeah, and about /etc/services thats not it either.
grep imap /etc/services
imap2 143/tcp # Interim Mail Access Proto v2
imap2 143/udp
imap3 220/tcp # Interactive Mail Access
imap3 220/udp # Protocol v3
imaps 993/tcp # IMAP over SSL
imaps 993/udp # IMAP over SSL
_________________
Blizzard you suck.
Back to top
View user's profile Send private message
ghetto
Guru
Guru


Joined: 10 Jul 2002
Posts: 369
Location: BC, Canada

PostPosted: Fri Jun 06, 2003 4:47 am    Post subject: Reply with quote

Ok, Ive given up _completely_ on the virtmailhost guide.

Ive swtiched to this guide, and it certainly is simpler. Unfortunately it didnt quite work, but maybe somehow it can be fixed.. here is what I have so far.

Postfix seems to be working because I can send/recieve email to/from local users, and I can recieve email from remote users. ie Hotmail. But I cant seem to send any email except locally.

Im still getting an auth failure with my imap server. The imap server seems to be working because I can actually log into it using a "local" users name and password.

However when I try to use any of the users that I have listed in the sasldb it gives me an auth failure.

So just to make it clear, if i do this:
mutt -f imaps://localhost

Then it asks me for the password for user_name@localhost and after I give it the password I am loged in.

However if i do this:
mutt -f imaps://division22.merseine.nu
Then it asks me for the password for user_name@division22.merseine.nu and no matter what password I give it ALWAYS fails to auth.

The imap server also works if I try to telnet to it like so
# telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE] Courier-IMAP ready. Copyright 1998-2003 Double Precision, Inc. See COPYING for distribution information.
1 LOGIN alex xxxxxxxxx (<- actual local Linux user's name and passwd)
1 OK LOGIN Ok.

However it doesnt work at all if i try to telnet to it using the dyndns host name like this:
telnet division22.merseine.nu 143
Trying 24.77.80.239...
Connected to division22.merseine.nu.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE] Courier-IMAP ready. Copyright 1998-2003 Double Precision, Inc. See COPYING for distribution information.
1 LOGIN alex xxxxxx (<-name and passwd from the sasldb)
1 NO Login failed.



So it seems that sasldb is some how wrong doesnt it?
However this is how i set it up, tell me if you think ive missed anything.

Code:

 # rm /etc/sasl2/sasldb
 # saslpasswd2 -c -u division22.merseine.nu -a smtpauth alex
Password: xxxxxxx
Again (for verification): xxxxxxx
# /etc/init.d/authdaemond restart
 * Stopping courier-imapd...         
[ ok ] * Stopping courier-imapd over SSL...   
[ ok ] * Stopping authdaemond.plain...
[ ok ] * Starting authdaemond.plain...     
[ ok ] * Starting courier-imapd...                                               
[ ok ] * Starting courier-imapd over SSL...
# mutt -f imaps://division22.merseine.nu
-- Mutt: SSL Certificate check
(r)eject, accept (o)nce
-- Mutt: SSL Certificate check
Username at division22.merseine.nu: alex
Password for alex@division22.merseine.nu: xxxxxx
Logging in...
Login failed.



Could this have anything to do with postfix since I am unable to send email to anywhere outside of my system?
Here is my postfix [url=division22.merseine.nu/main.cf]main.cf[/url]
auth is still user:alex
passwd: password

Im going to keep trying, this is just soo weird that i simply refuse to give up. Any help is greatly appreciated.

[EDIT]
Ok I can send email to remote servers like hotmail now, stupid me, I forgot a step.. i had changed the saslpass file but forgot to do `postmap hash:/etc/postfix/saslpass` which is why I couldnt send emails except locally..

I still cant get the imaps server to auth unfortunately.
_________________
Blizzard you suck.


Last edited by ghetto on Fri Jun 06, 2003 5:18 am; edited 2 times in total
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3, ... 25, 26, 27  Next
Page 2 of 27

 
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