Re: [spamdyke-users] need to insert a special rule..
On 01/07/2012 07:39 AM, turgut kalfaoğlu wrote: For some reason, we have massive amounts of mail coming from facebook, to one local user. I am unable to stop it, because the From is different every time, there are hundreds of users in the To: header, and the local recipient is always one local poor guy. I'm good at C programming and I'd like to put something like if (strstr(sender,facebook) strstr(recipient,localsucker)) rejectmail++; into spamdyke.. I'd appreciate any *pointers where to place a such code and how it should read. Many thanks, -turgut Have you suggested that the local user change their notification preferences in facebook? When they're logged in, there's a drop down menu you can click in the top right corner. Select Account Settings, then click Notifications in the left column. This is where each user can control which emails are sent to them, and which are not. -- -Eric 'shubes' ___ spamdyke-users mailing list spamdyke-users@spamdyke.org http://www.spamdyke.org/mailman/listinfo/spamdyke-users
Re: [spamdyke-users] need to insert a special rule..
In case anyone else needs it, here is my quick hack that stops mail coming from facebook to a local user called cem.duran: In spamdyke.c: 1) Find the line that starts with filter_identical_from_to(current_settings, current_settings-current_options- (etc -- huge line) 2) copy and paste that line right under it, just change the function name to filter_facebook(.) so it looks like: filter_identical_from_to(current_settings, current_settings-current_options-filter_action, current_settings-current_opti filter_facebook(current_settings, current_settings-current_options-filter_action, current_settings-current_options-filt. filter_recipient_graylist(current_sett. 3) in filter.c, add this function somewhere: int filter_facebook(struct filter_settings *current_settings, int *target_action, int *return_action_locked, struct rejection_data **target_rejection, struct rejection_data *target_rejection_buf, char *target_message_buf, int size_target_message_buf) { int return_value; char tmp_sender_address[MAX_ADDRESS + 1]; char tmp_recipient_address[MAX_ADDRESS + 1]; int strlen_sender_address; int strlen_recipient_address; return_value = FILTER_DECISION_UNDECIDED; /* Check if the sender and recipient addresses are the same. */ reassemble_address(current_settings-sender_username, current_settings-sender_domain, NULL, tmp_sender_address, MAX_ADDRESS, strlen_sender_address); reassemble_address(current_settings-recipient_username, current_settings-recipient_domain, NULL, tmp_recipient_address, MAX_ADDRESS, strlen_recipient_address); if (strstr(current_settings-sender_domain,facebook) strstr(current_settings-recipient_username,cem.duran)) { *target_action = FILTER_DECISION_TRANSIENT_DO_FILTER; set_rejection(current_settings, REJECTION_IDENTICAL_FROM_TO, target_rejection, target_rejection_buf, target_message_buf, size_target_message_buf, NULL, NULL, NULL, 0); SPAMDYKE_LOG_VERBOSE(current_settings, LOG_VERBOSE_FILTER_IDENTICAL_FROM_TO, tmp_sender_address, tmp_recipient_address); return_value = FILTER_DECISION_TRANSIENT_DO_FILTER; } return(return_value); } 4) done, make and copy resulting spamdyke to /usr/local/bin (at least thats where mine is) 5) PS: Since this function is a copy of the same-sender-and-recipient function, in the logs you'll see DENIED_IDENTICAL_SENDER_RECIPIENT in the logs. I said it was a quick hack :) -turgut On 01/08/2012 12:57 AM, turgut kalfaoglu wrote: Unfortunately my plesk-qmail does not seem to have that patch installed. It's a huge pain to recompile qmail with plesk's patches, plus the empf.. -t On 07.01.2012 18:02, Eric Shubert wrote: On 01/07/2012 07:39 AM, turgut kalfaoğlu wrote: For some reason, we have massive amounts of mail coming from facebook, to one local user. I am unable to stop it, because the From is different every time, there are hundreds of users in the To: header, and the local recipient is always one local poor guy. I'm good at C programming and I'd like to put something like if (strstr(sender,facebook)strstr(recipient,localsucker)) rejectmail++; into spamdyke.. I'd appreciate any *pointers where to place a such code and how it should read. Many thanks, -turgut Do you have the eMPF patch (http://www.inter7.com/?page=empf-install) applied to qmail? If you do, I believe that can be used to accomplish such a rule (and more). FWIW. ___ spamdyke-users mailing list spamdyke-users@spamdyke.org http://www.spamdyke.org/mailman/listinfo/spamdyke-users ___ spamdyke-users mailing list spamdyke-users@spamdyke.org http://www.spamdyke.org/mailman/listinfo/spamdyke-users
Re: [spamdyke-users] need to insert a special rule..
Wait a second... you're trying to block messages where the envelope sender address is someone@facebook? Your previous message indicated that the From line was someone@facebook and the envelope sender was random. If your change below actually works for what you need, why not just use the sender blacklist? That's basically what you've duplicated. If you need to blacklist facebook addresses for just one user, you can setup a configuration directory so the blacklist only affects that one recipient. -- Sam Clippinger On Jan 8, 2012, at 3:08 AM, turgut kalfaoğlu wrote: In case anyone else needs it, here is my quick hack that stops mail coming from facebook to a local user called cem.duran: In spamdyke.c: 1) Find the line that starts with filter_identical_from_to(current_settings, current_settings-current_options- (etc -- huge line) 2) copy and paste that line right under it, just change the function name to filter_facebook(.) so it looks like: filter_identical_from_to(current_settings, current_settings-current_options-filter_action, current_settings-current_opti filter_facebook(current_settings, current_settings-current_options-filter_action, current_settings-current_options-filt. filter_recipient_graylist(current_sett. 3) in filter.c, add this function somewhere: int filter_facebook(struct filter_settings *current_settings, int *target_action, int *return_action_locked, struct rejection_data **target_rejection, struct rejection_data *target_rejection_buf, char *target_message_buf, int size_target_message_buf) { int return_value; char tmp_sender_address[MAX_ADDRESS + 1]; char tmp_recipient_address[MAX_ADDRESS + 1]; int strlen_sender_address; int strlen_recipient_address; return_value = FILTER_DECISION_UNDECIDED; /* Check if the sender and recipient addresses are the same. */ reassemble_address(current_settings-sender_username, current_settings-sender_domain, NULL, tmp_sender_address, MAX_ADDRESS, strlen_sender_address); reassemble_address(current_settings-recipient_username, current_settings-recipient_domain, NULL, tmp_recipient_address, MAX_ADDRESS, strlen_recipient_address); if (strstr(current_settings-sender_domain,facebook) strstr(current_settings-recipient_username,cem.duran)) { *target_action = FILTER_DECISION_TRANSIENT_DO_FILTER; set_rejection(current_settings, REJECTION_IDENTICAL_FROM_TO, target_rejection, target_rejection_buf, target_message_buf, size_target_message_buf, NULL, NULL, NULL, 0); SPAMDYKE_LOG_VERBOSE(current_settings, LOG_VERBOSE_FILTER_IDENTICAL_FROM_TO, tmp_sender_address, tmp_recipient_address); return_value = FILTER_DECISION_TRANSIENT_DO_FILTER; } return(return_value); } 4) done, make and copy resulting spamdyke to /usr/local/bin (at least thats where mine is) 5) PS: Since this function is a copy of the same-sender-and-recipient function, in the logs you'll see DENIED_IDENTICAL_SENDER_RECIPIENT in the logs. I said it was a quick hack :) -turgut On 01/08/2012 12:57 AM, turgut kalfaoglu wrote: Unfortunately my plesk-qmail does not seem to have that patch installed. It's a huge pain to recompile qmail with plesk's patches, plus the empf.. -t On 07.01.2012 18:02, Eric Shubert wrote: On 01/07/2012 07:39 AM, turgut kalfaoğlu wrote: For some reason, we have massive amounts of mail coming from facebook, to one local user. I am unable to stop it, because the From is different every time, there are hundreds of users in the To: header, and the local recipient is always one local poor guy. I'm good at C programming and I'd like to put something like if (strstr(sender,facebook)strstr(recipient,localsucker)) rejectmail++; into spamdyke.. I'd appreciate any *pointers where to place a such code and how it should read. Many thanks, -turgut Do you have the eMPF patch (http://www.inter7.com/?page=empf-install) applied to qmail? If you do, I believe that can be used to accomplish such a rule (and more). FWIW. ___ spamdyke-users mailing list spamdyke-users@spamdyke.org http://www.spamdyke.org/mailman/listinfo/spamdyke-users ___ spamdyke-users mailing list spamdyke-users@spamdyke.org http://www.spamdyke.org/mailman/listinfo/spamdyke-users ___ spamdyke-users mailing list spamdyke-users@spamdyke.org http://www.spamdyke.org/mailman/listinfo/spamdyke-users
Re: [spamdyke-users] need to insert a special rule..
As mentioned earlier you can setup a per user blacklist which would accomplish that. Blacklist Facebook for just a single user. Check the documentation for config directories. It's a bit tricky but might help you to accomplish the same without patching spamdyke. Cheers, Sebastian On 09.01.2012, at 07:44, turgut kalfaoğlu tur...@kalfaoglu.com wrote: On 01/09/2012 02:33 AM, Sam Clippinger wrote: But the sender's address always ends in @facebook.com, right? The sender blacklist should still work. I did not want to stop all mail from facebook - it was only that combination from facebook and recipient is someone on this system that I wanted to prevent.. I could not find a better way. -t ___ spamdyke-users mailing list spamdyke-users@spamdyke.org http://www.spamdyke.org/mailman/listinfo/spamdyke-users ___ spamdyke-users mailing list spamdyke-users@spamdyke.org http://www.spamdyke.org/mailman/listinfo/spamdyke-users
Re: [spamdyke-users] need to insert a special rule..
Btw, it's hopeless trying to contact Facebook over such issues. God, I hate big companies with free services. -turgut On 01/07/2012 04:39 PM, turgut kalfaoğlu wrote: For some reason, we have massive amounts of mail coming from facebook, to one local user. I am unable to stop it, because the From is different every time, there are hundreds of users in the To: header, and the local recipient is always one local poor guy. I'm good at C programming and I'd like to put something like if (strstr(sender,facebook) strstr(recipient,localsucker)) rejectmail++; into spamdyke.. I'd appreciate any *pointers where to place a such code and how it should read. Many thanks, -turgut ___ spamdyke-users mailing list spamdyke-users@spamdyke.org http://www.spamdyke.org/mailman/listinfo/spamdyke-users ___ spamdyke-users mailing list spamdyke-users@spamdyke.org http://www.spamdyke.org/mailman/listinfo/spamdyke-users
Re: [spamdyke-users] need to insert a special rule..
Unfortunately my plesk-qmail does not seem to have that patch installed. It's a huge pain to recompile qmail with plesk's patches, plus the empf.. -t On 07.01.2012 18:02, Eric Shubert wrote: On 01/07/2012 07:39 AM, turgut kalfaoğlu wrote: For some reason, we have massive amounts of mail coming from facebook, to one local user. I am unable to stop it, because the From is different every time, there are hundreds of users in the To: header, and the local recipient is always one local poor guy. I'm good at C programming and I'd like to put something like if (strstr(sender,facebook) strstr(recipient,localsucker)) rejectmail++; into spamdyke.. I'd appreciate any *pointers where to place a such code and how it should read. Many thanks, -turgut Do you have the eMPF patch (http://www.inter7.com/?page=empf-install) applied to qmail? If you do, I believe that can be used to accomplish such a rule (and more). FWIW. ___ spamdyke-users mailing list spamdyke-users@spamdyke.org http://www.spamdyke.org/mailman/listinfo/spamdyke-users
Re: [spamdyke-users] need to insert a special rule..
Too bad. I'm not suggesting you switch from plesk, but I use http://wiki.qmailtoaster.com which has eMPF built in, and is pretty simple to admin so long as you're comfortable with the CLI. -- -Eric 'shubes' On 01/07/2012 03:57 PM, turgut kalfaoglu wrote: Unfortunately my plesk-qmail does not seem to have that patch installed. It's a huge pain to recompile qmail with plesk's patches, plus the empf.. -t On 07.01.2012 18:02, Eric Shubert wrote: On 01/07/2012 07:39 AM, turgut kalfaoğlu wrote: For some reason, we have massive amounts of mail coming from facebook, to one local user. I am unable to stop it, because the From is different every time, there are hundreds of users in the To: header, and the local recipient is always one local poor guy. I'm good at C programming and I'd like to put something like if (strstr(sender,facebook)strstr(recipient,localsucker)) rejectmail++; into spamdyke.. I'd appreciate any *pointers where to place a such code and how it should read. Many thanks, -turgut Do you have the eMPF patch (http://www.inter7.com/?page=empf-install) applied to qmail? If you do, I believe that can be used to accomplish such a rule (and more). FWIW. ___ spamdyke-users mailing list spamdyke-users@spamdyke.org http://www.spamdyke.org/mailman/listinfo/spamdyke-users ___ spamdyke-users mailing list spamdyke-users@spamdyke.org http://www.spamdyke.org/mailman/listinfo/spamdyke-users