
25th February 2007, 15:34
|
|
Junior Member
|
|
Join Date: Feb 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

26th February 2007, 13:37
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,685
Thanks: 1,899
Thanked 2,599 Times in 2,448 Posts
|
|
Modify your fetchmailrc like this: http://www.howtoforge.com/forums/sho...40&postcount=2 (you didn't specify a local user).
|

26th February 2007, 14:11
|
|
Junior Member
|
|
Join Date: Feb 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

27th February 2007, 16:05
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,685
Thanks: 1,899
Thanked 2,599 Times in 2,448 Posts
|
|
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...
|

27th February 2007, 18:12
|
|
Junior Member
|
|
Join Date: Feb 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

2nd March 2007, 09:59
|
|
Junior Member
|
|
Join Date: Feb 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|

3rd March 2007, 15:16
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,685
Thanks: 1,899
Thanked 2,599 Times in 2,448 Posts
|
|
Please add mydomain.com to the mydestination line in /etc/postfix/main.cf OR to the domains table.
|

6th March 2007, 17:17
|
|
Junior Member
|
|
Join Date: Feb 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

6th March 2007, 17:22
|
|
Junior Member
|
|
Join Date: Feb 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

7th March 2007, 18:44
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,685
Thanks: 1,899
Thanked 2,599 Times in 2,448 Posts
|
|
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.
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 07:53.
|
Recent comments
1 day 9 hours ago
1 day 12 hours ago
2 days 7 min ago
2 days 2 hours ago
2 days 7 hours ago
2 days 13 hours ago
2 days 22 hours ago
3 days 27 min ago
3 days 8 hours ago
3 days 10 hours ago