Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

Procmail - Postfix - Gmail spam filtering

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
3 posts • Page 1 of 1
Author
Message
pelckyboy
n00b
n00b
Posts: 36
Joined: Sat May 10, 2003 7:53 pm

Procmail - Postfix - Gmail spam filtering

  • Quote

Post by pelckyboy » Thu Jan 25, 2007 10:10 pm

A few weeks ago I read an article on how to set up your GMail account as spam filter, described on : http://blog.faqs.it/?p=8

I have set up my postfix with my isp smtp server for sending e-mail following the http://gentoo-wiki.com/HOWTO_Email_Syst ... me_Network.

Now I forward all my incoming mail to my GMail for filtering :

Code: Select all

# forward to gmail account for spam filtering - cf http://mboffin.com/post.aspx?id=1636
:0
* !X-Forwarded-For: user@gmail.com user@domain.com
{
    :0fw
    | formail -IDelivered-To
    
    :0
    ! user@gmail.com
}
My problem is if I try and forward to my ISP SMTP server, it will see the mail as coming from my local account address and rejects it :
Final-Recipient: rfc822; user@gmail.com
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; host smtp.myisp.com[x.y.z.w] said: 553 5.1.8
<user@domain.com>... Domain of sender address
user@domain.com does not exist (in reply to MAIL
FROM command)
How would I solve this ?

Thanks,

kristof
Top
Bones McCracker
Veteran
Veteran
User avatar
Posts: 1611
Joined: Tue Mar 14, 2006 8:23 am
Location: U.S.A.

  • Quote

Post by Bones McCracker » Fri Feb 02, 2007 5:30 am

Since the GMail MTA will only relay mail coming from a GMail user, you can't retain the original sender. Therefore, when GMail sends it out, it's coming from you. I don't see any way around this, given the limited control you have over the GMail MTA.

That said, in my opinion, this seems like an absurd way to simply apply a spam filter. Sometimes people do things just because they can, not because it makes any sense. Inbound routing via GMail makes sense for individual users who use the GMail email address as their publically-known email address. GMail also makes a good outbound MTA for people running boxes that need to send system mail via smtp. Beyond that, I think that if you have gone to the trouble of setting up a full-blown email system you are defeating the purpose by trying to rely on somebody else's email server that's not even in the normal workflow to do your filtering.

"But that's just me..." :)

Other than that, you can get an MX (possible even if you have a dynamic IP address) that allows you to forward the mail directly from GMail to your own mail server, then write a procmail recipe that searches the headers for the actual/original sender and rewrites the from address before delivering it to you. Also inefficient and convoluted.
Top
darkphader
Veteran
Veteran
User avatar
Posts: 1225
Joined: Thu May 09, 2002 11:24 pm
Location: Motown
Contact:
Contact darkphader
Website

  • Quote

Post by darkphader » Tue Jul 10, 2007 6:56 am

Seems pretty convoluted to me as well.

Use Google's hosted mail (gmail for domains). It will be the frontend and do the spam filtering (and it is really, really good at this). Use fetchmail to get your domain-gmail via pop3 (here fetchmail delivers to postfix which delivers to cyrus-imap). Postfix is also my outgoing mail server, and as I have both multiple domains and multiple users in those domains it properly relays through either my ISP or gmail depending on sender address (my domain-gmail accounts then have a copy of all sent messages sent via my "normal" email clients so a full record is available when using the web client). Much more straightforward (of course it seems that way to me - it's what I do).

Chris
WYSIWYG - What You See Is What You Grep
Top
Post Reply

3 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic