Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 20th July 2007, 12:55
bidevi bidevi is offline
Member
 
Join Date: Jun 2007
Posts: 60
Thanks: 3
Thanked 2 Times in 2 Posts
Default The Perfect Setup - Debian Etch: smart_host

On Fedora Core 6 in /etc/mail/sendmail.mc I configured Sendmail's smart_host, so visitors of my site practically use my ISP's smtp server to send me their message filling in a web form. For configuration I used instructions provided by: http://www.go2linux.org/node/35.

Now I have Postfix, because I've set up Debian Etch following the guide lines of The Perfect Setup instructions.

Can anyone tell me how to do a smart-host like configuration now, so my visitors can keep on doing the same thing: send me mail using a web form on my site?
Reply With Quote
Sponsored Links
  #2  
Old 20th July 2007, 21:26
bidevi bidevi is offline
Member
 
Join Date: Jun 2007
Posts: 60
Thanks: 3
Thanked 2 Times in 2 Posts
Default No reax, so question 2: is there a form mail for Postfix?

My ISP is 1&1 in Germany and they have strange habits. For example, I cannot get a PHP mail form script working. This is what 1&1 says about it: The only FormMail script you can use on the 1&1 servers is the NMS FormMail.pl. This can be downloaded from http://nms-cgi.sourceforge.net/scripts.shtml. (See: http://faq.1and1.com/scripting_langu...ned/index.html. As a matter of fact, FormMail.pl works with Sendmail, not Postfix.

Nevertheless, on Fedora Core 6 I did get form mail working with a perl script that addresses Sendmail. The script was written by Kristina Pfaff-Harris and it can be found here: http://tesol.net/scripts/AutoCGIMail/.

For the Perfect Etch Setup on my Debian machine I installed Postfix instead of Sendmail. Kristina does not offer her script for Postfix.

My question: can anyone recommend a good Postfix mail form script?

Last edited by bidevi; 20th July 2007 at 21:37.
Reply With Quote
  #3  
Old 21st July 2007, 18:20
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Quote:
Originally Posted by bidevi
Now I have Postfix, because I've set up Debian Etch following the guide lines of The Perfect Setup instructions.

Can anyone tell me how to do a smart-host like configuration now, so my visitors can keep on doing the same thing: send me mail using a web form on my site?
Take a look at the Smart Host section on http://www.fredshack.com/docs/postfix.html

Quote:
My ISP is 1&1 in Germany and they have strange habits. For example, I cannot get a PHP mail form script working. This is what 1&1 says about it: The only FormMail script you can use on the 1&1 servers is the NMS FormMail.pl. This can be downloaded from http://nms-cgi.sourceforge.net/scripts.shtml. (See: http://faq.1and1.com/scripting_langu...ned/index.html. As a matter of fact, FormMail.pl works with Sendmail, not Postfix.

Nevertheless, on Fedora Core 6 I did get form mail working with a perl script that addresses Sendmail. The script was written by Kristina Pfaff-Harris and it can be found here: http://tesol.net/scripts/AutoCGIMail/.

For the Perfect Etch Setup on my Debian machine I installed Postfix instead of Sendmail. Kristina does not offer her script for Postfix.

My question: can anyone recommend a good Postfix mail form script?
Postfix is compatible to Sendmail, so I don't know why it shouldn't work with Postfix. Postfix even comes with a binary called sendmail to guarantee Sendmail compatibility.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #4  
Old 23rd July 2007, 00:21
bidevi bidevi is offline
Member
 
Join Date: Jun 2007
Posts: 60
Thanks: 3
Thanked 2 Times in 2 Posts
Default So can I use Postfix just like Sendmail?

Thank you, Falko, for your response.

If Postfix works like Sendmail, does that mean that I can change Sendmail to Postfix and everything works fine?

I've tried that before. On my FC6 machine with Sendmail I've got a perl script with content as displayed below. After configuring smarthost in Postfix on my Debian machine I tried this same perl script after changing every instance of Sendmail in the cgi file to Postfix. I didn't really believe it would work, but if experts tell me Postfix behaves like Sendmail, I assume that scripts written for Sendmail work with Postscript. It didn't.

Below is a part of the cgi file where I changed every instance of sendmail to postfix (I didn't change it below and I tried the script also in its original form, but nothing worked):

#!/usr/bin/perl

# This email script generated by AutoCGIMail v1.2
# by Kristina Pfaff-Harris (http://www.tesol.net/scripts/)
#
# If you're having problems getting this to work, try putting
# $debugging = 1; on the next line.

$path_to_sendmail = "/usr/sbin/sendmail";
$email_field = "01Uw_e-mailadres";
$use_autoresponse = "Yes";
$autoresponse_message1 = "Geachte ";
$autoresponse_message2 = ",

(et cetera)

But it's all not that simple. So how do I adapt things in such a way that my perl scripts, working well in Sendmail, keep on working in Postfix?

(Later this week I'll configure the apps again and try instructions at http://www.fredshack.com/docs/postfix.html)

Last edited by bidevi; 23rd July 2007 at 00:29.
Reply With Quote
  #5  
Old 23rd July 2007, 13:37
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Quote:
Originally Posted by bidevi
#!/usr/bin/perl

# This email script generated by AutoCGIMail v1.2
# by Kristina Pfaff-Harris (http://www.tesol.net/scripts/)
#
# If you're having problems getting this to work, try putting
# $debugging = 1; on the next line.

$path_to_sendmail = "/usr/sbin/sendmail";
$email_field = "01Uw_e-mailadres";
$use_autoresponse = "Yes";
$autoresponse_message1 = "Geachte ";
$autoresponse_message2 = ",

(et cetera)

All you have to change is the path to sendmail. You can find out the path by running
Code:
which sendmail
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #6  
Old 23rd July 2007, 14:24
bidevi bidevi is offline
Member
 
Join Date: Jun 2007
Posts: 60
Thanks: 3
Thanked 2 Times in 2 Posts
Default Another try

During my experiments to get to know Debian and ISPConfig I always login as root. If something goes really wrong, I just reinstall the OS.

In Terminal:
# which sendmail
/usr/sbin/sendmail

No luck: that's what is in my cgi script already.

I'll describe the working situation first.

SENDMAIL

Let's assume you own domain happydomain.com. Let's also assume that your ISP's outgoing mail server uses this smtp code: smtp.nicehost.com, and your email address is blah@nicehost.com.
Furthermore
user name: blahusername
password: blahpassword

Say you need an smtp server to send email through mail forms on your web page, hosted on your own server at home. If you want to use your ISP's smtp server you can do this with the help of smarthost.

The following configuration works flawlessly in Fedora Core 6 (FC6) with Sendmail:

In /etc/mail/sendmail.mc add these lines:

dnl MASQUERADE_AS('your.domain')dnl
define(`SMART_HOST',`your.smtp.server')dnl
FEATURE(`masquerade_envelope')dnl
FEATURE(genericstable, `hash -o /etc/mail/genericstable')dnl
GENERICS_DOMAIN_FILE(`/etc/mail/genericsdomain')dnl

These lines have to be modified to look like:

dnl MASQUERADE_AS('happydomain.com')dnl
define(`SMART_HOST',`smtp.nicehost.com')dnl
FEATURE(`masquerade_envelope')dnl
FEATURE(genericstable, `hash -o /etc/mail/genericstable')dnl
GENERICS_DOMAIN_FILE(`/etc/mail/genericsdomain')dnl

In order to authenticate to the email server of your ISP make sure to have the following line in the file /etc/mail/sendmail.mc:

FEATURE(`authinfo', `hash /etc/mail/authinfo')

and create this file:

/etc/mail/authinfo

with this inside:

AuthInfo:your.smtp.server "U:user@your.smtp.server" "I:user" "P: passwd" "M:LOGIN PLAIN"

where you modify this line to look like this:

AuthInfo:smtp.nicehost.com "U:user@smtp.nicehost.com" "I:blahusername" "P:blahpassword" "M:LOGIN PLAIN"

Now generate the sendmail.cf file using this command:
make -C /etc/mail

Create a file named: /etc/mail/genericstable
with this inside it: root user@domain.com
(do not replace user@domain.com with your own data)

Execute this:
makemap hash /etc/mail/genericstable < /etc/mail/genericstable

and run:

makemap hash /etc/mail/authinfo < /etc/mail/authinfo

and make authinfo readable only by root:
chmod 600 /etc/mail/authinfo

This did it for me. I can send emails using my ISP's outgoing mail server with my FC6 server.


POSTFIX

I have not been able, so far, to find instructions on the web how to configure Postfix in the same manner as Sendmail. Alright, I have modified a line in /etc/postfix/main.cf to look like: relayhost = smtp.nicehost.com, but my web form didn't execute anything besides telling me the mail was sent, which wasn't the case.

I'm not amazed that it doesn't work because no authentication method was set up.

Any suggestions how to get it working for Postfix?
Reply With Quote
  #7  
Old 23rd July 2007, 16:05
bidevi bidevi is offline
Member
 
Join Date: Jun 2007
Posts: 60
Thanks: 3
Thanked 2 Times in 2 Posts
Default PHP mail form in Fedora Core 6: yes

Earlier I wrote:

My ISP is 1&1 in Germany and they have strange habits. For example, I cannot get a PHP mail form script working (...)

I have just tried the form on my FC6 server and the PHP mail form worked fine (the mail was sent and received), so what I've stated earlier about 1&1 is wrong.

The mail form did not work on Debian Etch (The Perfect Setup), which is on the same LAN behind the same router. Neither did it work on my Mac OS X (PPC) Apache server.

I wonder why that is. Could it be that PHP on my FC6 machine has different PHP modules installed which are needed for PHP mail forms?

Does anybody have a clue where to look for clues?
Reply With Quote
  #8  
Old 24th July 2007, 14:07
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Quote:
Originally Posted by bidevi
POSTFIX

I have not been able, so far, to find instructions on the web how to configure Postfix in the same manner as Sendmail. Alright, I have modified a line in /etc/postfix/main.cf to look like: relayhost = smtp.nicehost.com, but my web form didn't execute anything besides telling me the mail was sent, which wasn't the case.

I'm not amazed that it doesn't work because no authentication method was set up.

Any suggestions how to get it working for Postfix?
Take a look here: http://www.howtoforge.com/postfix_re...her_mailserver
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Perfect Xen 3.1.0 Setup For Debian Etch (i386) ko0nz HOWTO-Related Questions 8 13th November 2007 20:48
The Perfect Setup - Debian Etch (Debian 4.0) mysql question paul55 HOWTO-Related Questions 9 4th November 2007 11:28
Perfect Setup - Debian Etch m61 HOWTO-Related Questions 2 22nd June 2007 21:46
Do you have The Perfect Setup - Debian Etch ? Dekalb Installation/Configuration 2 2nd June 2007 00:16
Debian perfect setup network problem reddogg Installation/Configuration 2 18th January 2006 22:04


All times are GMT +2. The time now is 08:11.


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