Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 25th February 2007, 15:34
Madlew2007 Madlew2007 is offline
Junior Member
 
Join Date: Feb 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Question Fetchmail->Postfix->Spammassassin->Postfix->Exchange

Being a M$ engineer, I'm new to this game but want to learn.

I have followed the guide entitled Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP-AUTH, Quota, SpamAssassin, ClamAV) and all is good with recieving mail and having it forwarded to my exchange server all nice and spam free.

I have been testing this using a Windows app called POPcon which downloaded POP emails and converts it to SMTP to an exchange server. I use this so I can test Sophos PureMessage anti-spam as it only scans SMTP.

What I would like to do is use FetchMail to do the same. I have my /etc/fetchmailrc file polling like this:

Code:
# Daemon configuration
# These two are set in /etc/default/fetchmail
set daemon        900                # Pool every 5 minutes
set syslog                        # log through syslog facility
set postmaster  root

set no bouncemail                # avoid loss on 4xx errors
                                # on the other hand, 5xx errors get
                                # more dangerous...

##########################################################################
# Hosts to pool
##########################################################################

# Defaults ===============================================================
# Set antispam to -1, since it is far safer to use that together with
# no bouncemail
defaults:
timeout 300
antispam -1
batchlimit 100

poll MY.POP.COM protocol POP3 user "MYUSERNAME" password "MYPASSWORD"
This downloaded the emails great, 400+, but it put them into the local mailbox for fetchmail and didnt use my postfix relaying rules.

Code:
Feb 25 14:16:35 king amavis[26956]: (26956-06) Passed, (?) -> <fetchmail@localhost>, Message-ID: <20070225141623.4A09429C6A1@myserver.mydomain.com>, Hits: 3.011
Feb 25 14:16:35 king postfix/smtp[27270]: 4A09429C6A1: to=<fetchmail@localhost>, relay=127.0.0.1[127.0.0.1], delay=12, status=sent (250 2.6.0 Ok, id=26956-06, from MTA: 250 Ok: queued as 3536929C6D0)
Feb 25 14:16:35 king postfix/qmgr[16564]: 4A09429C6A1: removed
Feb 25 14:16:35 king postfix/local[27285]: 3536929C6D0: to=<fetchmail@localhost>, relay=local, delay=0, status=sent (delivered to maildir)
Feb 25 14:16:35 king postfix/qmgr[16564]: 3536929C6D0: removed
Any ideas why and how I fix this
Reply With Quote
Sponsored Links
  #2  
Old 26th February 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

Modify your fetchmailrc like this: http://www.howtoforge.com/forums/sho...40&postcount=2 (you didn't specify a local user).
__________________
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
  #3  
Old 26th February 2007, 14:11
Madlew2007 Madlew2007 is offline
Junior Member
 
Join Date: Feb 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply Falko.

Quote:
Originally Posted by falko
(you didn't specify a local user).
I don't want it to go to a local user. I want it to lookup the domain in the transport sql table and relay to that.

As all the emails are now in the local user mailbox for Fetchmail, is there a way I can relay these message to the entry in the transport table?

Many thanks for your time.
Reply With Quote
  #4  
Old 27th February 2007, 16:05
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

If you don't want the domain of the original emails change to localhost after they have been fetched by fetchmail, you can use this in fetchmailrc:

Code:
poll MY.POP.COM protocol POP3 localdomains yourdomain.com user "MYUSERNAME" password "MYPASSWORD"
I don't know if this helps...
__________________
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
  #5  
Old 27th February 2007, 18:12
Madlew2007 Madlew2007 is offline
Junior Member
 
Join Date: Feb 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Tried that but still no luck

Have had a look and will try
Code:
poll MY.POP.COM protocol POP3 localdomains yourdomain.com user "MYUSERNAME" password "MYPASSWORD" smtphost yourdomain.com
Reply With Quote
  #6  
Old 2nd March 2007, 09:59
Madlew2007 Madlew2007 is offline
Junior Member
 
Join Date: Feb 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Now I get the message in my logs and a NDR with this:

relay=none, delay=0, status=bounced (mail for mydomain.com loops back to myself)

Anyone else have this sort of setup that can help?
Reply With Quote
  #7  
Old 3rd March 2007, 15:16
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

Please add mydomain.com to the mydestination line in /etc/postfix/main.cf OR to the domains table.
__________________
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
  #8  
Old 6th March 2007, 17:17
Madlew2007 Madlew2007 is offline
Junior Member
 
Join Date: Feb 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The domain is listed in the domains and transport tables.

Changed my poll command to this and re-run, this is what it looks like now.

Code:
set daemon        900
set syslog
set postmaster  root
set no bouncemail
timeout 300
antispam -1
batchlimit 100

poll mail.popserver.com protocol POP3 localdomains mydomain.com user "user@mydomain.com" password "********" smtphost mydomain.com
Now messages get delivered to the fetchmail ~maildir instead of forwarding it using the transport rules. This is the entry in the log:

Code:
Mar  6 15:56:37 king postfix/smtpd[20442]: connect from localhost.localdomain[127.0.0.1]
Mar  6 15:56:37 king postfix/smtpd[20442]: B426529C573: client=localhost.localdomain[127.0.0.1]
Mar  6 15:56:37 king postfix/cleanup[20432]: B426529C573: message-id=<000f01c75ef2$6ea3e5c0$1502fac9@daniel>
Mar  6 15:56:37 king postfix/qmgr[16564]: B426529C573: from=<Irvinepznq@adamsfamilyfarm.com>, size=44539, nrcpt=1 (queue active)
Mar  6 15:56:37 king amavis[19708]: (19708-04) Passed, <Irvinepznq@adamsfamilyfarm.com> -> <fetchmail@mydomain.com>, quarantine spam-ced0e91e723729d046fb3b672699a010-20070306-155637-19708-04, Message-ID: <000f01c75ef2$6ea3e5c0$1502fac9@daniel>, Hits: 8.646
Mar  6 15:56:37 king postfix/smtp[20433]: 3402D29C51B: to=<fetchmail@mydomain.com>, relay=127.0.0.1[127.0.0.1], delay=11, status=sent (250 2.6.0 Ok, id=19708-04, from MTA: 250 Ok: queued as B426529C573)
Mar  6 15:56:37 king postfix/qmgr[16564]: 3402D29C51B: removed
Mar  6 15:56:37 king postfix/smtpd[20442]: disconnect from localhost.localdomain[127.0.0.1]
Thanks again for your time.
Reply With Quote
  #9  
Old 6th March 2007, 17:22
Madlew2007 Madlew2007 is offline
Junior Member
 
Join Date: Feb 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Oh, tell a lie, they are now queueing awaiting delivery to the Exchange server.

This is what webmin says:
Code:
Mail ID		Sent			From 				To 				Size 	Status
B426529C573 	Tue Mar 6 15:56:37 	Irvinepznq@adamsfamilyfarm.com 	fetchmail@mydomain.com 	44 kB 	delivery temporarily suspended: connect to xx.xx.xx.xx[xx.xx.xx.xx]: Connection timed out
But why are they going to fetchmail@mydomain.com
Reply With Quote
  #10  
Old 7th March 2007, 18:44
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 Madlew2007
But why are they going to fetchmail@mydomain.com
I think this is the default user if you don't specify a user in the fetchmailrc file.
__________________
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


All times are GMT +2. The time now is 10:43.


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