HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Ubuntu 9.10) (http://www.howtoforge.com/forums/showthread.php?t=42033)

flying_horse 20th December 2009 18:12

Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Ubuntu 9.10)
 
Hi there,

i'm still trying to get the system to work, but it still failed.

If i sent an email from e.g. root to sales:

mailx sales

i get this inside the logs: status=bounced (unknown user: "sales")

MAIL.LOG
--------
Dec 20 17:42:07 horse amavis[1054]: (01054-03) Passed CLEAN, <root@smtp.horse.dyndns.org> -> <sales@smtp.horse.dyndns.org>, Message-ID: <20091220164205.6281E25496@smtp.horse.dyndns.org >, mail_id: dLpP7Cllx1MA, Hits: 1.545, size: 336, queued_as: 0432C24F5E, 1611 ms
Dec 20 17:42:07 horse postfix/smtp[2067]: 6281E25496: to=<sales@smtp.horse.dyndns.org>, relay=127.0.0.1[127.0.0.1]:10024, delay=1.8, delays=0.11/0.01/0.01/1.6, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=01054-03, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 0432C24F5E)
Dec 20 17:42:07 horse postfix/qmgr[1682]: 6281E25496: removed
Dec 20 17:42:07 horse postfix/local[2071]: 0432C24F5E: to=<sales@smtp.horse.dyndns.org>, relay=local, delay=0.11, delays=0.04/0.03/0/0.04, dsn=5.1.1, status=bounced (unknown user: "sales")

telnet smtp.horse.dyndns.org 25
Works fine.

If i sent an mail to a local user:

mailx flying

all mails for the local user went into /var/spool/mail/

Do i need to configure something for them in mysql ?
What do i need to do if i add new users in mysql mail user table ?
Do i need to change the aliases file ?

Thanks for your help
Flying Horse

falko 21st December 2009 13:38

You must use the full email address, not just the left part of the address:
mailx sales@example.com

flying_horse 22nd December 2009 12:11

Thanks falko for your post,but i still got the same error.

I redid the whole procedure and reinstalled everything and it looks ok right now.

But i still have some question about the local users and the users inside MYSQL.

1.) Do i need to create for each local user an entry inside MYSQL so that they receive mails as well ?

2.) would it be possible to get the BIND9 configuration for your TUTORIAL, because i guess that the mail.example.com will be defined in BIND, so an example config would be nice.Is it maybe required to configure BIND for mail for this scenario ?

3.) How can i add an other domain, like i've got

a) domain1.dyndns.org
b) domain2.dyndns.org

I've added these two domains into

mydestination = domain2.dyndns.org, localhost.domain2.dyndns.org, SERVERNAME.domain1.dyndns.org, localhost.domain1.dyndns.org, localhost, localhost.localdomain'

and into domains tbl. The users tbl contain

a) sales@domain1.dyndns.org
b) sales@domain2.dyndns.org

The transport table is empty,but i get the following error if i sent an email to sales@domain2.dyndns.org:

a) warning: do not list domain domain1.dyndns.org in BOTH mydestination and virtual_mailbox_domains
b) status=bounced (unknown user: "sales")

If i sent an email to sales@domain1.dyndns.org it is successful.

If i add into transport tbl --> domain: domain2.dyndns.org transport: smtp:SERVERNAME.domain1.dyndns.org i get this error:

a) status=bounced (mail for SERVERNAME.domain1.dyndns.org loops back to myself)

Thanks a lot for all answers, btw i do not use QUOTA and not ISPconfig.

I wish everyone some nice christmas days and good start into 2010

Flying Horse ;)

falko 23rd December 2009 12:56

Quote:

Originally Posted by flying_horse (Post 214241)
1.) Do i need to create for each local user an entry inside MYSQL so that they receive mails as well ?

No, don't add local users and their domains to the MySQL database. The database must contain only virtual users and only the domains that the virtual users use. The domains that are used by local users must be in mydestination, not in the database.

Quote:

Originally Posted by flying_horse (Post 214241)
2.) would it be possible to get the BIND9 configuration for your TUTORIAL, because i guess that the mail.example.com will be defined in BIND, so an example config would be nice.Is it maybe required to configure BIND for mail for this scenario ?

You must configure the DNS records on the authoritative DNS servers for your domain (most likely they are run by your domain registrar). You can find them out by running
Code:

dig ns yourdomain.com
Quote:

Originally Posted by flying_horse (Post 214241)
3.) How can i add an other domain, like i've got

a) domain1.dyndns.org
b) domain2.dyndns.org

I've added these two domains into

mydestination = domain2.dyndns.org, localhost.domain2.dyndns.org, SERVERNAME.domain1.dyndns.org, localhost.domain1.dyndns.org, localhost, localhost.localdomain'

and into domains tbl. The users tbl contain

a) sales@domain1.dyndns.org
b) sales@domain2.dyndns.org

If you use domain1.dyndns.org and domain2.dyndns.org for virtual users, then you must remove them from mydestination. They must be in the database.

flying_horse 23rd December 2009 16:11

Thanks for your answers.

There is still one problem left, if i want to access the mail via SQUIRRELMAIL. I'm only able to get into SM for the virtual users.

Any idea ?

Thanks

flying_horse 24th December 2009 18:09

Found the solution:

Need to change in /etc/courier/authdaemonrc the following line:
Code:

...
authmodulelist="authpam authmysql"
...

You need to add into vi /etc/postfix/main.cf
Code:

...
home_mailbox = Maildir/
...

Thread can be closed :D


All times are GMT +2. The time now is 18:28.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.