Postfix/sendmail hell.

15 posts / 0 new
Last post
#1 Wed, 10/05/2011 - 09:38
ppumkin

Postfix/sendmail hell.

I have everything setup properly using Operating system Ubuntu Linux 11.04 Webmin version 1.560 Virtualmin version 3.88.gpl GPL

Originally i think it installed postfix when i used the virtualmin install script- i think i removed that using purge and installed sendmail(i thought it would be better) and added all my virtual servers. I have to have auth turned off so that my virtual server emails will get an email and when I send using the webmin webmail its reply path is @vps.myisp.com instead of @.com

Using sendmail i tried to enable smtp auth but it always says username not recognised and could not authenticate.

So i removed sendmail and isnatlled using webmin module installer, recheck config on virtualmin and did all the stuff. I removed and re added a temp domain- it populates the postfix tables - but it does not receive any incoming mails and i cannot send using outlook via mail.@.com or even vps or IP

It responds- but eiter says relay not allowed, or user not allowed.

Dovecot works on pop3/imap/popssl/imapssl no problems.

This sendmail stuff is driving me mad- and its all because i removed it by mistake--

Is there a way to fix all this by installing something? I have been reading many articles and usually land up on the old virtualmin articles.. but the problems dont relate to my situation in any way.

I also installed openrelay virtualmin module and - great i could start sending emails within webmin mail with the proper return path and envolope! but no incoming mails were getting routed and smpt from my external outlook failed to connect..

Wed, 10/05/2011 - 09:45
andreychek

Howdy,

Well, I'll start off by offering that Virtualmin doesn't really support Ubuntu 11.04... only the LTS releases, the most recent of which is 10.04. You can see a list of supported distros here:

http://www.virtualmin.com/compare.html

If you aren't using that, chances are that things won't be installed and configured correctly when using the install.sh, which would mean you'd have to do a lot of manual configuration.

If possible, I'd highly recommend starting fresh with Ubuntu 10.04, and using the install.sh script to get things up and running. Doing the above should be pretty straight forward, and should save you a lot of hassle down the road :-)

That said, if you really want to stick with what you have now, you could paste in the output of "postconf -n", it's possible seeing that would help us determine what's going on.

-Eric

Wed, 10/05/2011 - 10:09
ppumkin

alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases append_dot_mydomain = no biff = no config_directory = /etc/postfix inet_interfaces = all mailbox_command = procmail -a "$EXTENSION" mailbox_size_limit = 0 mydestination = vps20197.xlshosting.net, localhost.xlshosting.net, , localhost myhostname = vps20197.xlshosting.net mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 myorigin = /etc/mailname readme_directory = no recipient_delimiter = + smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination permi t_sasl_authenticated smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes virtual_alias_maps = hash:/etc/postfix/virtual

I dont really want to redo it... again.. because that would be the third flippin time :( and jsut for mial it seems so close- but so far.

Wed, 10/05/2011 - 10:25
andreychek

Okay, we can certainly try to point you in the right direction with this... just remember that you're quite likely to run into issues on a non-supported distro. And not just now, but down the road as well :-)

Looking at your output above, it does look like you're running into one of the non-supported issues... email delivery is set to use procmail, rather than procmail-wrapper.

Is there a procmail-wrapper package installed on your system? You can determine that by running this command:

dpkg -l procmail-wrapper

If not, you'll have to grab the source code for that and compile it. There's instructions for doing that in the "procmail-wrapper" section of the manual installation guide:

http://www.virtualmin.com/documentation/installation/manual

Be sure to follow all the instructions in that section, including the changes to the "mailbox_command" in the Postfix main.cf file.

-Eric

Wed, 10/05/2011 - 11:05
ppumkin

Wow - OK I did that and now when i send from gmail to user@mydomain.com - it can read it in the usermin webmail OK

I removed the temp domain- removed all the settings etc. Added it. OK

Using usermin -> readmail -> compose - I can send it as anybody@mydaomin.com and it gets to gmail perfectly! amazing!

But i still cannot send email form my outlook client via smtp outlook says - none of the authentication methods supported by this client are supported by your server. (config - outgoing use autehntication same as incomming - outoing 25 - encryption AUTO)

imap connects OK - but does not download mail? its in the inbox on usermin unread.

Wed, 10/05/2011 - 11:10
ppumkin

OK

using POP3 i can download emails from the inbox.. why does not IMAP work any more? :(

When i set up SMTP without auth i can only send to myself in . sending to another network says relay access denied (fine- prevents open realying) but ticking use authentication give me the other no supported auth..etc

Wed, 10/05/2011 - 11:17 (Reply to #6)
ppumkin

5 18:04:06 vps20197 dovecot: IMAP(kula): fchown(/home/kula/mail/.imap/INBOX/dovecot.index.cache.lock, -1, 8(mail)) failed: Operation not permitted (egid=1046(kula.me.uk), group based on /var/mail/kula)

not sure what is happneing with that - mail.err

mail log Oct 5 18:08:17 vps20197 postfix/smtpd[2588]: lost connection after EHLO from host81-138-15-171.in-addr.btopenworld.com[81.138.15.171]

Oct 5 18:08:17 vps20197 postfix/smtpd[2588]: disconnect from host81-138-15-171.in-addr.btopenworld.com[81.138.15.171]

Oct 5 18:11:22 vps20197 postfix/anvil[2481]: statistics: max connection rate 3/60s for (smtp:81.138.15.171) at Oct 5 18:06:26

Oct 5 18:11:22 vps20197 postfix/anvil[2481]: statistics: max connection count 1 for (smtp:81.138.15.171) at Oct 5 18:01:22

Oct 5 18:11:22 vps20197 postfix/anvil[2481]: statistics: max cache size 2 at Oct 5 18:02:00

Oct 5 18:12:10 vps20197 dovecot: pop3-login: Login: user=, method=PLAIN, rip=81.138.15.171, lip=141.138.197.101

Oct 5 18:12:10 vps20197 dovecot: POP3(kula): Disconnected: Logged out top=0/0, retr=0/0, del=0/3, size=3048

Wed, 10/05/2011 - 11:32 (Reply to #7)
ppumkin

I just restarted dovecot - it must have still remembered the old domain stuff..? even after i resterted the server. any way IMAP and POP3 both read emails OK

I still cannot send via SMTP from a client outside using auth. Any idea?

And now i am stuck in almost the same situation as send mail? I am missing some sort of authentication link somewhere.. i just can see it- i am reading all the manuals and it means little to me. i dont want to go changing config files and then mess everything up and not know how to get back.

Wed, 10/05/2011 - 11:33
andreychek

IMAP(kula): fchown(/home/kula/mail/.imap/INBOX/dovecot.index.cache.lock, -1, 8(mail)) failed: Operation not permitted (egid=1046(kula.me.uk), group based on /var/mail/kula)

What you're seeing there suggests that some mail settings may still be incorrect (some more incompatibility issues). It shouldn't be attempting to use /home/kula/mail/ or /var/mail/kula. However, if you're able to receive email okay, I suppose we can just let that as is :-)

I still cannot send via SMTP from a client outside using auth. Any idea?

Mmm, it looks like you're seeing another incompatibility issue, as authentication should work by default :-)

A few things --

  1. First, make sure saslauthd is running

  2. If it is, try setting Outlook to use port 587 and SSL/TLS when sending email. Once you do that, does that work?

  3. If not, post your /etc/postfix/master.cf file -- you may need to make some tweaks in that to that.

Wed, 10/05/2011 - 15:18
ppumkin

Owll right!! I used this guide

http://www.howtoforge.com/perfect-server-ubuntu-natty-narwhal-ubuntu-11....

to configure the missing saslauthd and now i can send emails using STARTTLS

How can i buy you beer man?!

I must have NOT used the script installer- thats why i was missing so many things.. I cant remember now because i reconfigured it so many times.

One last question- what is the best way to add all the users from all the already configured virtual servers into postfix? Do i just need to add these addresses in to the virtual server mappings.

Thanks

Wed, 10/05/2011 - 15:25
ppumkin

Owll right!! I used this guide

http://www.howtoforge.com/perfect-server-ubuntu-natty-narwhal-ubuntu-11....

to configure the missing saslauthd and now i can send emails using STARTTLS

How can i buy you beer man?!

I must have NOT used the script installer- thats why i was missing so many things.. I cant remember now because i reconfigured it so many times.

One last question- what is the best way to add all the users from all the already configured virtual servers into postfix? Do i just need to add these addresses in to the virtual server mappings.

Thanks

Wed, 10/05/2011 - 19:16
andreychek

Howdy,

You might benefit from browsing through the manual installation guide (the one that had the procmail-wrapper program), just to make sure things are setup/installed correctly:

http://www.virtualmin.com/documentation/installation/manual

Now, as for adding users into Postfix -- were those users that were added while you were using Sendmail?

Normally, Virtualmin would automatically add those to the /etc/postfix/virtual file for you. But, if you don't have entries for some email addresses in there, you may need to manually add those, and then run "postmap /etc/postfix/virtual" when that's done.

-Eric

Thu, 10/06/2011 - 08:34
ppumkin

Yes - I added the users while sendmail was installed.

In postfix I only have and entry for my temp "kula" account that i Deleted .. then recreated. And it put entries in automatically to postfix for email aliases. None of the other virtual servers i have can access email- and there are no mapping for them.

How do i manually add these to postfix? ( You know- in a batch method.. there will be over 100 emails I need to readd)

Thu, 10/06/2011 - 09:45
andreychek

Yeah, the issue in changing mail servers in mid-stream is that all the email configuration will be stuck in the old mail server.

We do recommend using Postfix, which I believe is what you have there now.

Although you have a lot of addresses, do all those belong to just a few domains? One thing you could try is disabling the Mail for Domain feature in Edit Virtual Server -> Enabled Features, and then re-enable it. I think that'll add those in there for you at that point.

-Eric

Thu, 10/06/2011 - 10:46
ppumkin

When i try to disable the mail not it says

"Failed to modify server : Missing or invalid mail username prefix"

Thats most likely because it does not exist in the postfix location.. which should actually mean that the tick box should be unticked.. (i know this is caused by me changing from send mail to postfix) but even after it says that the mailbox does not exist- the mail function is still ticked- but it just said it is not enabled or missing..

In my eyes that is a little bug too. It would have saved me some time now because i could just click enable and it would re populate postfix mappings.

I will just add the emails per complaint basis from the users.

Thanks for your help!!!!!!!! :)

Topic locked