Hi, I am in the process of setting up postfix, dovecot, mysql to the latest versions to be used for mail server.
I need to be able to handle mail for multiple domain names.
I have followed these 2 tutorials:
postfix tutorail Dovecot Tutorial
I have mysql installed and setup properly and it works.
The issue right now is when I first installed postix and dovecot and ran it without mysql. It worked. Meaning I got mail logs going.
I never was able to sent mail out or get mail.
I then followed those tutorials posted above. I set them up exactly what it says but instead of their mail_Dir I used
/mtn/disk1/mail as the mail directory.
I ran then ran the software and postfix and dovecot both run without any majors issues. The issue here is that there's no mail logs.
I thought maybe because there's no activity and is the reason why. I tested the system using an outside email writing an email
to one of my accounts in my domain name. I would send it and the email provider that I used proton would send a message the next day that they couldn't deliver it.
I check the mail logs and found nothing no /var/log/maillogs file.
I am really stuck on where to start to figure out what is wrong with the system.
I would assume if there were any fatal errors it would make the maillog file.
So, my guess would have to be the setup with the mysql database and tables.
I know in the tutorial it does 2 lookups one for username and one for password.
I am thinking there might be a conflict with what it's looking up.
for example I have created 2 users both named bob. in the users table it has bob and then password and then email.
email would have the domain associated with it like bob@domain1.com the other is the same but domain2.com
in the tutorial the way it looks up the username I am not sure if this should be bob or bob@domain1.com ?
but it would grab the username based on the domain name. I have a table named domains which are the domain names I wish to handle the mail for. Right now just have domain1.com and domain2..com . these domains are just an example. I am using real .com domain names.
The tutorial shows to make a domain name table in mysql and a user table. I did both.
Then I assume if someone comes in for example bob@domain1.com
I assume this setup first checks the domain domain table and and matches domain1.com to make sure we are handling it's mail.
If it checks out.
It then goes looks up the user in our case bob and it checks for the mailbox info etc. Then delivers the mail to the mailbox directory.
under folder domain1.com/bob/
Now, my issue with this is what happens if there's 2 users with the same username for a different domain.
If I have 2 user accounts with bob but it's with a different name. How would postfix and dovecot figure out which is which?
Do you think I would have to modify the sql query?
What I am saying is that there's 2 tables one for domain names we handle mail for. It would just list domain1.com, domain2.com, etc.
but if the user has 2 accounts with name bob. that user table doesn't have domain names. Just I have the usernames and a email address filed.
my question is how would dovecot or postfix not cross the 2 fields? I use the same table to login to email. However, if it doesn't have a domain field. It would grab the first username that is named bob and then use that info.
So, if I login as bob@domain2.com wouldn't it check my password based on the first bob in the first record that shows up? which would be for domain .... domani1.com I wouldn't be able to login domain2.com because it would match bob with the first record and always check the passwords with that account.
Right now what commands I can run to check the mail system? do I have to modify the log level for debugging purposes?
right now shows no maillog file.
I did have one before and there were others like maillog.0.bz etc but I ran rm and removed all it.
It was because I wanted to turn the servers off and then back on to see if there's any recent errors.
It never created the maillog so I assume no errors or activity. I have log_leve set to 2 and for tls it's set to 1.
I would appreciate any kind of help. Thank You in advance.
I need to be able to handle mail for multiple domain names.
I have followed these 2 tutorials:
postfix tutorail Dovecot Tutorial
I have mysql installed and setup properly and it works.
The issue right now is when I first installed postix and dovecot and ran it without mysql. It worked. Meaning I got mail logs going.
I never was able to sent mail out or get mail.
I then followed those tutorials posted above. I set them up exactly what it says but instead of their mail_Dir I used
/mtn/disk1/mail as the mail directory.
I ran then ran the software and postfix and dovecot both run without any majors issues. The issue here is that there's no mail logs.
I thought maybe because there's no activity and is the reason why. I tested the system using an outside email writing an email
to one of my accounts in my domain name. I would send it and the email provider that I used proton would send a message the next day that they couldn't deliver it.
I check the mail logs and found nothing no /var/log/maillogs file.
I am really stuck on where to start to figure out what is wrong with the system.
I would assume if there were any fatal errors it would make the maillog file.
So, my guess would have to be the setup with the mysql database and tables.
I know in the tutorial it does 2 lookups one for username and one for password.
I am thinking there might be a conflict with what it's looking up.
for example I have created 2 users both named bob. in the users table it has bob and then password and then email.
email would have the domain associated with it like bob@domain1.com the other is the same but domain2.com
in the tutorial the way it looks up the username I am not sure if this should be bob or bob@domain1.com ?
but it would grab the username based on the domain name. I have a table named domains which are the domain names I wish to handle the mail for. Right now just have domain1.com and domain2..com . these domains are just an example. I am using real .com domain names.
The tutorial shows to make a domain name table in mysql and a user table. I did both.
Then I assume if someone comes in for example bob@domain1.com
I assume this setup first checks the domain domain table and and matches domain1.com to make sure we are handling it's mail.
If it checks out.
It then goes looks up the user in our case bob and it checks for the mailbox info etc. Then delivers the mail to the mailbox directory.
under folder domain1.com/bob/
Now, my issue with this is what happens if there's 2 users with the same username for a different domain.
If I have 2 user accounts with bob but it's with a different name. How would postfix and dovecot figure out which is which?
Do you think I would have to modify the sql query?
What I am saying is that there's 2 tables one for domain names we handle mail for. It would just list domain1.com, domain2.com, etc.
but if the user has 2 accounts with name bob. that user table doesn't have domain names. Just I have the usernames and a email address filed.
my question is how would dovecot or postfix not cross the 2 fields? I use the same table to login to email. However, if it doesn't have a domain field. It would grab the first username that is named bob and then use that info.
So, if I login as bob@domain2.com wouldn't it check my password based on the first bob in the first record that shows up? which would be for domain .... domani1.com I wouldn't be able to login domain2.com because it would match bob with the first record and always check the passwords with that account.
Right now what commands I can run to check the mail system? do I have to modify the log level for debugging purposes?
right now shows no maillog file.
I did have one before and there were others like maillog.0.bz etc but I ran rm and removed all it.
It was because I wanted to turn the servers off and then back on to see if there's any recent errors.
It never created the maillog so I assume no errors or activity. I have log_leve set to 2 and for tls it's set to 1.
I would appreciate any kind of help. Thank You in advance.