Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hello Gilles,

Thanks a lot for this great app ! The only drawback I have is that spam emails coming from host1 are directly delivered in my mailbox on host2. I have seen that pipemess could do something about this. How could I redirect all message to my host2 anti-spam amavisd-new with spamassassin/clamav ?

Kind regards

Philippe

You must be logged in to vote

Replies: 3 comments · 4 replies

Comment options

I don't understand the issue. Spam messages are not filtered on host1 but you want to filter them with imapsync + spamassassin/clamav instead of just spamassassin/clamav ?

You must be logged in to vote
1 reply
@pschelte
Comment options

host1 is a kind of backup server and In fact the spam filtering is only done on host2, it is there where I have my updated bayes database, I would like to have the email coming from host1 filtered by the spamassassin/clamav before being delivered to the mailbox of host2. Hope I'm more clear now.

Comment options

It's more precise. The next question is why don't you use host2 as the first email receptor?

But you don't have to answer, it's your business.

For the imapsync --pipemess question, you need a command that takes a message from stdin, does anything it wants to it, and delivers the modified/unmodified message to stdout.

https://imapsync.lamiral.info/README
...

     --pipemess     cmd  : Apply this cmd command to each message content
                           before the copy.
     --pipemess     cmd  : and this one, etc.
                           With several --pipemess, the output of each cmd
                           command (STDOUT) is given to the input (STDIN)
                           of the next command.
                           For example,
                           --pipemess cmd1 --pipemess cmd2 --pipemess cmd3
                           is like a Unix pipe:
                           "cat message | cmd1 | cmd2 | cmd3"

I search a little but didn't find a tool interfacing the stdin/stdout way with amavis.

You must be logged in to vote
0 replies
Comment options

I searched more and found out that spamassassin or spamc are the commands to do the job.
So use:

imapsync ... --pipemess spamassassin 

or

imapsync ... --pipemess spamc

Those commands have to be working, installed, and configured, on the host running imapsync.

You must be logged in to vote
3 replies
@migratis
Comment options

Thanks a lot Gilles, I will try this ans will make a feedback that would be useful for others.

@pschelte
Comment options

Hello Gilles,
Here is my feedback after using --pipemess this way, the result is that even when no messages has to be synchronized, the --pipemess command is executed, then I have this kind of logs in spamd :

Aug 11 13:00:02 [HOST] spamd[3714527]: spamd: connection from 127.0.0.1 [127.0.0.1]:54808 to port 783, fd 6
Aug 11 13:00:02 [HOST] spamd[3714527]: spamd: setuid to amavis succeeded
Aug 11 13:00:02 [HOST] spamd[3714527]: spamd: processing message (unknown) for amavis:120
Aug 11 13:00:02 [HOST] spamd[3714527]: spamd: identified spam (8.0/5.0) for amavis:120 in 0.0 seconds, 1 bytes.
Aug 11 13:00:02 [HOST] spamd[3714527]: spamd: result: Y 7 - EMPTY_MESSAGE,MISSING_DATE,MISSING_FROM,MISSING_HEADERS,MISSING_MID,MISSING_SUBJECT,NO_HEADERS_MESSAGE,NO_RECEIVED,NO_RELAYS scantime=0.0,size=1,user=amavis,uid=120,required_score=5.0,rhost=127.0.0.1,raddr=127.0.0.1,rport=54808,mid=(unknown),autolearn=no autolearn_force=no
Aug 11 13:00:02 [HOST] dovecot: imap-login: Login: user=<[EMAIL]>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=3716655, TLS, session=<g4FDEfXlOOR/AAAB>

kind regards

Philippe

@gilleslamiral
Comment options

That's strange.
Can you show me the log around one of these messages, with --debugmess option.
I see on your spamd log "size=1".
Is it a one-byte message?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.