Map realm to user

2012-01-10 Thread Pedro Silva
Hi,
I have a postfix/cyrus/sasl mail server authenticating against an ldap 
server.

It all works fine using a 'login:password' authentication but I would 
also like to user 'login@realm:password' authentication for the mail 
accounts (imap and pop3).

The authentication bit work fine when I use 'login@realm' (in imap) but 
no mailbox is opened...
Well my question is: is it possible to map 'login' and 'login@realm' to 
the same mailbox? and if so how can I do that?

Thanks
Pedro Silva
>

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/


Re: Map realm to user

2012-01-11 Thread Pedro Silva
Thanks for the suggestion.
I tried what you said bust the result was the same...

Here is what my logfile looks like using a webmail imap client
When I authenticate with 'user:pass'

cyrus/imap[24503]: accepted connection
cyrus/imap[24503]: login: servername [x.x.x.x] 'user' plaintext User 
logged in
cyrus/imap[24503]: open: user 'user' opened INBOX

now when I use 'user@domain:pass'

cyrus/imap[24572]: accepted connection
cyrus/imap[24572]: login: servername [x.x.x.x] 'user@domain' plaintext 
User logged in

but no inbox is opened and no error is reported.

Here's my imapd.conf configuration

##
lmtp_overquota_perm_failure: yes
configdirectory: /var/lib/cyrus
defaultpartition: default
partition-default: /var/spool/cyrus/mail
partition-news: /var/spool/cyrus/news
newsspool: /var/spool/news
duplicatesuppression: 0
altnamespace: no
unixhierarchysep: no
lmtp_downcase_rcpt: yes
admins: cyrus
allowanonymouslogin: no
autocreatequota: 0
umask: 077
sieveusehomedir: false
sievedir: /var/spool/sieve
hashimapspool: true
allowplaintext: yes
sasl_mech_list: PLAIN
allowapop: no
sasl_minimum_layer: 0
servername: exemple.com
loginrealms: exemple.com
sasl_pwcheck_method: auxprop saslauthd
sasl_auto_transition: no
tls_cert_file: /etc/ssl/multicert.pem
tls_key_file: /etc/ssl/private/multicert.key
tls_ca_path: /etc/ssl/certs
tls_session_timeout: 1440
tls_cipher_list: TLSv1+HIGH:!aNULL:@STRENGTH
lmtpsocket: /var/run/cyrus/socket/lmtp
idlemethod: poll
idlesocket: /var/run/cyrus/socket/idle
notifysocket: /var/run/cyrus/socket/notify
syslog_prefix: cyrus
###



On 10-01-2012 17:58, Andrew Morgan wrote:
> On Tue, 10 Jan 2012, Pedro Silva wrote:
>
>> Hi,
>> I have a postfix/cyrus/sasl mail server authenticating against an ldap
>> server.
>>
>> It all works fine using a 'login:password' authentication but I would
>> also like to user 'login@realm:password' authentication for the mail
>> accounts (imap and pop3).
>>
>> The authentication bit work fine when I use 'login@realm' (in imap) but
>> no mailbox is opened...
>> Well my question is: is it possible to map 'login' and 'login@realm' to
>> the same mailbox? and if so how can I do that?
>
> Assuming you are not using virtual domains in Cyrus, the "servername" 
> setting in imapd.conf is used as the realm when no realm is given 
> (using 'login').  If you set servername to the realm you want to use, 
> then 'login' and 'login@realm' should be the same for Cyrus.
>
> Andy

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/


Cyrus (Sieve) and external programs

2018-05-28 Thread Pedro silva
Hello, 

I'm trying to set up a spam learning system, and I would like to pipe
email places in (for example) the SPAM folder to an external program. 

I have cyrus 2.4.17 

Does any one know how or if this is possible in cyrus (or sieve)? 

I wasn't able to find any documentation about using external programs
with sieve. 

Thanks, 

Pedro Silva
Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Cyrus (Sieve) and external programs

2018-05-29 Thread Pedro silva
Hello Sven, 

Thanks for your answer. 

Actually I would like to set up a system were a user would move his
messages to a spam folder, and by doing so, the message would be sent to
the spam learning system. 

Ive seen something like this in other distributions (eg.:
https://wiki.dovecot.org/HowTo/AntispamWithSieve) I was just wondering
if the same is possible with cyrus or cyrus sieve. 

Best regards, 

Pedro Silva

On 28-05-2018 15:59, Sven Schwedas wrote:

> On 2018-05-28 16:41, Pedro silva wrote: 
> 
>> Hello,
>> 
>> I'm trying to set up a spam learning system, and I would like to pipe
>> email places in (for example) the SPAM folder to an external program.
>> 
>> I have cyrus 2.4.17
>> 
>> Does any one know how or if this is possible in cyrus (or sieve)?
> 
> If you want to (read only) process data already received to train your
> spam filter, just use the individual mail files in cyrus' spool.
> 
> If you want to act on mails being received and possibly delete/redirect
> them, you normally want hook into your MTA, not cyrus/sieve.
> 
> -- 
> Mit freundlichen Grüßen, / Best Regards,
> Sven Schwedas, Systemadministrator
> ✉ sven.schwe...@tao.at | ☎ +43 680 301 7167
> TAO Digital   | Teil der TAO Beratungs- & Management GmbH
> Lendplatz 45  | FN 213999f/Klagenfurt, FB-Gericht Villach
> A8020 Graz| https://www.tao-digital.at
> 
> 
> Cyrus Home Page: http://www.cyrusimap.org/
> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
> To Unsubscribe:
> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus
Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Cyrus (Sieve) and external programs

2018-05-30 Thread Pedro silva
Hei Adam, 

Thanks. 

This is a great starting point. 

I'll try to get it to work with my setup. 

Again, thanks. 

Pedro Silva 

On 30-05-2018 06:11, Adam Mokhtari via Info-cyrus wrote:

> I wrote a script for this purpose in Python 3, for use with rspamd.  I
> only recently got it working, so it may be buggy, and it also may need
> to be modified for your spam system (and your python location), but I
> think it should at least provide a good start for you.  Note that
> using "#!/usr/bin/env python3" at the top does not work.  Perhaps
> someone can translate this into Perl and include it in Cyrus contrib.
> 
> To configure Cyrus to use it, you need the following in imapd.conf:
> 
> event_notifier: external
> notify_external: /path/to/autolearn
> # Just make sure \Junk isn't included here
> event_exclude_specialuse: \Drafts \Sent
> 
> On Tue, 29 May 2018 16:35:53 -0700 (PDT)
> David Lang wrote:
> 
> several years ago I used a system that subscribed to the various
> folders and watched for messages to appear. Unfortunantly, that
> software was abandoned and I haven't gone looking for a replacement
> in the last several years.
> 
> but it did work very well, at very little load on the system
> (fastmail was a little concerned at seeing many connections from me,
> but once they learned that they were mostly idle watching for new
> message notifications, they relaxed a bit)
> 
> David Lang
> 
> On Tue, 29 May 
> 2018, Pedro silva wrote:
> 
> Date: Tue, 29 May 2018 10:16:37 +0100
> From: Pedro silva 
> To: Sven Schwedas 
> Cc: info-cyrus@lists.andrew.cmu.edu,
> Info-cyrus
> 
> Subject: Re: Cyrus (Sieve) and external programs
> 
> Hello Sven,
> 
> Thanks for your answer.
> 
> Actually I would like to set up a system were a user would move his
> messages to a spam folder, and by doing so, the message would be
> sent to the spam learning system.
> 
> Ive seen something like this in other distributions (eg.:
> https://wiki.dovecot.org/HowTo/AntispamWithSieve) I was just
> wondering if the same is possible with cyrus or cyrus sieve.
> 
> Best regards,
> 
> Pedro Silva
> 
> On 28-05-2018 15:59, Sven Schwedas wrote:
> On 2018-05-28 16:41, Pedro silva wrote:
> Hello,
> 
> I'm trying to set up a spam learning system, and I would like to
> pipe email places in (for example) the SPAM folder to an external
> program.
> 
> I have cyrus 2.4.17
> 
> Does any one know how or if this is possible in cyrus (or
> sieve)?   
> If you want to (read only) process data already received to train
> your spam filter, just use the individual mail files in cyrus'
> spool.
> 
> If you want to act on mails being received and possibly
> delete/redirect them, you normally want hook into your MTA, not
> cyrus/sieve.
> 
> --
> Mit freundlichen Grüßen, / Best Regards,
> Sven Schwedas, Systemadministrator
> ✉ sven.schwe...@tao.at | ☎ +43 680 301 7167
> TAO Digital   | Teil der TAO Beratungs- & Management GmbH
> Lendplatz 45  | FN 213999f/Klagenfurt, FB-Gericht Villach
> A8020 Graz| https://www.tao-digital.at
> 
> 
> Cyrus Home Page: http://www.cyrusimap.org/
> List Archives/Info:
> http://lists.andrew.cmu.edu/pipermail/info-cyrus/ To Unsubscribe:
> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus
Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Cyrus (Sieve) and external programs

2018-05-30 Thread Pedro silva
Niels, 

sa-learn would be the way to go, but my spamassassin is not on the same
server as my mailboxes. I tried solution with a common mailbox and
something like fetchmail on my spamassassin machine, but could not get
it to work as I intended. 

You are right about learning based on user experience, but as it is a
score based learning I would like to try to see how it goes. Maybe I'll
come to regret it but well... 

Best regards, 

Pedro Silva 

On 30-05-2018 10:42, Niels Dettenbach via Info-cyrus wrote:

> Am Mittwoch, 30. Mai 2018, 10:44:09 CEST schrieb Pedro silva: 
> 
>> Ive seen something like this in other distributions (eg.:
>> https://wiki.dovecot.org/HowTo/AntispamWithSieve) I was just
>> wondering if the same is possible with cyrus or cyrus sieve.
> 
> Just for reading mail files into i.e. spamassassin efficently periodically 
> (in a 
> small to "large" amount of mailboxes) you could do things (by i.e. cron) 
> like:
> 
> - for a "few hundreds" mailboxes (as long as the shell did not complain a to 
> long result list) by cron:
> 
> spam-learn /var/spool/imap/user/*/SpamLearn/*.
> 
> for i.e. a cyrus imap Folder called "SpamLearn" (i.e. auto-created in every 
> mailbox). You possibly have to adapt the whole path to your config/setup.
> 
> - or for much more of, do a loop over:
> 
> for each user:
> spam-learn /var/spool/imap/user/$user/Spam/*.
> 
> In a 2nd step you may delete the Spam folder content by a little imap script 
> to avoid re-reading yet processed mails. "spam-learn" is a script / program 
> which reads emails direcftly fom files.
> 
> seems a bit ugly, but works very efficient on filesystem level. It sepends 
> from 
> the filesystem layer how powerful this could be for you.
> 
> - If you want to avoid cron and process "instantly" you may use the notifier 
> principle as described from Pedro to start such a script for a single mailbox 
> if /at least one) mail is placed in that Folder..
> 
> - It should be possible to to use inotify or similiar filesystem notification 
> features to start such a script too.
> 
> I'm personally do not like "spam training" by users as this often leads to 
> bad / not valuable results, as many typical end users (by my experience) 
> misunderstand what "spam" (technically) is (and/or change their mind about). 
> I.e. they use "forwarded" "spam" fom any external mail sevice/pop, regular 
> list mail fom a company (which all is a valid mail). Such things leads to 
> false positives or (if less weighted) just not useful processing overhead. 
> But this may depend fom the practical application (i do not use Spam marking 
> ("Spam Folder") - just bouncing - as checking Spam Folders costs the end user 
> additional work time if they rely on email
> 
> good luck.
> best regards,
> 
> niels.
> -- 
> ---
> Niels Dettenbach
> Syndicat IT & Internet
> http://www.syndicat.com
> PGP: https://syndicat.com/pub_key.asc
> ---
> 
> 
> Cyrus Home Page: http://www.cyrusimap.org/
> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
> To Unsubscribe:
> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus
Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Cyrus (Sieve) and external programs

2018-06-11 Thread Pedro silva
Hello Adam, 

I've tried with fetchmail before, but coudn't get it to work, you
explanation is a big help with that method, I'll try it. 

Thanks. 

Pedro Silva 

On 08-06-2018 15:22, Adam Tauno Williams wrote:

>> sa-learn would be the way to go, but my spamassassin is not on the
>> same server as my mailboxes. I tried solution with a common mailbox
>> and something like fetchmail on my spamassassin machine, but could
>> not get it to work as I intended.
>> You are right about learning based on user experience, but as it is a
>> score based learning I would like to try to see how it goes. Maybe
>> I'll come to regret it but well...
> 
> The fetchmail method works.
> 
> In the spamd home directory create a .fetchmailrc file like:
> 
> poll aleph.wmmi.net protocol IMAP:
> user {user} with password {secret}
> 
> Where {user} is a system account with access to the user.{user}.SPAM
> folders.
> 
> Then you want to run:
> fetchmail --verbose --keep --all --norewrite  --folder
> 'user.{user}.SPAM' --mda '/usr/bin/sa-learn --spam'  AS THE "spamd"
> USER for each user.
> 
> It works for smallish systems.   Easily enough adapted to learn from
> one centralized folder provided your mail client has an easy way to get
> SPAM reported messages into that folder.
> 
> -- 
> Meetings Coordinator, Michigan Association of Railroad Passengers
> 537 Shirley St NE Grand Rapids, MI 49503-1754 Phone: 616.581.8010
> E-mail: awill...@whitemice.org GPG#D95ED383 Web: http://www.marp.org
> 
> Cyrus Home Page: http://www.cyrusimap.org/
> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
> To Unsubscribe:
> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus
Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus